unreal.AssetTools
¶
- class unreal.AssetTools(outer: Optional[Object] = None, name: Union[Name, str] = 'None')¶
Bases:
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:
- Returns:
the new asset or NULL if it fails
- Return type:
- create_asset_with_dialog(asset_name, package_path, asset_class, factory, calling_context='None', call_configure_properties=True) Object ¶
Opens an asset picker dialog and creates an asset with the specified name and path
- 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
- diff_against_depot(object, package_path, package_name) None ¶
Try to diff the local version of an asset against the latest one from the depot
- diff_assets(old_asset, new_asset, old_revision, new_revision) None ¶
Try and diff two assets using class-specific tool. Will do nothing if either asset is NULL, or they are not the same class.
- Parameters:
old_asset (Object) –
new_asset (Object) –
old_revision (RevisionInfo) –
new_revision (RevisionInfo) –
- duplicate_asset(asset_name, package_path, original_object) Object ¶
Creates an asset with the specified name and path. Uses OriginalObject as the duplication source.
- 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.
- 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.
- 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
- find_soft_references_to_object(target_object) Array[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:
- 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) Array[Object] ¶
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:
- import_assets_with_dialog(destination_path) Array[Object] ¶
Opens a file open dialog to choose files to import to the destination path.
- migrate_packages(package_names_to_migrate, destination_path, options=[AssetMigrationConflict.SKIP, '']) None ¶
Migrate packages and dependencies to another folder
- Parameters:
destination_path (str) –
options (MigrationOptions) –
- open_editor_for_assets(assets) None ¶
Opens editor for assets deprecated: Please use UAssetEditorSubsystem::OpenEditorForAssets instead.
- rename_assets(assets_and_names) bool ¶
Renames assets using the specified names.
- Parameters:
assets_and_names (Array[AssetRenameData]) –
- Return type:
- rename_assets_with_dialog(assets_and_names, auto_checkout=False) AssetRenameResult ¶
Renames assets using the specified names.
- Parameters:
assets_and_names (Array[AssetRenameData]) –
auto_checkout (bool) –
- Return type:
- 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:
packages_to_check (Array[Package]) – Packages to check for referencing FSoftObjectPath.
asset_redirector_map (Map[SoftObjectPath, SoftObjectPath]) – Map from old asset path to new asset path