The ICollectionManager class exposes methods to manage the assets collections:
from unreal_engine import ICollectionManager
print(ICollectionManager.get_collections())
# 1 means ECollectionShareType::CST_Local
print(ICollectionManager.get_child_collections('FooBar', 1))
Collections can be 'static' (they contain references to assets) or 'dynamic' (they apply a search string to get a list of assets)
The api expects knowledge of a bunch of enums mapped as int:
ECollectionShareType
enum Type
{
CST_System,
CST_Local,
CST_Private,
CST_Shared,
CST_All,
}
ECollectionStorageMode
enum Type
{
Static,
Dynamic,
}
returns the list of collections as a python list of tuples with the form (name, ECollectionShareType)
returns the list of root collections as a python list of tuples with the form (name, ECollectionShareType)
returns the list of child collections for a collection (given as name and type) as a python list of tuples with the form (name, ECollectionShareType)
returns the names of root collections as a python list of strings
returns the names of collections as a python list of strings
create a new static collections given a name and a type
create a new dynamic collections given a name and a type
create a new dynamic collections given a name, a type and a storage mode
move the 'name' collection to the 'new_name' parent
add an asset to a static collection using asset's path
Returns true if a collection already exists
returns a string with a unique collection name
deletes an existing collection and returns true on success and false on failure
removes all the existing assets from a collection. Returns true on success and false on failure
returns the search text from a dynamic collection. If you use it on a static collection you will get an error
sets the search text to a dynamic collection. Returns true on success and false on failure
removes an asset from a static collection using asset's path. Returns true on success and false on failure
returns a list with all the asset paths. There is a third optional parameter for recursion. Default value is 1. This function works only with static collections
returns a list with all the object paths. There is a third optional parameter for recursion. Default value is 1. This function works only with static collections
returns a list with all the Classes. There is a third optional parameter for recursion. Default value is 1. This function works only with static collections
returns the parent collection. If the collection has no parent, it returns None.
returns True or False if the project has or doesn't have any collections.