Sometimes, an existing class, property, function name, or similar code member needs to be renamed.
Bluprints were borne to ease our life, but sometimes it lacks the tools, or aren’t that obvious, to perform simple tasks that we programmers are used to.
One of them is to perform a change in the structure of your project, or a rename of a class, file, struct or entire module. For example, I needed to move some classes from one Module to another, but my project had lots of references, so doing it by hand would have been impossible.
Core Redirects are used to perform these kind of changes, so when a class, enum, struct, or entire module is requested and not found, the engine redirects to the new location. should be configured in your project’s DefaultEngine.ini
file, or, in the case of a Plugin, the prefixed, self-named .ini
file for that Plugin (for example, BasePaper2D.ini
for the Engine’s Paper2D Plugin, or DefaultGamePluginName.ini
for a game Plugin). In either case, the Core Redirects will be placed in the “[CoreRedirects]” section. These Core Redirects will automatically remap obsolete data while loading Assets, thus preventing data loss resulting from the renaming process.
In My case I needed to move code from the original project to a plugin. There where only few Structs that I needed to remap.
[CoreRedirects]
+StructRedirects=(OldName="/Script/MyGame.CharacterCreation",NewName="/Script/CharacterCreation.CharacterCreation")
+StructRedirects=(OldName="/Script/MyGame
.CharacterCreationBodyParts",NewName="/Script/CharacterCreation.CharacterCreationBodyParts")
+StructRedirects=(OldName="/Script/MyGame.CharacterCreationMesh",NewName="/Script/CharacterCreation.CharacterCreationMesh")
For more details you can check Unreal Engine’s documentation page here:
https://docs.unrealengine.com/en-US/Programming/Assets/CoreRedirects/index.html