Download

How to rename a BlueprintType struct?

I’m trying to rename a struct I made in c++ using the rename refactoring in Visual Studio 19. But whenever I do so, all the Blueprints that are using that struct all revert to default values.

Old name on MyBlueprintLibrary.h


USTRUCT(BlueprintType)
struct FAbilityStruct
{
  GENERATED_BODY()
...
};

New name:


USTRUCT(BlueprintType)
struct FAbilityInputData
{
  GENERATED_BODY()
...
};

The struct being used on MyCharacter.h:


UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Abilities)
TArray<struct FAbilityInputData> Abilities;

I also tried adding this redirect on DefaultEngine.ini:


[/Script/Engine.Engine]
+ActiveStructRedirects=(OldStructName="FAbilityStruct",NewStructName="FAbilityInputData")

But none of that seem to work. After renaming and adding the redirect, all Blueprints using the struct will reset to default anyway.

Am I using the redirect incorrectly? Is there some other way of renaming to avoid the reset? Or is this kind of thing just not supported by Unreal and I am supposed to manually refill dozens of blueprints with data?

This is supported by Unreal, I had to rename classes:

Core Redirects:

NOTE



[CoreRedirects]
+StructRedirects=(OldName="MyStruct",NewName="MyNewStruct")