Core Redirectors: What you need to know

There may come times when classes, enumerators, structures, and other such files need to be renamed while developing an Unreal Engine project. Doing so without proper consideration can cause catastrophic data loss due to the engine not recognizing those renamed assets.

Core Redirectors: What you need to know

There may come times when classes, enumerators, structures, and other such files need to be renamed while developing an Unreal Engine project. Doing so without proper consideration can cause catastrophic data loss due to the engine not recognizing those renamed assets. Thankfully, Epic has provided an easy solution for that — Core Redirectors.

Simply put, Core Redirectors is a method to tell Unreal Engine that X is now Y.

As an important note, Core Redirectors is the manual method for setting redirectors. When renaming and moving files within the content browser, redirectors will be automatically generated. These redirectors can be easily fixed by right-clicking all of the folders in your content directory and clicking Fix Redirectors.


Want to discuss this article, Unreal Engine, or media in general? Head on over to the official Unreal Directive Discord server! We're looking to foster a helpful and fun community!


Where to store the redirectors

Core Redirectors should be placed in the following areas depending on the module.

Project
*/<ProjectName>/Config/DefaultEngine.ini

Project Plugin
*/<ProjectName>/Plugins/<PluginName>/Config/Default<PluginName>.ini

Engine Plugin
*/Epic Games/<UEVersion>/Engine/Plugins/<PluginPath>/<PluginName>/Config/<PluginName>.ini

Redirector Types

There are multiple different redirector types, and each type is approached differently.

Important

  • The redirectors must be placed within the [CoreRedirects] section of the .ini files.
  • Make sure to replace the < > as well. Those are just indicators of what needs to change.

Package Redirector

+PackageRedirects=(OldName="/<OldName>/", NewName="/<NewName>/")

Class Redirector


; For redirecting within the same module
+ClassRedirects=(OldName="/Script/<ModuleName>.<OldClass>",NewName="/Script/<ModuleName>.<NewClass>")

; For redirecting between modules
+ClassRedirects=(OldName="/Script/<ModuleA>.<OldClass>",NewName="/Script/<MobuleB>.<NewClass>")

; For redirecting from a Blueprint Class to a Native C++ Class
+EnumRedirects=(OldName="<BlueprintClass>",NewName="/Script/<Module>.<NativeClass>",OverrideClassName="/Script/CoreUObject.Class")

Structure Redirector

; For redirecting within the same module
+StructRedirects=(OldName="/Script/<ModuleName>.<OldStruct>",NewName="/Script/<ModuleName>.<NewStruct>")

; For redirecting between modules
+StructRedirects=(OldName="/Script/<ModuleA>.<OldStruct>",NewName="/Script/<ModuleB>.<NewStruct>")

; For redirecting from a Blueprint Struct to a Native C++ Struct
+EnumRedirects=(OldName="<BlueprintStruct>",NewName="/Script/<Module>.<NativeStruct>",OverrideClassName="/Script/CoreUObject.Struct")

Enumerator Redirector

; For redirecting within the same module
+EnumRedirects=(OldName="/Script/<ModuleName>.<EOldStruct>",NewName="/Script/<ModuleName>.<ENewStruct>")

; For redirecting between modules
+EnumRedirects=(OldName="/Script/<ModuleA>.<EOldStruct>",NewName="/Script/<ModuleB>.<ENewStruct>")

; For redirecting from a Blueprint Enum to a Native C++ Enum
+EnumRedirects=(OldName="<EBlueprintEnum>",NewName="/Script/<Module>.<ENativeEnum>",OverrideClassName="/Script/CoreUObject.Enum")

Note: Unlike the other redirectors, enumerators require the E prefix.


Example

Here is an example utilizing the different redirector types.

[CoreRedirects]

; Plugin Redirector
+PackageRedirects=(OldName="/<OldGenericPlugin>/", NewName="/<NewGenericPlugin>/", MatchSubstring=true)

; Class Redirectors
+ClassRedirects=(OldName="/Script/<OldGenericPlugin.GenericActor>",NewName="/Script/<NewGenericPlugin.GenericActor>")
+ClassRedirects=(OldName="/Script/<OldGenericPlugin.OldGenericWidget>",NewName="/Script/<NewGenericPlugin.NewGenericWidget>")

; Struct Redirectors
+StructRedirects=(OldName="/Script/<OldGenericPlugin.GenericStruct>",NewName="/Script/<NewGenericPlugin.GenericStruct>")

; Enum Redirectors
+EnumRedirects=(OldName="/Script/<OldGenericPlugin.EGenericStruct>",NewName="/Script/<NewGenericPlugin.EGenericStruct>")

Tips

Here are some useful tips when dealing with Core Redirectors.

Safely Removing Redirectors

Redirectors can be safely removed once the affected assets, and the assets that use them, have been re-compiled and re-saved.

Warnings, errors, crashes oh no!

Don't worry! This just means that you are missing some redirectors. Carefully read through your Output Log for the cause.

Also, make sure you do not attempt to re-compile or re-save the assets that produce the issues. This can cause the redirector to not work as intended. Especially for variables. If this does occur, you will have to manually go in and replace those variables.


Additional Information

You can find out more information via the official documentation.

Core Redirects
Core Redirects enable remapping classes, enums, functions, packages, properties, and structs at load time.

Change Log

Date
Changes
07 Nov 2021
- Fixed styling issues
- Added info regarding automated redirectors and fixing up redirectors

If you like the content and it has helped you, please consider supporting the development of the Unreal Directive.