-
Notifications
You must be signed in to change notification settings - Fork 30
Home
Click on the Scan Project
button to view the assets that have been detected. The results will be displayed in a per-folder tree view with detailed statistics on how many unused assets each folder contains. If you wish, you can exclude certain assets. Next, click on the "Clean Project" button, and it will delete all unused assets and empty folders in the project.
Before understanding which assets are considered "Unused", we need to define the criteria for an asset being "Used". An asset is considered "Used" if it falls under any of the following categories:
- The asset is a Primary asset.
- The asset is an Editor specific asset.
- The asset is Indirect .
- The asset is ExtReferenced.
- The asset is Excluded.
- The asset is a dependency of another Used asset.
Therefore, any asset that does not satisfy any of the above criteria is considered Unused.
Now lets examine every category in more detail.
If you are not familiar, with terms Primary
or Secondary
assets in unreal engine, I recommend you to read this Docs first.
Level assets for example are primary by default.
But you can create or register primary assets by yourself, if you create class inherited from UPrimaryDataAsset
and then register it in AssetManager.
As an example you can look at ActionRPG project from epics.
This category of assets includes classes such as EditorTutorial
, EditorUtilityBlueprint
, EditorUtilityWidget
, and similar. These types of assets are not used in Maps, but serve as utilities within the editor.
Sometimes we use assets in source code or config files. For instance, we might use a Material from StarterContent
in the source code, loading it programmatically using C++.
static ConstructorHelpers::FObjectFinder<UMaterial> Material(TEXT("/Game/StarterContent/Materials/M_ColorGrid_LowSpec.M_ColorGrid_LowSpec"));
if (Material.Succeeded())
{
// using material
}
Now you compiled and everything works perfectly. But what happens if we try to delete that asset from ContentBrowser? Lets see.
As you can observe, there's no clear indication that this asset is being used in the source code. If we delete it, we will receive a CDO
error upon the next editor load.
Another example is asset usage in project configurations.
All these assets are tracked by the plugin and can be viewed in the Assets Indirect
tab.
As you can see, our material that we used in the source code earlier is detected and will now be marked as a Used
asset. For additional information, the file path and line number where the asset is used are also displayed.
These are assets that have external references outside the project's Content
folder.
While the plugin can detect most unused assets, there may be situations where a user might want to exclude certain types of assets from scanning. Fortunately, we have asset exclude settings where you can specify which folders, assets, or asset classes to exclude. Note that the buttons in the toolbar and the buttons in the context menu perform the same actions.
If you want to view the excluded assets, you can activate the ProjectCleaner Filters
-> Assets Excluded
filter in the ContentBrowser
.
There may be situations when not all assets load correctly. While there could be many possible reasons that we can't cover exhaustively, all asset files with engine asset file extensions that are not loaded will be displayed in the Assets Corrupted
tab.
The plugin also displays files that are not engine asset files but reside in the project's Content folder. Again, you can exclude the files you need and delete the rest. There may be situations where a folder appears empty in the ContentBrowser
, but you can't delete it. In such cases, navigate to the Files External
tab to view and remove all files you consider unused.
Most of plugin functionality are exposed via UPjcSubsystem
class and can be used in blueprints or python scripts.