x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Renaming C++ Class

I have this UObject derived C++ class UMyClass that I have to rename. The problem is that I'm referencing it many times in Blueprints, GUI widgets to be precise. Without redirecting to the new class, I will have to spend hours to fix all the errors and replace nodes and variable types. I googled the problem and learned that there should be a solution that requires me to edit the DefaultEngine.ini under [/Script/Engine.Engine].

I tried

+ActiveClassRedirects=(OldClassName=”UMyClass”,NewClassName=”UMyNewClass”)

+ActiveClassRedirects=(OldClassName=”My Class”,NewClassName=”My New Class”)

+ActiveClassRedirects=(OldClassName=”UMyClass”,NewClassName=”/Script/Project.UMyNewClass”)

+ActiveClassRedirects=(OldClassName=”MyClass”,NewClassName=”/Script/Project.MyNewClass”)

Nothing works. Everytime I restart the editor (I'm not saving the widget classes ofc), a variable that used to be of type UMyClass becomes UObject, not UMyNewClass. I also tried both keeping and removing the old class before starting.

What am I doing wrong?

Product Version: UE 4.18
Tags:
more ▼

asked Feb 07 '18 at 10:00 PM in C++ Programming

avatar image

MaxPower42
643 67 82 118

avatar image Firefly74 Feb 07 '18 at 10:38 PM

the correct one is

 +ActiveClassRedirects=(OldClassName=”MyClass”,NewClassName=”/Script/Project.MyNewClass”)

it should have worked.. try again maybe ? :/ was the class defined in a pluggin ? try with '/Script/Project/' for the oldclassName aswell, but it worked without it on my project

if you keep the old class, does the type of the variable in blueprint still good or already as a UObject ? ( maybe the problem is somewhere else )

avatar image MaxPower42 Feb 07 '18 at 11:01 PM

Thanks for the quick response. In the meantime I tried this new system under Engine.ini [CoreRedirects], that I just read about, but also without success.

No plugins - I've got everything in a single project/module. Code is organized in folders, but if my intuition doesn't deceive me here (in lack of technical understanding...), that shouldn't make a difference.

avatar image MaxPower42 Feb 07 '18 at 11:03 PM

I did like you said and added the "/Script/Project." to the old class name as well and that did the trick! Thanks a lot, saved me a lot of pointless experimenting :)

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

To validate the answer for futur users looking for this ( and close the question )

the solution was : +ActiveClassRedirects=(OldClassName=”/Script/Project.MyClass”,NewClassName=”/Script/Project.MyNewClass”)

more ▼

answered Feb 08 '18 at 08:21 AM

avatar image

Firefly74
1.5k 14 18 33

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question