File Cleanup: Import, Delete, etc

So I have spent the past couple weeks moving a lot of tiles in and out of my project and I have noticed quite a few annoying problems:

  1. You can delete all the files in a folder inside the editor, but when you delete the actual folder, it finds all kinds of files that were not visible and asks you if you want to delete them too, often times with references that you don’t want to just force delete.
  2. After deleting a folder, you can go into the file tree of your project and still see the folders that were supposed to have been deleted.
  3. In the project folders, outside of the editor, you see 1kb ghost files, other full files that aren’t showing up in the editor, etc.
  4. I had an issue where I deleted a file, moved out to another folder, and then back, only to see the file return. Could not get rid of it until I deleted the folder that housed it.
  5. Migration often comes up with errors about files not existing on disk. How did it know to migrate them if they didn’t exist?
  6. When migrating folders containing all assets that reference each other, I often find that all the links are broken inside the materials post migration. I then have to manually re-link everything.
  7. At some point I was editing a migrated file, and it simply would not let me save it.

There are more I can’t think of right now, but long story short, moving files around is a huge pain in the butt with the editor. It could definitely be improved(somehow).

The basics of asset management in UE4 I’ve learned by bad experiences is that:

  • Pay LOTS of attention to file redirectors.

There’s an option on the project explorer tab to keep ‘file redirectors’ visible. Always keep that turned on.
Every time you move/rename/delete a file pen attention if there’s any redirectors, right click the folder and hit ‘Fixup Redirector files’ or something like that.
Also, before moving an asset, take a look at it’s depency chart and plan ahead what is needed to move it; for example if you want to move a Material file, is good idea to move the textures it uses first and so on…

I can not find what you’re referring to.

Hi,

I also enocuntered some of the points mentioned above.
For example I cannot move some BPs because of the file redirectors in the target folders.

Has anybody more information about this?

Content Browser tab -> Filters -> Other Filters -> Show Redirectors

For the record, the redirector fixup stuff he’s mentioning does not work superbly.

This is further complicated by my need to keep everything in a project folder heirarchy… I want Content/Textures/XYZStuff/texture.jpg… not 50 million folders in the Content heirarchy.

Spent a full day of development time moving assets around and fixing redirects :\ As they say, time is money. Something else that annoys me to no end is that when you move something, it will load it into memory first. When the item is moved, it will keep the original file/location in memory, which causes some headaches as well (is this what’s loaded into memory and I can force delete, or is it still in there?)

Redirector files are created only if the asset you move is used on any .map level.
If you need to move something, is easier to move before you start using it in levels. Also there are the reference hierarchy stuff… I.e: is better to move materials and then it’s textures instead of moving textures first. Because the textures are referenced by the material asset.

Not going to lie… this stuff is irritating. Why cant u just delete a directory and move some files like u can in unity. I hit delete on a directory in unreal and it says it deletes it… but then the directory is still there… so i have to delete again… then i relaunch unreal and the directory magically reappears… so i hite delete there… and then i navigate to windows to delete the directory there as well… wtf? Is there a proper way to move and delete stuff?

I am spending hours on this dumb ****… please help me!

Redirects… and phantom directories… attempting to delete them 5x over not knowing if im breaking things along hte process when alls iw anted to do was just move the directory into another directory. Instead i got copies of it. Please help.

All the things mentioned by op have caused me some major confusion and general pain. Deleting a file just to see it come back after I load ue4 next time, makes me facepalm everytime.

Hi Kurylo3d,

Have you utilized the “fix redirectors” option within the content browser? If you right click on a folder in the content browser you should have the option to fix and delete references to redirectors:

&stc=1

Content browser is actually driving me a little nuts. It’s started creating its own folders now and I’ve no idea why. It won’t let me keep things neat and tidy.

It does this when I try to create a new material function inside /amnion/landscapematerials/functions/

I’m sure there’s a perfectly valid reason for why it’s doing that. But I can’t figure out how to stop it. It actually creates the function in both directories and if I delete one it deletes the other.

Hi Adam,… I have only toyed with it not knowing what it does. But it would help to know what a redirector is. Why it happens… and will running this stop it from creating directories… because i still get phantom directories… that are in windows that somehow come back to the project when i relaunch unreal editor.

A redirector is created any time an object is moved in your content browser that is referenced by another object/actor. A material that is being used by a static mesh is a good example. The static mesh is looking at a specific location for that material (the location it was at when the static mesh had the material assigned to it), and if the material is moved but the object not told that it has been moved, it can break the mesh. Redirectors are put into place to prevent that break from occurring. Think of it like a signpost that says "Not here anymore, try this location instead: ". These are not meant to be permanent solutions and I actively encourage developers to add assets into the folder they are going to remain instead of moving them about. Otherwise, the options are to fix up redirectors, or re-reference the moved asset (in this case, the material) wherever it is referenced (the static mesh) and manually delete the redirectors. You can do this by going to Windows Explorer and finding the filepath:

\Unreal Projects\PROJECTNAME\content\

Once there, find the original location of the object and there should be a small file acting as the redirector for the asset. You can manually delete that. Any folders with no information left in them (all redirectors have been deleted), will not show up in the content browser. I will repeat, however, that it is absolutely imperitive to re-reference the assets manually if you do it this way. There are times that this can cause extremely averse effects or crashes due to null references in structs/blueprint actors.

I’m not entirely certain what is going on there, xuri. I attempted to reproduce it on my end but was unsuccessful. What version of the editor are you using and what specific steps did you take before that folder was created?

4.7.3. I capped a video of it to show exactly what happens.

I’ve since managed to stop it by renaming the ‘amnion’ folder which was the same as the project name. I’m guessing that confused it somehow. :smiley:

That does make a significant difference. In general I would avoid naming any folders or objects the same thing as your project, it can make things a little chaotic.

Yeah, it was dumb on my part. I was having a bit of a brain day yesterday. :slight_smile:

Alright i tried fix redirect option. It did nothing for me. I looked in windows and still have 100s of uasset files… in the directory, but an empty directory in unreal. To make matters worse i attempted to delete animations in an entirely different directory… and somehow… the character referencing those animations… and his skeleton… and all that nice stuff… are now magically deleted from unreal as well… u assets still exist but unreal wont detect em. Dude… guys… amazing engine… seriously,but get your sh** together with this file handling. I feels like there is no rhyme or reason to it. I am spending more work hours… in file management… then i am actually DOING WORK! Worst part is who makes a delete button that doesn’t actually delete files.

Hi kurlyo3d,

That doesn’t sound like what should be happening at all and I haven’t been able to reproduce this on my end. When I press the fix redirectors option, it cleans up the filepaths and deletes the redirects every time, so something else must be getting in the way. Are any of your folders named the same as your project as in xuri’s post above? If so change the name there. Additionally, if you manually delete those uasset files in windows explorer do they still come back when you re-open the editor? To test, move one of the problem folders from the contents folder in windows explorer to your desktop, then open the project in editor and see if that folder re-appears. If it does not and the editor does not crash, you should be able to delete those assets in windows explorer. If none of this works can you make a post on the answerhub at http://answers.unrealengine.com in the bug reports section so we can assist you more in depth?

Well heres my issue. Were talkn about 2 problems at once now. See the directories are there and empty in unreal… with u assets in the windows directory. I can assume i can delete those now (though that should be automatic in my opinion… delete usualy means delete to most people.). But problem 2 is i deleted an animations directory… and suddenly i found the characters directory which is a seperate directory deleted… (still exists in teh windows directory as u assets… but not in windows.) Nothing i can do can bring that back… so its kind of a waste of setting up the retarget and the materials… Lost time cause i have to do that again… and i have no idea how unreal no longer sees those assets as though they were deleted. Makes no sense.

To answer your question… no my folders are not named the same as the project…

Please make this a post on the answerhub at http://answers.unrealengine.com so we can assist you more in depth. We will be able to assign a staff member to have a look at your specific errors.