unreal.AssetRegistry
¶
- class unreal.AssetRegistry(outer=None, name='None')¶
Bases:
unreal.Interface
Asset Registry
C++ Source:
Module: AssetRegistry
File: IAssetRegistry.h
- get_all_assets(include_only_on_disk_assets=False) → Array(AssetData) or None¶
Gets asset data for all assets in the registry. This method may be slow, use a filter if possible to avoid iterating over the entire registry.
- get_all_cached_paths()¶
Gets a list of all paths that are currently cached
- get_asset_by_object_path(object_path, include_only_on_disk_assets=False) → AssetData¶
Gets the asset data for the specified object path
- get_assets(filter) → Array(AssetData) or None¶
Gets asset data for all assets that match the filter. Assets returned must satisfy every filter component if there is at least one element in the component’s array. Assets will satisfy a component if they match any of the elements in it.
- get_assets_by_class(class_name, search_sub_classes=False) → Array(AssetData) or None¶
Gets asset data for all assets with the supplied class
- get_assets_by_package_name(package_name, include_only_on_disk_assets=False) → Array(AssetData) or None¶
Gets asset data for the assets in the package with the specified package name
- get_assets_by_path(package_path, recursive=False, include_only_on_disk_assets=False) → Array(AssetData) or None¶
Gets asset data for all assets in the supplied folder path
- Parameters
- Returns
out_asset_data (Array(AssetData)): the list of assets in this path
- Return type
- get_dependencies(package_name, dependency_options) → Array(Name) or None¶
Gets a list of paths to objects that are referenced by the supplied package. (On disk references ONLY)
- Parameters
package_name (Name) – the name of the package for which to gather dependencies (eg, /Game/MyFolder/MyAsset)
dependency_options (AssetRegistryDependencyOptions) – which kinds of dependencies to include in the output list
- Returns
out_dependencies (Array(Name)): a list of packages that are referenced by the package whose path is PackageName
- Return type
- get_referencers(package_name, reference_options) → Array(Name) or None¶
Gets a list of packages that reference the supplied package. (On disk references ONLY)
- Parameters
package_name (Name) – the name of the package for which to gather dependencies (eg, /Game/MyFolder/MyAsset)
reference_options (AssetRegistryDependencyOptions) – which kinds of references to include in the output list
- Returns
out_referencers (Array(Name)): a list of packages that reference the package whose path is PackageName
- Return type
- get_sub_paths(base_path, recurse)¶
Gets a list of all paths that are currently cached below the passed-in base path
- has_assets(package_path, recursive=False) → bool¶
Does the given path contain assets, optionally also testing sub-paths?
- is_loading_assets() → bool¶
Returns true if the asset registry is currently loading files and does not yet know about all assets
- Returns
- Return type
- prioritize_search_path(path_to_prioritize) → None¶
If assets are currently being asynchronously scanned in the specified path, this will cause them to be scanned before other assets.
- Parameters
path_to_prioritize (str) –
- run_assets_through_filter(asset_data_list, filter)¶
Trims items out of the asset data list that do not pass the supplied filter
- scan_files_synchronous(file_paths, force_rescan=False) → None¶
Scan the specified individual files right now and populate the asset registry. If bForceRescan is true, the paths will be scanned again, even if they were previously scanned
- scan_modified_asset_files(file_paths) → None¶
Forces a rescan of specific filenames, call this when you need to refresh from disk
- scan_paths_synchronous(paths, force_rescan=False) → None¶
Scan the supplied paths recursively right now and populate the asset registry. If bForceRescan is true, the paths will be scanned again, even if they were previously scanned
- search_all_assets(synchronous_search) → None¶
Look for all assets on disk (can be async or synchronous)
- Parameters
synchronous_search (bool) –
- use_filter_to_exclude_assets(asset_data_list, filter)¶
Trims items out of the asset data list that pass the supplied filter