I’m creating a new plugin and wanted to migrate assets from one of my other project to plugin’s Content folder. So I used migrate function, specified plugin’s Content folder as destination and it completed with success. However when I open the content in plugin’s Content folder, all references are lost. Is there any workaround/fix for this?
Update: If I look in Reference Viewer, the missing references is caused because of path “\Game.…” instead of “\MyPlugin.…”. So this looks like bug in Migrate tool.
Note: I’m using 4.14.3. References are lost pretty much every where (in blueprints, materials etc).
Finally I’ve figured out a workaround myself after spending few hours.
Problem
When you reference other assets in Unreal game project, those references are saved with path “/Games/…”. When you migrate an asset, the tool does not do any redirections to those paths. It just detects dependencies and copies uasset files in exact same folder hierarchy. The uassets files are not modified. So if you migrate to another game project then everything works fine. However if you migrate to plugin’s Content folder, the asset’s path is now expected as “/PluginName/…”. So none of the referenced assets would be found.
Workaround
Create empty game project and copy your plugin folder. Then migrate assets to game’s Content folder instead of plugin’s Content folder. Then right click on those assets and drag and drop to plugin’s content folder. This will move the uasset files and this operation does redirect references properly. So finally you should have assets in to plugin’s content folder with all references preserved. Note that you will have to click on tiny “View Options” menu at the lower right in Content browser and click “Show Plugin Content” to be able to see plugin’s content. And also the click on tiny toolbar icon on top left that has tooltip “Show or hide sources panel”. This will open up folder hierarchy view of Content folder so you can do drag and drop.
This is however still a bug that Epic should consider fixing.
HAHA I tried a string replace on all the uasset files, which are binary. Needless to say that caused a crash. Your solution is way more reliable.
I was thinking about fixing this in the unreal source. I at least found a function MigratePackages_ReportConfirmed in AssetTools.cpp but maybe later… It doesn’t look easy to detect the plugin name.
I have a blank C++ project where I made my plugin and package it. I made a few Blueprints using code from said plugin and then migrated those assets to another Unreal Project. From there I deleted the blueprints in project with my plugin and migrated them back over from the other Unreal Project. At which point I moved the files into the content folder of my plugin. After which I package the plugin again move them to the Engine’s plugin folder and my references are still broken.
I had the same problem. It seems that unreal engine now allows you to choose “Advanced Copy here”. After using it all references have been properly changed.