unreal.CollectionManagerSubsystem¶
- class unreal.CollectionManagerSubsystem(outer: Object | None = None, name: Name | str = 'None')¶
Bases:
EditorSubsystemCollection Manager Scripting Subsystem
C++ Source:
Module: UnrealEd
File: CollectionManagerScriptingSubsystem.h
- add_asset_data_to_collection(collection, asset_data) bool¶
Add the given asset to the given collection.
- Parameters:
collection (Collection) – The collection to modify. Will be created if it does not exist.
asset_data (AssetData) – Asset to add.
- Returns:
True if the collection was modified, false otherwise (see the output log for details on error).
- Return type:
- add_asset_datas_to_collection(collection, asset_datas) bool¶
Add the given assets to the given collection.
- Parameters:
collection (Collection) – The collection to modify. Will be created if it does not exist.
- Returns:
True if the collection was modified, false otherwise (see the output log for details on error).
- Return type:
- add_asset_ptr_to_collection(collection, asset_ptr) bool¶
Add the given asset to the given collection.
- Parameters:
collection (Collection) – The collection to modify. Will be created if it does not exist.
asset_ptr (Object) – Asset to add.
- Returns:
True if the collection was modified, false otherwise (see the output log for details on error).
- Return type:
- add_asset_ptrs_to_collection(collection, asset_ptrs) bool¶
Add the given assets to the given collection.
- Parameters:
collection (Collection) – The collection to modify. Will be created if it does not exist.
- Returns:
True if the collection was modified, false otherwise (see the output log for details on error).
- Return type:
- add_asset_to_collection(collection, asset_path) bool¶
Add the given asset to the given collection.
- Parameters:
collection (Collection) – The collection to modify. Will be created if it does not exist.
asset_path (SoftObjectPath) – Asset to add (its path name, eg) /Game/MyFolder/MyAsset.MyAsset).
- Returns:
True if the collection was modified, false otherwise (see the output log for details on error).
- Return type:
- add_assets_to_collection(collection, asset_paths) bool¶
Add the given assets to the given collection.
- Parameters:
collection (Collection) – The collection to modify. Will be created if it does not exist.
asset_paths (Array[SoftObjectPath]) – Assets to add (their paths, eg) /Game/MyFolder/MyAsset.MyAsset).
- Returns:
True if the collection was modified, false otherwise (see the output log for details on error).
- Return type:
- collection_exists(container, collection, share_type) bool¶
Check whether the given collection exists in the given container (matching both name and share type).
- Parameters:
container (CollectionContainerSource) – The container to search. “None” defaults to the base game’s container.
collection (Name) – The name of the collection to look for.
share_type (CollectionShareType) – The share type of the collection to look for.
- Returns:
True if the collection exists, false otherwise (if false is due to an error, see the output log for details).
- Return type:
- create_collection(container, collection, share_type) Collection or None¶
Create a new collection with the given name and share type in the provided collection container.
- Parameters:
container (CollectionContainerSource) – The container the collection should be created in. “None” defaults to the base game’s container.
collection (Name) – Name to give to the collection.
share_type (CollectionShareType) – Whether the collection should be local, private, or shared?
- Returns:
True if the collection was created, false otherwise (see the output log for details on error).
out_new_collection (Collection): The newly created collection.
- Return type:
Collection or None
- create_or_empty_collection(container, collection, share_type) Collection or None¶
Create a new collection with the given name and share type in the provided collection container if it doesn’t already exist, or empty the existing collection if it does.
- Parameters:
container (CollectionContainerSource) – The container the collection should be created or found in. “None” defaults to the base game’s container.
collection (Name) – Name of the collection to create or empty.
share_type (CollectionShareType) – Whether the collection should be local, private, or shared?
- Returns:
True if the collection was created or emptied, false otherwise (see the output log for details on error).
out_new_or_empty_collection (Collection): The collection that was created or emptied.
- Return type:
Collection or None
- destroy_collection(collection) bool¶
Destroy the given collection.
- Parameters:
collection (Collection) – The collection to destroy.
- Returns:
True if the collection was destroyed, false otherwise (see the output log for details on error).
- Return type:
- empty_collection(collection) bool¶
Remove all assets from the given collection.
- Parameters:
collection (Collection) – The collection to modify.
- Returns:
True if the collection was modified, false otherwise (see the output log for details on error).
- Return type:
- get_assets_in_collection(collection) Array[AssetData] or None¶
Get the assets in the given collection.
- Parameters:
collection (Collection) – The collection from which to retrieve assets.
- Returns:
True if the collection exists, false otherwise (see the output log for details on error).
out_assets (Array[AssetData]): The assets found in the collection.
- Return type:
- get_base_game_collection_container() CollectionContainerSource¶
Get the collection container for the base game.
- Returns:
The collection container for the base game.
- Return type:
- get_collection_containers() Array[CollectionContainerSource]¶
Gets all available collection containers.
- Returns:
Array of all collection containers.
- Return type:
- get_collections(container) Array[Collection] or None¶
Get all available collections in the specified container.
- Parameters:
container (CollectionContainerSource) – The container to retrieve collections from. “None” defaults to the base game’s container.
- Returns:
True if OutCollections contains at least one collection, false otherwise (see the output log for details on error).
out_collections (Array[Collection]): The collections found in the container.
- Return type:
Array[Collection] or None
- get_collections_by_name(container, collection) Array[Collection] or None¶
Gets the given collections in the given container (matching only by name).
- Parameters:
container (CollectionContainerSource) – The container to search. “None” defaults to the base game’s container.
collection (Name) – The collection to look for.
- Returns:
True if OutCollections contains at least one collection, false otherwise (see the output log for details on error).
out_collections (Array[Collection]): The collections found.
- Return type:
Array[Collection] or None
- get_collections_containing_asset(container, asset_path) Array[Collection] or None¶
Get the collections in the specified container that contain the given asset.
- Parameters:
container (CollectionContainerSource) – Container to search for collections containing the given asset. “None” defaults to the base game’s container.
asset_path (SoftObjectPath) – Asset to test (its path name, eg) /Game/MyFolder/MyAsset.MyAsset).
- Returns:
True if the container exists, false otherwise (see the output log for details on error).
out_collections (Array[Collection]): Array of the collections that contain the asset.
- Return type:
Array[Collection] or None
- get_collections_containing_asset_data(container, asset_data) Array[Collection] or None¶
Get the collections in the specified container that contain the given asset.
- Parameters:
container (CollectionContainerSource) – Container to search for collections containing the given asset. “None” defaults to the base game’s container.
asset_data (AssetData) – Asset to test.
- Returns:
True if the container exists, false otherwise (see the output log for details on error).
out_collections (Array[Collection]): Array of the collections that contain the asset.
- Return type:
Array[Collection] or None
- get_collections_containing_asset_ptr(container, asset_ptr) Array[Collection] or None¶
Get the collections in the specified container that contain the given asset.
- Parameters:
container (CollectionContainerSource) – Container to search for collections containing the given asset. “None” defaults to the base game’s container.
asset_ptr (Object) – Asset to test.
- Returns:
True if the container exists, false otherwise (see the output log for details on error).
out_collections (Array[Collection]): Array of the collections that contain the asset.
- Return type:
Array[Collection] or None
- remove_asset_data_from_collection(collection, asset_data) bool¶
Remove the given asset from the given collection.
- Parameters:
collection (Collection) – The collection to modify.
asset_data (AssetData) – Asset to remove.
- Returns:
True if the collection was modified, false otherwise (see the output log for details on error).
- Return type:
- remove_asset_datas_from_collection(collection, asset_datas) bool¶
Remove the given assets from the given collection.
- Parameters:
collection (Collection) – The collection to modify.
- Returns:
True if the collection was modified, false otherwise (see the output log for details on error).
- Return type:
- remove_asset_from_collection(collection, asset_path) bool¶
Remove the given asset from the given collection.
- Parameters:
collection (Collection) – The collection to modify.
asset_path (SoftObjectPath) – Asset to remove (its path, eg) /Game/MyFolder/MyAsset.MyAsset).
- Returns:
True if the collection was modified, false otherwise (see the output log for details on error).
- Return type:
- remove_asset_ptr_from_collection(collection, asset_ptr) bool¶
Remove the given asset from the given collection.
- Parameters:
collection (Collection) – The collection to modify.
asset_ptr (Object) – Asset to remove.
- Returns:
True if the collection was modified, false otherwise (see the output log for details on error).
- Return type:
- remove_asset_ptrs_from_collection(collection, asset_ptrs) bool¶
Remove the given assets from the given collection.
- Parameters:
collection (Collection) – The collection to modify.
- Returns:
True if the collection was modified, false otherwise (see the output log for details on error).
- Return type:
- remove_assets_from_collection(collection, asset_paths) bool¶
Remove the given assets from the given collection.
- Parameters:
collection (Collection) – The collection to modify.
asset_paths (Array[SoftObjectPath]) – Assets to remove (their paths, eg) /Game/MyFolder/MyAsset.MyAsset).
- Returns:
True if the collection was modified, false otherwise (see the output log for details on error).
- Return type:
- rename_collection(collection, new_name, new_share_type) bool¶
Rename the given collection.
- Parameters:
collection (Collection) – The collection to rename.
new_name (Name) – New name to give to the collection.
new_share_type (CollectionShareType) – New share type to give to the collection (local, private, or shared).
- Returns:
True if the collection was renamed, false otherwise (see the output log for details on error).
- Return type:
- reparent_collection(collection, new_parent_collection) bool¶
Re-parent the given collection.
- Parameters:
collection (Collection) – The collection to re-parent.
new_parent_collection (Collection) – The new parent collection, or “None” to have the collection become a root collection.
- Returns:
True if the collection was re-parented, false otherwise (see the output log for details on error).
- Return type: