[TIP] Renaming C++ Classes without breaking your project


Ever wondered how to rename your C++ classes that you already use in your project? For example, you have a C++ class called MyAwesomeClass and in your Content Browser you created a Blueprint extending from this class and added some important logic. Now if you rename the C++ parent class and compile, project might open but if you try to open that Blueprint you will see this error.

BlueprintErrorSimply put, your project is doomed………..Just kidding 😉

So in order to make this work, you need to tell Unreal that there is a new class for this and it should use that instead of the old one. In other words, you need to redirect from Old Class to New One and you do this in DefaultEngine.ini found in Your project/Config folder.

Open DefaultEngine.ini and under [/Script/Engine.Engine] section add the below line:

+ActiveClassRedirects=(OldClassName=”MyAwesomeClass”,NewClassName=”MyNewClass”)

Thats it! Now you can start your project and open that Blueprint without issues. Hope you find this info useful. 🙂

Advertisements

About Satheesh (ryanjon2040)

Genuine Unreal Engine user

Posted on May 28, 2015, in Tutorials, Unreal Engine 4 and tagged , , , , , , . Bookmark the permalink. 2 Comments.

  1. I just renamed a class file that was referenced as a component on pawn but didn’t make the redirector before building/submiting my code…. Then when I cook I get this :Graph is linked to private object(s) in an external package : Engine/Transient sur GP_BP_BaseEnemy.uasset.
    Is making the redirector later can fix this problem?

    Like

  1. Pingback: [UE4] [Unreal C++] ソースコードのファイル名を変更(リネーム)する | StartVR

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: