Delete unused assets in Unreal Engine
This Python-script is used to remove unused assets from the Unreal Engine project.
# This is a sample Python script.
# Press Shift+F10 to execute it or replace it with your code.
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.
import unreal as ue
DIRECTORY = '/Game/StarterContent/'
editor = ue.EditorAssetLibrary()
unused_assets = 
is_continue = True
is_continue = False
assets = editor.list_assets(directory)
if len(assets) > 0:
with ue.ScopedSlowTask(len(assets), 'Begin...') as slow_task:
for asset in assets:
dependencies = editor.find_package_referencers_for_asset(asset)
if (len(dependencies) == 0 or all_in_array(unused_assets, dependencies) or
asset_equal_dependencies(asset, dependencies)) and asset not in unused_assets:
is_continue = True
if slow_task.should_cancel(): # True if the user has pressed Cancel in the UI
def all_in_array(array, need):
for n in need:
n = n + '.' + os.path.basename(n)
if n not in array:
def asset_equal_dependencies(asset, dependencies):
return asset == dependencies + '.' + os.path.basename(dependencies)
def delete(deletes, is_delete=False):
if not is_delete:
ue.log('The argument "delete" is required to delete')
with ue.ScopedSlowTask(len(deletes), 'Delete...') as slow_task:
for asset in deletes:
ue.log('DELETE: ' + asset)
registry = ue.AssetRegistryHelpers().get_asset_registry()
directories = registry.get_sub_paths(directory, True)
for directory in directories:
if editor.does_directory_exist(directory) and not registry.has_assets(directory):
ue.log('DELETE DIRECTORY: ' + directory)
# Press the green button in the gutter to run the script.
if __name__ == '__main__':
delete_assets = get_unused_assets(DIRECTORY)
if len(sys.argv) > 1:
arg = sys.argv
if arg == 'delete':
It might be interesting
Bing has been able to get away from its greater search with shares and making gains by pecking away from Google. They are now successfully driving off Pecking to the edges away from their search engine. Bing gained about .4% of its profit by the end of August and has now gone on to 9.3%.
There is news about the announcement of official strategy to set up a speedy 3rd Gen cellular network in the United States by T-Mobile