maxon.AssetManagerInterface

Description

Helper class to control the Asset Manager.

Inheritance diagram

Methods Signature

CheckDownloadAssetWithModalProgressDialog(…)

Checks if an asset is already cached and if not it will download the asset with a modal progress dialog which can be canceled.

GetSelectedAssets(*args)

Returns an array of asset descriptions for the selected assets of the active asset browser.

LoadAssets(searchRepository, …[, …])

LoadAssets executes the load asset command from the asset browser (e.g.

OpenPopup(flags, masterFilter, filterString)

Opens an asset selection popup.

RevealAsset(assets)

Opens the asset browser to show the given assets in the browser.

SearchAssets(filterString, typeFilter, limit)

Runs an Asset Browser search without opening any UI and returns the matching assets.

SetActiveManager(masterFilter[, presenter, …])

Sets the active asset manager mode.

Methods Definition

static AssetManagerInterface.CheckDownloadAssetWithModalProgressDialog(asset, lookupRepository)

Checks if an asset is already cached and if not it will download the asset with a modal progress dialog which can be canceled.

Canceling the dialog will continue the download but returns False. Dependencies will be added to the download queue as well.

Parameters
Returns

True if done. False if cancelled.

Return type

bool

static AssetManagerInterface.GetSelectedAssets(*args)

Returns an array of asset descriptions for the selected assets of the active asset browser. :return: Array of selected asset descriptions. :rtype: maxon.BaseArray [maxon.AssetDescription]

static AssetManagerInterface.LoadAssets(searchRepository, selectionAndFilterString, presenter=None, graphModelRef=None)

LoadAssets executes the load asset command from the asset browser (e.g. double click or open).

Parameters
  • searchRepository (maxon.AssetRepositoryRef) – Search repository.

  • selectionAndFilterString (list[Union[Tuple[maxon.Id, str], list[maxon.Id, str]]]) – A list which contains the search terms to switch modes in the newly created node/object.

  • presenter (None) – Not yet implemented, pass None.

  • graphModelRef (maxon.NodesGraphModelRef) – Optional parameter to pass the node graph where to insert nodes.

Returns

True if loaded. False indicates another error state.

Return type

bool

static AssetManagerInterface.OpenPopup(flags, masterFilter, filterString, smartFilter=None, presenter=None, model=None, title='', inSelection=(), outSelection=None)

Opens an asset selection popup.

Parameters
  • flags (maxon.ASSETPOPUPOPTIONS) – see ASSETPOPUPOPTIONS.

  • masterFilter (maxon.MASTERFILTER) – see MASTERFILTER.

  • filterString (str) – see FilterString.

  • smartFilter (maxon.AssetDescription) – SmartFilter to select.

  • presenter (None) – Not yet implemented, pass None.

  • model (None) – Not yet implemented, pass None.

  • title (str) – Window Title.

  • inSelection (list(maxon.Id)) – Define the selected elements and returns the selected elements (value being changed by the OpenPopup method).

  • outSelection (Callable[[maxon.DragAndDropDataAssetArray], None]) – Delegate.

static AssetManagerInterface.RevealAsset(assets)

Opens the asset browser to show the given assets in the browser.

Parameters

assets (Union[maxon.AssetDescription, Collection[maxon.AssetDescription], maxon.BaseArray [maxon.AssetDescription]]) – Assets to show.

static AssetManagerInterface.SearchAssets(filterString, typeFilter, limit)

Runs an Asset Browser search without opening any UI and returns the matching assets.

The filter string is the Asset Browser’s own search syntax, so an ai: prefix performs a semantic search. The prefix takes no space after the colon and a multi-word query must be quoted - ai:”a red leather armchair” - because the parser splits on the first space. A semantic query returns nothing when the AI service is disabled in the preferences.

Parameters
  • filterString (str) – The search query in Asset Browser filter syntax.

  • typeFilter (str) – Pipe-separated asset types, in the Asset Browser’s own vocabulary: "model", "scene", "material", "media", "nodetemplate", "operator". Use "model|scene" for geometry or "media" for textures. An empty string searches every type, which mixes textures in with models.

  • limit (int) – Maximum number of assets to return, or 0 for no limit.

Returns

The matching assets, best match first for a semantic query.

Return type

maxon.BaseArray [maxon.AssetDescription]

static AssetManagerInterface.SetActiveManager(masterFilter, presenter=None, model=None)

Sets the active asset manager mode.

Parameters