If a symbol needs to be moved or renamed, Unreal provides the Core Redirects mechanism to override any instances of the old symbol with the new symbol. The data spec consists of a redirect for each symbol type that can be added to the DefaultEngine.ini file in your project, under the header
The full specification can be found at the following link, however there are some things to take particular care of when redirecting between C++ and Blueprint.
- Unreal Documentation - Core Redirects (https://docs.unrealengine.com/en-US/ProgrammingAndScripting/ProgrammingWithCPP/Assets/CoreRedirects/index.html)
When redirecting from one C++ symbol to another in the same module, it may be sufficient to provide the short name of the symbol. For instance:
However, when redirecting to a symbol in a different module, or if a symbol is duplicated in other modules, it may become necessary to specify the full namespace of the symbol, which is as follows:
When redirecting Blueprint symbols, it's important to remember that, under-the-hood, Unreal suffixes all Blueprint class names with the extension "_C". For instance, a blueprint asset called BP_Item.uasset will actually have a class definition called BP_Item_C. This is enough to be able to redirect from one blueprint to another:
However, when redirecting a Blueprint Class to a C++ Class, you also need to add
OverrideClassName="/Script/CoreUObject.Class". Therefore, the full pattern to redirect a Blueprint Class to a C++ Class is as follows:
Versions of Unreal up to and including 4.26 do not support Blueprint member names containing whitespace in Core Redirects. This should be supported from 4.27. https://github.com/EpicGames/UnrealEngine/pull/7802
The above rules apply equally to other symbol types.
Redirecting a Blueprint Property to a C++ Property (e.g. when re-parenting):
If you wish to redirect Blueprints or other asset types between your game and a plugin, you must specify the plugin name in the path, or use "/Game/" to reference assets in any game module.
For instance, if a Blueprint Class has been moved from a game module to a plugin:
- Unreal Documentation - Action RPG Example Project - Converting from Blueprints to C++ (https://docs.unrealengine.com/en-US/Resources/SampleGames/ARPG/BalancingBlueprintAndCPP/index.html)