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:
Migrated Widget in New Project: 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?
asked Apr 12 '18 at 02:58 PM in C++ Programming
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.
answered Apr 12 '18 at 06:51 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here