[Quick BP to C++] Core Redirector - Asset to C++

Added a struct core redirector in \Config\DefaultEngine.ini, tested in the following formats (not all at once):

[CoreRedirects]
+StructRedirects=(OldName="/Game/_Core/Data/Structs/World/Weather/Seasonal/S_OLD_Weather_Season.S_OLD_Weather_Season",NewName="/Script/GameCore.S_WeatherSeason")
+StructRedirects=(OldName="/Game/_Core/Data/Structs/World/Weather/Seasonal/S_OLD_Weather_Season",NewName="/Script/GameCore.S_WeatherSeason")
+StructRedirects=(OldName="/Game/_Core/Data/Structs/World/Weather/Seasonal/S_OLD_Weather_Season",NewName="S_WeatherSeason")
+StructRedirects=(OldName="S_OLD_Weather_Season",NewName="/Script/GameCore.S_WeatherSeason")
+StructRedirects=(OldName="S_OLD_Weather_Season",NewName="S_WeatherSeason")
+StructRedirects=(OldName="S_OLD_Weather_Season.S_OLD_Weather_Season",NewName="S_Weather_Season")
+StructRedirects=(OldName="S_OLD_Weather_Planetary",NewName="/Script/GameCore.S_WeatherPlanetary",OverrideClassName="/Script/CoreUObject.Struct")

Redirector is supposed to redirect a blueprint struct asset to a c++ USTRUCT (BlueprintType), however it does not redirect anything. The rules in this example were added one by one during testing. Adding multiple lines at once results in a logged message that there are “conflicting rules”.

Expectation:
Properties, datatables, BP nodes using old struct datatype (BP) should be redirected to c++ datatype.

Actual result:
Nothing happens.

bump

Can this be automated or am I going to spend all summer on manually making / breaking / clicky clicky blueprint nodes?

bump :yum: :arrows_counterclockwise: :arrow_heading_up: :up:

bumpp

:coffee:

Have you tried to fix the conflicting rules? Some are the exact same OldName :slight_smile:

But other then that I think that for redirect Blueprint stuff you should do something like this (I have never tried BP to code only code to code):

Blockquote
+StructRedirects=(OldName=“{BlueprintStruct}”,NewName=“/Script/{Module}.{NativeStruct}”,OverrideClassName=“/Script/CoreUObject.Struct”)

Blockquote
OverrideClassName
“(Optional) Specifies a change to the underlying class of the UCLASS. This is generally used to change a Blueprint class to a native class.”

I tested the rules one by one, I just posted them all at once to show what I have tried already. At one point I tried them all at once just to see if the log would show anything and that’s when the “conflict” message appeared, so at least I know it is doing something.
Using the rules one by one results in absolute nothing, not even a log message.

I’m going to test this, I thought documentation wrote this for UCLASS only. Will reply after testing.

This format has been tested and does not work:

+StructRedirects=(OldName=“S_OLD_Weather_Planetary”,NewName=“/Script/GameCore.S_WeatherPlanetary”,OverrideClassName=“/Script/CoreUObject.Struct”)

Did some test and I can’t get it to work either for BPStruct to CodeStruct.
Nothing even happen if I try to redirect BPStruct to BPStruct…

Redirect CodeStruct to CodeStruct work fine.

So not sure if there are some more magic you need to do or if it’s just broken.

bump

bump

Related for c++ to c++ and probably BP to c++, to make the matter more complex the redirector may fail silently after adding it properly.

Widgets destroyed after moving c++ class from project to plugin

Hi! Have you been successful?
I’ve been trying all day to replace the BP structure with C++. I was able to do it with ENUM, but the structure is unresponsive.

Not at all. I gave up fighting. This is another dead / half working feature. Best to start from scratch in c++ and develop modules one by one, then at the absolute last moment implement blueprints if you absolutely have to.

Bump, seems to still be broken.

I have a blueprint to C++ enum redirector working. No luck with structs.

If I had cmd line argument -DebugCoreRedirects I get a message confirming when something is redirected… Absolutely nothing when it comes to the structs I’ve redirected, no error, no message, just nothing.

bump same here

Try it like this:

For enums, use regular EnumRedirects, but with ValueChanges parameter set for each variable name as with structs.

I recently faced a similar issue and found a solution, so just wanna share it here. Due to a subtle bug in UE StructRedirects is not processed properly, so if using a StructRedirects I needed to complement it with ObjectRedirects like this

+StructRedirects=(OldName=“”, NewName=“”, OverrideClassName=“/Script/CoreUObject.ScriptStruct”)
+ObjectRedirects=(OldName=“”, NewName=“”, OverrideClassName=“/Script/CoreUObject.ScriptStruct”)