Download

Redirecting properties using core redirects to native parent class

I’m trying to use the core redirects in 4-26 to change a property from the blueprint class to its native c++ parent class. It just won’t redirect the property, but the funny thing is that if I right click the property in the blueprint and do replace references it will successfully replace all instances of the blueprint variable with the selected c++ variable. I have a lot of variables and really don’t want to manually replace each one in the editor. It would be greatly appreciated if anyone has a clue as to why it won’t redirect using the core redirects.

How did you write the redirects? Did you make sure to include the ‘OverrideClassName’ parameter?

No, I did not include the override class name, Looking into the source files for the redirectors it seems that you would put /Script/CoreUObject.Property. Tried this but it still doesn’t redirect my float variable. In a test project I used this redirect:

+PropertyRedirects=(OldName=“TestVarBP”, NewName=“TestVar”, OverrideClassName="/Script/CoreUObject.Property")

Still doesn’t work.

Yeah that was the “proper” was I was going to instruct on the redirect statement as I heard the Override statement was mandatory for it to work. A shame it didn’t fix it, I hope to hear the solution as well since these redirects are a common thing in a large project.

It may not work, but did you also consider fixing the redirects in your main content folder as well? Maybe those redirects are interfering with the DefaultEngine.ini redirects?

Did you try setting the MatchSubstring to true?

+PropertyRedirects=(OldName="MyOldActor.OldProperty", NewName="MyNewActor.NewProperty", MatchSubstring=true)

I’ve tried matchsubstring. Also, I’ve tried about every combination of including reference path on the oldname and newname, nothing seems to work. It will redirect fine if it’s a c++ variable to another c++ variable, but it just won’t update the BP variable. What do you mean “fix redirects in main content folder” ?

If you right click on the Content folder of your Blueprint Project, there is an option to fix the redirectors. This only works in the Blueprint Redirects, right clicking on the C++ folder only gives you the option to make a new C++ Class, which is why you need the redirectors in the .ini file. Right clicking and fixing redirectors on the content folder solves a lot of blueprint issues and may help solve this one in combination of what you’re already doing. I fix my BP redirects often, even when there may not be any. Worth a shot

Gotcha! I’m aware of that and do it anytime I mess w/ the blueprint file structure, just wasn’t sure what you were talking about. I did also try that, to no avail. Thanks for the input though. It seems that unreal just doesn’t like redirecting blueprint properties to c++. All of my projects use c++ base classes and I derive my blueprints from them. I only run into this issue when trying to convert someone elses projects because I move all of the relevant variables, enums and functions to C++. I have finally figured out enum redirection but property redirection just doesn’t seem to work. I’d love to have an unreal developers input on this…

Agreed. Sorry I couldn’t help at all. If you come across a solution please share because I’m sure I will need this at some point. I’m constantly refactoring my code, especially being new-ish to C++