Widgets destroyed after moving c++ class from project to plugin

I moved a few c++ widget classes from my project folder into a plugin folder and created core redirects for relevant classes:

+ClassRedirects=(OldName="/Script/GameCore.SomeWidget",NewName="/Script/SomePluginModule.SomeWidget")

When I open the editor afterwards all widgets of this class are removed from all widget trees. Including what was attached to them “unused widget … has been removed”.

Seriously, what is the point if none of these systems work properly?

I’m really not looking forward to manually deleting and redoing about 100 UserWidgets for the nth time for some ridiculous reason -_-.

*Edit At this point none of this destruction has been written to file, so it happens each time the editor boots. I have version control to test out things if required. The core redirectors I implemented could be successful as it’s working for one struct, but not for the widget classes. The widget trees do not update to match the redirector, instead it deletes the moved classes entirely and clears any old variables to it.

1 Like

Bump

Bump

Has someone managed to move a class and update the widgets successfully? Nothing about the class changed, it just moved from the project module to a plugin module.

It’s so strange that something simple like moving files or renaming files can break this Blueprint system entirely. How are we supposed to properly maintain our products if that is not possible?

For the next person who runs into this issue:

If you move your c++ class out of a project and into a new c++ plugin, redirect it like this:

+ClassRedirects=(OldName="YourClass",NewName="/Script/NewPluginModule.YourClass")

The core redirector should not generate the error “failed to load …” but is likely to fail silently. This happens when the plugin is set to load “Default”. loading PreDefault solved the issue. Not doing so will silently nuke your blueprints.

.Uplugin:

{
	"FileVersion": 3,
	"Version": 1,
	"VersionName": "1.0",
	"FriendlyName": "YourNewPlugin",
	"Description": "YourNewPlugin",
	"Category": "UI",
	"CreatedBy": "Seda145",
	"CreatedByURL": "",
	"DocsURL": "",
	"MarketplaceURL": "",
	"SupportURL": "",
	"CanContainContent": true,
	"IsBetaVersion": false,
	"IsExperimentalVersion": false,
	"Installed": true,
	"Modules": [
		{
			"Name": "YourNewPlugin",
			"Type": "Runtime",
			"LoadingPhase": "PreDefault"
		}
	],
    "Plugins": [

    ]
}

Figured this one out by browsing through random complaints on github

1 Like