Delete all unused assets

This is a different issue. People may want to clean up their project just to make it easier to work with, or they want to hand it off to other and not have that unused content. It’s not all about the final build.

But in that case then “migrating” the wanted MAP files to another project is already a cleanup.
I’d rather creating a fresh project for migration than delete existing files; for many little reasons deletion of files can break a project.

I Just tried the WrngleContent commandlett and it worked just fine. It was on a very simple project so I can’t verify if it works on more complex or C++ projects tho.


"C:\Program Files\Epic Games\UE_4.18\Engine\Binaries\Win64\UE4Editor-Cmd.exe" "D:\Perforce\Epic\depot\usr\.\GameJamKit - Copy\GameJamKit.uproject" -run=WrangleContent -allmaps

Wow both are very nice information… tq…

It seems like this solution is the best so far ( tried the command suggested and it deleted about 30mb while this one deleted more than 1gb )

I didn’t test it thoroughly but it seems like it is working fine.

Just need to keep in mind to make the new project with the exact same name as the old one in order to have Cpp code work ( my project is using blueprints that inherits from Cpp and from plugin’s Cpp )

So what I did basically is:

1.copy the plugins, source and config folders to the new project.
2.Migrate the levels from the old projects to the new one’s content.
3.Generate project files and build in visual studio

And that’s it.

+1 for one click button for “migrating unused assets out” (aka Delete)

or

Show All Unused Assets in Maps

The “Show Unused Assets” is pretty much the only option for this to work since these automatic detections can and will have false-positives.

Yes this would be amazing.

+1 for this too. Something like SketchUp’s Purge Unused button would be great.

no that don’t… that don’t copy any settings, it can break physical materials and make them broken unless you remake them and lots and lots of issues like when spawning materials dynamic, these materials don’t get evaluated and don’t migrate them. there are so many things that your method breaks it is NOT a viable solution.

I thought this was common knowledge. That method will only work on extremely simple projects. Do not try it without backing up your stuff.

News to me! I’m glad someone chimed in with a precautionary tale.

Did you try the command-line tool posted before?
Or are people still in need for this?!

This, please do this. Some icon or maybe checkbox in asset browser.

The filter to show unused assets is indeed a amazing idea, +1

+1 Something could definitely be done to improve file management. I remember I once tried to move a bunch of Epic assets into template projects and then reorganise them into sub-folders, didn’t take me long to never attempt that again - got all sorts of issues even when fixing references and stuff.

+1 for this. Would be very useful.

+1 - yes please! Anything to help organise projects more efficiently would be welcomed.

Maybe UE4 should introduce a feature which prevent assets created within folder level from being globally referenced anywhere else.

  1. Assets created within the level folder is only accessibly within the said level.
  2. Anywhere else, can be globally referenced and used
    just like now.

@Syedhs This special Developers folder works a bit like this. If you’d put asset there, you won’t see it in asset picker.
Still, you are able to drag this asset manually because people would get mad if that wouldn’t possible.