If I’m understanding the core redirect system correctly, I should be able to use it to route all references from a BP to an equivalent C++ asset. I would like to do this with an enum in order to convert the enum from BP to C++ without having to manually replace every reference to that BP enum.
My C++ enum is set up like this in a file called “FooEnum.h”
#include "ObjectMacros.h"
UENUM(BlueprintType)
enum class EFooEnum : uint8
{
Foo,
Bar,
};
My core redirect is as follows
[CoreRedirects]
+EnumRedirects=(OldName="ENUM_Foo", NewName="/Script/MyGame.FooEnum", OverrideClassName="/Script/CoreUObject.Enum", ValueChanges=(("Foo", "EFooEnum::Foo"), ("Bar", "EFooEnum::Bar"))
When I load the project, I get a string of errors reading “Failed to lead /Script/MyGame.FooEnum”. Is this a problem with my header, a problem with the core redirect, or am I trying to do something with the core redirect that should not be done?
Edit: I tried shortening the core redirect to +EnumRedirects=(OldName=“ENUM_Foo”, NewName=“/Script/MyGame.FooEnum”) as seen in the UE4 source but this crashes the engine on launch with “Assertion failed: InPos >= 0 && InPos <= TotalSizeOrMaxInt64IfNotReady()”