Plugin class redirection from another module

Dear developers,

I have a custom c++ class (called CameraTop) which inherits from ACameraActor, located inside a plugin named VoRCharacterVisit.
This plugin has 2 modules : VoRCharacterVisit (type Runtime, with the CameraTop class) and VoRCharacterConfigurator (type Editor ).

I’ve modified the CameraTop Class in order to add some editor features. Now i want to move the CameraTop Class from the VoRCharacterVisit module into VoRCharacterConfigurator module.

Issue :
A Blueprint asset, named CameraTop, inherits from the CameraTop C++ class, and i can’t succeed to do a classredirection, so my BP CameraTop has a invalid parent when i want to move my base c++ class CameraTop into the VoRCharacterConfigurator module.

What i tried :

I’ve added these lines in my DefaultEngine.ini :

[CoreRedirects]
+ClassRedirects=(OldName="CameraTop",NewName="/Script/VoRCharacterConfigurator.CameraTop")

As it doesn’t seem to work, i tried with more “precise” info

+ClassRedirects=(OldName="CameraTop", NewName="/Script/VoRCharacterConfigurator.CameraTop")
+ClassRedirects=(OldName="/Script/VoRCharacterVisit.CameraTop", NewName="/Script/VoRCharacterConfigurator.CameraTop")
+ClassRedirects=(OldName="VoRCharacterVisit.CameraTop", NewName="/Plugins/VoRCharacterConfigurator.CameraTop")

I tried to put these lines inside a new config file : /Game/Config/VoRCharacterVisit.ini

I’ve added the MODULE_API define in my class declaration

UCLASS()
class VORCHARACTERCONFIGURATOR_API ACameraTop : public ACameraActor

I’m able to open/edit the faulty Blueprint, even with the Warning of invalid parent, but once the edit window is open, i cannot reparent blueprint from the File menu : CameraTop isn’t in the list. That said, i’m able to create a new blueprint with my VoRCharacterConfigurator.CameraTop as parent.

I had no issue doing activeclassredirect in version UE 4.18, but since i must use the [CoreRedirects] in 4.20. I cannot succeed to make this redirection.

  • Is there a issue with my naming ? Plugin and module names are similar
  • Is it possible to do a +classRedirect from one module to another in the same plugin ?

I’m working with a custom rocketBuild based on 4.20.3, and doing my testing with a DebugGame Editor built from VS 2017.

Any ideas or suggestions is welcome.
Thanks in advance

Did you ever figure this one out? I’m in the same boat and I’m confused why the method listed in the docs isn’t working.

Ridirectors was exclusively for assets not C++ classes which only reason why they are in Content Browser is for blueprint only users, but they don’t work like assets at all.

You should avoid moving code to diffrent classes or renaming classes or else be prepared for data loss as UE4 don’t have mechanism to fix it as for then renamed entries and modules are different incompatible modules. Keep them as they are or take a bitter pill of remaking blueprint. I think only way to do this more safest is to copy instead of moving the class and delete old one once you do proper reparent to new class

Things is i belive you may not really need to do what you doing, if you intent to use this class in runtime you need to have class in runtime module, otherwise you gonna get errors on packaging. Think twice if you really need to have this in editor module.

Thanks for that explanation.
I fixed my issue moving the code inside the Editor module then i copied the assets, reparenting as you suggest. But I keep the class in the Editor module , I moved this classes because it does not need to be packaged and used only during level edition.

As explains in the answer below, it’s seems not possible. Copy the asset and reparenting seems the better solution.

I was able to redirect classes and structs between modules like so:

+ClassRedirects=(OldName="/Script/TYVCCampaign",NewName="/Script/ThankYouVeryCool",MatchSubstring=true)
+StructRedirects=(OldName="/Script/TYVCCampaign",NewName="/Script/ThankYouVeryCool",MatchSubstring=true)

2 Likes

I can confirm, I’ve been able to redirect classes from one plugin to another without any issue.

I can also confirm that this works for C++ classes and Epic does it themselves for internal engine refactoring. This post goes into it in depth: [Quick Tip] Renaming C++ Classes without breaking your project - #17 by FunGames55