x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Change Native Parent Class(Path) of Widget

Hello everyone, how can i change the Native Parent Class of a Widget? I created some Widgets in one Project and want to Migrate them to another. Migrating the Widgets itself is not a Problem, however they still search for their C++ Parent Class in the Old Location. Widget in Old Project: alt text

Migrated Widget in New Project: alt text I copied the Old C++ classes into the new Project and got them Setup Properly, i can create new Widgets out of those C++ classes. However i can't find a way to tell my Migrated Widgets that their Parent Class is not under "OldProject/ParentClass" but now under "NewProject/ParentClass".

Am i missing something?

Product Version: UE 4.19
Tags:
more ▼

asked Apr 12 '18 at 02:58 PM in C++ Programming

avatar image

InTrusta
5 1 3 8

avatar image InTrusta Apr 12 '18 at 03:09 PM

I can`t open the Widget to reparent it from the Designer btw, i get following message when trying to open:

Widget Blueprint could not be loaded because it derives from an invalid class. Check to make sure the parent class for this blueprint hasn't been removed!

avatar image InTrusta Apr 12 '18 at 03:27 PM

Load Errors: alt text

I tried to change the DefaultEngine.ini, but no succes so far. Maybe theres a variation i missed?

[/Script/Engine.Engine] bSubtitlesEnabled=False +ClassRedirects=(OldName="MainMenu", NewName="/Script/CoopGame.MainMenu") +ClassRedirects=(OldName="PuzzlePlatforms.MainMenu", NewName="/Script/CoopGame.MainMenu") +ClassRedirects=(OldName="/Script/PuzzlePlatforms.MainMenu", NewName="/Script/CoopGame.MainMenu") +ClassRedirects=(OldName="/Script/PuzzlePlatforms", NewName="/Script/CoopGame") +ActiveClassRedirects=(ObjectName=,OldClassName="PuzzlePlatforms.MainMenu",NewClassName="MainMenu") +PackageRedirects=(OldName="/Script/PuzzlePlatforms",NewName="/Script/CoopGame")

errormessage.jpg (35.8 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

If you didn't realize yet, code in UE4 is devided in to modules which are compiled in to dlls and you can have few of them, All modules are the same regardless if they are in game project, plugin or engine code it self, they operate under same conditions only difference is how they are distributed, in your case your module is in game project. You need to understand that to understand your issue

The issue is that your module name changed without your project name, changing asset pathing and messing up depency information of your blueprints. I don't know how the name is significent for you and what you got in old project for you but quickest fix for this is to copy module (PuzzlePlatforms) from old project without changing it name and add in to uproject module list and regenerate VS project files, also remove code form PuzzlePlatfroms from CoopGame so you won't have name colisions between modules. This should make blueprints workable again. If you don't have PuzzlePlatfroms from old project that means oyu will need to changem odule name manually and this require renaming files and change CoopGame to PuzzlePlatfroms in them, you cna seperate code to module with name PuzzlePlatfroms too.

Now once you got to this point if you want to move those classes back to CoopGame it tricky. I don't know what you got in those blueprints, but you could create similary named classes in CoopGame and then reparent the class and remove PuzzlePlatfroms module once you done, fix any bugged nodes you will have there.

You could try to skip all that by reparenttng those blueprints in old project and then copy them to nre project, again i don't knwo what your bluepritns have and how they are tied to project.

If you plan to reuse native code between projects maybe try making it a plugin or atleast put it in to module with common name that won't change when you move between project, this will avoid a lot of troubles like that.

more ▼

answered Apr 12 '18 at 06:51 PM

avatar image

Shadowriver
37.2k 936 172 1116

avatar image InTrusta Apr 13 '18 at 07:08 AM

Thanks for the long answer! I already tried to copy the PuzzlePlatform Module to the new Project, but somehow, even after regenerating vs files, it wouldnt show up under C++ classes in the ue editor. By now i just created new Widgets from the new MainMenu class in the CoopGame Module and then copied the Widget Canvas over to the new Widget. Didnt know u could just copy so much Information over from one Open Editor to another one. Still i marked your's as an answer, maybe it helps someone else.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question