Is is possible to create a redirector from a blueprint variable to a uproperty defined in code?

David,

I’m really sorry for the dead air here. The ticket was bounced around a bit and seemed to have gotten lost. This is properly back on the radar now, and will make sure that doesn’t happen again.

From discussions with the teams responsible for the redirection system, we’re confident that the system should be handling your case. Further, doing local tests we’re still not able to hit the issues that you’ve seen.

Looking at your code snippet again, I think I may have found a typo though:

[CoreRedirects] +EnumRedirects=(OldName="/Game/GlobalData/Enums/Enum_AI_CombatStates.Enum_AI_CombatStates",NewName="/Script/RsGameTechRT.ERsCombatState", ValueChanges=(("Enum_AI_CombatStates::NewEnumerator0","ERsCombatState::Neutral"),("Enum_AI_CombatStates::NewEnumerator1","ERsCombatState::Attacking")),("Enum_AI_CombatStates::NewEnumerator2","ERsCombatState::Reaction")),("Enum_AI_CombatStates::NewEnumerator3","ERsCombatState::Blocking")),("Enum_AI_CombatStates::NewEnumerator4","ERsCombatState::Parrying")),("Enum_AI_CombatStates::NewEnumerator5","ERsCombatState::Evading")),("Enum_AI_CombatStates::NewEnumerator6","ERsCombatState::Stunned")),("Enum_AI_CombatStates::NewEnumerator7","ERsCombatState::Telekinesis")),OverrideClassName="/Script/CoreUObject.Enum")

It looks like you’re parenthesis are mismatched here.

Basically, removing the contents I see this:

    [CoreRedirects] +EnumRedirects=( ValueChanges=((),()),()),()),()),()),()),)),OverrideClassName="/Script/CoreUObject.Enum")

Notice here that you have several unmatched end parentheses (a total of 15, and only 9 open parentheses).

Thanks,
Jon N.

Hello,

It sounds like there may be some code path that isn’t properly piping through the redirectors, but I’d need to confirm. Does this only happen if you shutdown and restart the editor, or is it enough to close the BP Tab for the BP in question? Also, is this for any blueprint or just things like AnimBP?

If it’s the former, it may have to do with when the BP is initially loaded. Even in the editor, we don’t always load all BPs. We have special code that handles this so they can still show up in selection menus (things like FUnloadedBlueprintData).

It may be worthwhile to close all the windows in the Editor, restart it, attach the debugger, and then place breakpoints in UBlueprint::PostLoad and whatever the Native BaseClass for the Blueprint’s PostLoad as well. From there, see if you’re hitting the redirector code.

Thanks,
Jon N.

Hi Jon,

The data has changed so this isn’t causing an issue. I tried to reproduce it by going back in perforce but it did not happen. I think we can close this issue for now.

Thanks

Is anybody watching this thread anymore? Worked like a charm for converting my enums, but I have another similar question. I have an animnotify class created in blueprint which accepts a structure for input. When I redirect the class to my c++ equivalent I lose all of the structure data, which is passed by many animations. I’ve tried redirecting the structure itself to no avail. Is there some similar trick to this thread?

I was able to get the code below to work, when adding it to my project’s DefaultEngine.ini. I was able to use it to replace a blueprints Enum with a C++ Enum asset.

In my blueprints, the Enum .uasset was called GettingShotBodyParts. The Enum defined in my C++ was called EBodyPartsForShooting

Internally, all of the blueprint Enum values are called NewEnumerator0, NewEnumerator1, NewEnumerator2. This is true for every Unreal Project.

[CoreRedirects]
+EnumRedirects=(OldName=“GettingShotBodyParts”,NewName="/Script/MyProject5.EBodyPartsForShooting",OverrideClassName="/Script/CoreUObject.Enum",ValueChanges=((“NewEnumerator0”,“EBodyPartsForShooting::PART_Head”),(“NewEnumerator1”,“EBodyPartsForShooting::PART_Neck”),(“NewEnumerator2”,“EBodyPartsForShooting::PART_Pec_Left”),(“NewEnumerator3”,“EBodyPartsForShooting::PART_Pec_Right”),(“NewEnumerator4”,“EBodyPartsForShooting::PART_Foot_Left”),(“NewEnumerator5”,“EBodyPartsForShooting::PART_Foot_Right”),(“NewEnumerator6”,“EBodyPartsForShooting::PART_None”)))

I want people to see your comment, exactly this way works for UE4.26, thank you