unreal.AssetTools¶
- class unreal.AssetTools(outer: Object | None = None, name: Name | str = 'None')¶
Bases:
InterfaceAsset Tools
C++ Source:
Module: AssetTools
File: IAssetTools.h
- begin_advanced_copy_packages(input_names_to_copy, target_path, on_copy_complete) None¶
Begin Advanced Copy Packages
- Parameters:
target_path (str)
on_copy_complete (AdvancedCopyCompletedEvent)
- 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_async(asset_name, package_path, asset_class, factory, on_complete, on_cancelled, calling_context='None') bool¶
Creates an asset with the specified name, path, and factory asynchronously
- Parameters:
asset_name (str) – the name of the new asset
package_path (str) – the package that will contain the new asset
factory (Factory) – the factory that will build the new asset
on_complete (AssetCreateCompleteDynamic) – called when the factory has successfully created the asset
on_cancelled (AssetCreateCancelledDynamic) – called if the asynchronous method is cancelled
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:
- 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_asset_with_dialog_async(asset_name, package_path, asset_class, factory, on_complete, on_cancelled, calling_context='None') bool¶
Opens an async dialog to create an asset.
- Parameters:
asset_name (str)
package_path (str)
factory (Factory)
on_complete (AssetCreateCompleteDynamic)
on_cancelled (AssetCreateCancelledDynamic)
calling_context (Name)
- Returns:
true if the process was started successfully.
- Return type:
- 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.
- is_asset_read_only(asset_data) bool¶
Determines whether an asset is considered read-only for editing, based on its flags and the current permissions ( see: GetWritableFolderPermissionList). note: This does not check the read-only state of the file itself or anything regarding source control, as it’s only checking if the asset can be edited in-memory, not that any edits can be saved to disk.
- migrate_packages(package_names_to_migrate, destination_path, options=[False, False, 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