Serious question: How do I move around folders of assets in the editor without f***ing up my whole project?
Every time I move folders, some assets simply stay where they were. So, basically I have to browse all the empty folders for left-over assets. And those folders won't go away until I delete their counterparts from the windows explorer... When I try to "fix up redirectors" afterwards, they usually just stay, too. Next time I start up the project, I can count on getting errors for broken references or missing files. Sometimes assets actually disappeared completely after I moved them and restarted the project. I mean wth?? Is there a reason these things are happening? I can't believe something so fundamental could be so utterly broken in UE4.
asked Aug 12 '16 at 02:48 PM in Using UE4
I know this answer comes quite late, but for future issues for other people I hope this can serve as a guide to make things clear and easy when it comes to moving assets and folders. Ive seen so many people having issues with this so I thought it would best to write a proper explanation and solution.
Actually, moving items the correct way in UE4 is quite easy, really. Some fundamental understanding of how programming works makes the issue of moving items a bit easier to comprehend.
Consider that we have a cube (static mesh), with some materials. We have a blueprint that is referencing this cube. Both the cube and the blueprint is placed within a test level.
As I said, the blueprint is referencing the cube. This means that the blueprint has a reference looking/pointing to the cube under a specific folder path (in this case: Content/Test, or as UE4 sees it Game/Test). Somehow the blueprint needs to gather information about the cube, and it does this via referencing the cubes file path.
If we look at the reference viewer for the BP_TestBlueprint we can see that it is infact referencing the cube, and the BP_TestBlueprint is being referenced by the TestLevel since we placed the blueprint in the level(the same goes for the static mesh cube).
So what happens if we now move the cube outside of the Test folder (it is now placed directly under the content folder)? Well the reference will still look at the original place (Content/Test) unless you tell it to do otherwise. What it will do however is that it will add a redirector to the original folder, which in turn points to the new location.
This will ensure that the BP_TestBlueprint can still reference the cube through the redirector. But what happens if we now move the BP_TestBlueprint to a completely different folder and remove the original Test folder? Well, we will delete the redirector for the cube aswell. We will then loose the connection between the blueprint and the cube. Thus, things will break and go wrong. Imagine this being done to an asset that has 20 references, then youre in trouble.
To summarize: The reason why things break when moving assets is because assets have references to eachother. Unreal deals with this by adding redirectors. If the redirector is deleted you loose the connection.
How to correctly move assets and folders
A single asset: can be moved without any problem. It will still work as long as you dont delete the redirector. If you want to delete the original folder (without having to worry about the redirector being deleted aswell), you have to Fix Up Redirectors on the folder itself.
As you can see in the image below, the reference is now pointing to the correct location (directly under the content folder)
A folder: can be moved by first simply moving the folder to a new location. This will still leave the old folder behind with the structure intact. This may seem odd and frustrating. But, this is because all assets referencing things in the original folder is still keeping their references to that folder, Unreal have again added redirectors. Right click the original folder and click Fix Up Redirectories. All assets will now point their references to the new location. You can now delete the original folder without loosing references.
In case youve done all steps correctly and the folder is impossible to delete, this is in 9/10 cases due to a file still inside the structure that Unreal cant recognize. Rightclick the folder and click Show in explorer. Open the folder and see if there are any files left, if you feel safe to delete them, do so and then try to delete the folder from within Unreal again. It should work. Ive noticed that this is more common if youre connected to Source Control and you get a missmatch between versions etc.
I hope this helped and cleared some things up :D
answered Jan 03 '18 at 03:48 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here