unreal.AssetTools

class unreal.AssetTools(outer=None, name='None')

Bases: unreal.Interface

Asset Tools

C++ Source:

  • Module: AssetTools

  • File: IAssetTools.h

create_asset(asset_name, package_path, asset_class, factory, calling_context='None')Object

Creates an asset with the specified name, path, and factory

Parameters
  • asset_name (str) – the name of the new asset

  • package_path (str) – the package that will contain the new asset

  • asset_class (type(Class)) – the class of the new asset

  • factory (Factory) – the factory that will build the new asset

  • calling_context (Name) – optional name of the module or method calling CreateAsset() - this is passed to the factory

Returns

the new asset or NULL if it fails

Return type

Object

create_asset_with_dialog(asset_name, package_path, asset_class, factory, calling_context='None')Object

Opens an asset picker dialog and creates an asset with the specified name and path

Parameters
Returns

Return type

Object

create_unique_asset_name(base_package_name, suffix) -> (out_package_name=str, out_asset_name=str)

Creates a unique package and asset name taking the form InBasePackageName+InSuffix

Parameters
  • base_package_name (str) –

  • suffix (str) –

Returns

out_package_name (str):

out_asset_name (str):

Return type

tuple

duplicate_asset(asset_name, package_path, original_object)Object

Creates an asset with the specified name and path. Uses OriginalObject as the duplication source.

Parameters
  • asset_name (str) –

  • package_path (str) –

  • original_object (Object) –

Returns

Return type

Object

duplicate_asset_with_dialog(asset_name, package_path, original_object)Object

Opens an asset picker dialog and creates an asset with the specified name and path. Uses OriginalObject as the duplication source.

Parameters
  • asset_name (str) –

  • package_path (str) –

  • original_object (Object) –

Returns

Return type

Object

duplicate_asset_with_dialog_and_title(asset_name, package_path, original_object, dialog_title)Object

Opens an asset picker dialog and creates an asset with the specified name and path. Uses OriginalObject as the duplication source. Uses DialogTitle as the dialog’s title.

Parameters
  • asset_name (str) –

  • package_path (str) –

  • original_object (Object) –

  • dialog_title (Text) –

Returns

Return type

Object

export_assets(assets_to_export, export_path)None

Exports the specified objects to file.

Parameters
  • assets_to_export (Array(str)) – List of full asset names (e.g /Game/Path/Asset) to export

  • export_path (str) – The directory path to export to.

export_assets_with_dialog(assets_to_export, prompt_for_individual_filenames)None

Exports the specified objects to file. First prompting the user to pick an export directory and optionally prompting the user to pick a unique directory per file

Parameters
  • assets_to_export (Array(str)) – List of assets to export

  • prompt_for_individual_filenames (bool) –

find_soft_references_to_object(target_object)

Returns list of objects that soft reference the given soft object path. This will load assets into memory to verify

Parameters

target_object (SoftObjectPath) –

Returns

referencing_objects (Array(Object)):

Return type

Array(Object)

import_asset_tasks(import_tasks)None

Imports assets using tasks specified.

Parameters

import_tasks (Array(AssetImportTask)) – Tasks that specify how to import each file

import_assets_automated(import_data)

Imports assets using data specified completely up front. Does not ever ask any questions of the user or show any modal error messages

Parameters

import_data (AutomatedAssetImportData) –

Returns

list of successfully imported assets

Return type

Array(Object)

import_assets_with_dialog(destination_path)

Opens a file open dialog to choose files to import to the destination path.

Parameters

destination_path (str) – Path to import files to

Returns

list of successfully imported assets

Return type

Array(Object)

open_editor_for_assets(assets)None

Opens editor for assets deprecated: Please use UAssetEditorSubsystem::OpenEditorForAssets instead.

Parameters

assets (Array(Object)) –

rename_assets(assets_and_names)bool

Renames assets using the specified names.

Parameters

assets_and_names (Array(AssetRenameData)) –

Returns

Return type

bool

rename_assets_with_dialog(assets_and_names, auto_checkout=False)AssetRenameResult

Renames assets using the specified names.

Parameters
Returns

Return type

AssetRenameResult

rename_referencing_soft_object_paths(packages_to_check, asset_redirector_map)None

Function that renames all FSoftObjectPath object with the old asset path to the new one.

Parameters