Cleanup unused content

I would find it handy if the editor would be able to cleanup unused content when the user e.g. clicks a button or issue a command.

Hi ,

Can you be a bit more specific? Are you referring to a specific aspect of the editor or the editor as a whole? In the material editor there is a cleanup button to clean up unused nodes, is this what you are referring to?

Hi!

I referring to the imported assets in the content browser. E.g. if I import a texture pack with over 25GB of textures and only using a few in the game. Then when I’m done with the game it would be nice if the editor could just clean up all unused assets like when you build the final game to distribute. In that way I find it easier to manage a growing project and e.g. clean out early now more unused content or unused content in general.

A way of cleaning up your content and delete non used stuff is using a specific commandlet. The command let is the UWrangleContentCommandlet commandlet. You can configure it via an ini file to wrangle only what you require.

Well to toss in a new word into the lexicon that is Unreal 4 is the idea of Harvesting what you want from one project into another by making use of dependencies to a given project environment.

In context lets say you have an environment set up perfect as to dependencies that you want to pull out of it but reject anything not connected to the work in progress.

Now you could migrate the entire game directory under the asset browser, including stuff that you don’t need, but the result will be yet another copy of the assets that are visible to UE4.

On the other hand if you go Window>Levels>Migrate then only dependencies connected to and included as part of the current environment project is exported.

The flip side though, and I’m making an assumption, is when a project is compiled as a stand alone version of the project only dependencies are exported and not assets that does not contain dependencies like 25 gigs of textures not being used.

Of course I stand to be corrected as a lot of things does happen when you push a button. :wink:

I still think it would be a good idea to create a “common” directory area where any assets placed there would be accessible to all projects.

1 Like

Hi,

Wouldnt it be relatively simple to have a button that goes through all assets in the content folder and checks if any actor is associated with it.
I would find it quite handy to have a simple way of clearing out temporary standßin assets of which no instance exists in the level anymore.
The same with materials. A Material that is used nowhere, should go.
If a texture is not used in any of the materials, gone with it.
etc…

Cheers,
Klaus

[=;125355]
Hi,

Wouldnt it be relatively simple to have a button that goes through all assets in the content folder and checks if any actor is associated with it.
I would find it quite handy to have a simple way of clearing out temporary standßin assets of which no instance exists in the level anymore.
The same with materials. A Material that is used nowhere, should go.
If a texture is not used in any of the materials, gone with it.
etc…

Cheers,
Klaus
[/]

This is what the wrangle content commandlet does, it’s not pressing a button though, you must execute it from the commandline.

Hi,

[]
This is what the wrangle content commandlet does, it’s not pressing a button though, you must execute it from the commandline.
[/]

Aha :slight_smile:
Ok. Then what about the following:
Instaead of a commandlet, a small dialog is implemented, giving a preview of the to-be-deleted assets (similar to the migrate dialog). It would be much more convienient.
You could also exclude some (currently) unused assets and spare them from removal. Just more flexible.
As the functionality already exists, it would be kust a matter of coding the UI for it, right_

Cheers,
Klaus

Cheers,
Klaus

[=;125680]
Hi,
Aha :slight_smile:
Ok. Then what about the following:
Instaead of a commandlet, a small dialog is implemented, giving a preview of the to-be-deleted assets (similar to the migrate dialog). It would be much more convienient.
You could also exclude some (currently) unused assets and spare them from removal. Just more flexible.
As the functionality already exists, it would be kust a matter of coding the UI for it, right_

Cheers,
Klaus

[/]

That would be awesome :slight_smile:

[=Demolition Man;125340]
I still think it would be a good idea to create a “common” directory area where any assets placed there would be accessible to all projects.
[/]

This also sounds like a great idea.

Seams to be like a perfect candidate for a community PR :smiley:

And what is the trick? and try but nothig happen:

“C:\Archivos de programa\Unreal Engine\4.5\Engine\Binaries\Win64\UE4Editor.exe” “C:\Users\Willy\Documents\Unreal Projects\WeaponryFramework\WeaponryFramework.uproject” -UWrangleContentCommandlet

It open the game but donr delete nothing.

This cleanup button does nothing at all. Unused nodes still all over the place. I’m using Unreal 4.9 now - surely there must be a way to cleanup unused textures? Not by hand. It’s not about unused textures going into the game, it’s about cleaning up the editor so it’s easier to work with the data at hand.

Yeah I would also love the common directory (in arch-viz I find myself migrating stuff all the time) and ability of Unreal to not package unused stuff. Would be grand. :slight_smile:

Did you ever find out the correct command line? I need a step by step on how to do this.

I find the easiest way to get a clean project of my assets used, is to migrate the maps into an empty project :

  1. Create an empty project, without starter content, say name it ProjectNamePurged
  2. Go to the working project (the one “stuffed” with all the assets you were using while working on it)
  3. In the content browser, navigate to maps folder, select all the maps and migrate them to ProjectNamePurged

I put all my assets in my levels so that will purge all redundant assets.
However say you have those useful extra assets, that though not used yet, might come in handy and you want to keep them packaged: Select them in additon to the maps or make an extra map and place instances of them in that, say name it Repository

This might sound simple to implement but it has to work in all situations and many projects contain assets (usually curves) which are referenced from code only. This isn’t good practice but it’s not that uncommon (for instance, Unreal Tournament and the KiteDemo does it). Those won’t show up as a reference and this asset would be cleaned up, leaving your build broken. There are ways around this obviously but it’s not as simple as to just search for actors that hold a reference to the asset.

If those assets are referenced from code, then you can add them back manually. The migration tool works wonderful. It is much better than manually cleaning up unreferenced assets.

What migration tool? The ‘migrate’ action in the editor?

Well, of course you can add those back manually just like you can delete your assets manually as well, something you just said you’d rather have automated for you. Duh.