Migrating assets to plugin's Content folder

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).

2 Likes

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.

1 Like

Thanks for this, you are a lifesaver

YES! Thank you!

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.

Sytelus,

Can you explain one more time what you did exectly? I tried what you said but with bad results.

What I did:

  • Copy plugins entire folder with all it’s subfolders from project B to the Game content folder in project A.
  • Than migrate the desired content to project A>Game>Content>PluginFolder>Content.

This is where I get broken references.

Hmm this did not work for me.

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.

330397-screenshot-2021-02-21-104405.png

Is there a feature request at Epic for fixing this? I need to do this regularly so it is necessary to have a way to control references easier.