CommandAssetInterface Class Reference

#include <asset_command.h>

Inheritance diagram for CommandAssetInterface:

Detailed Description

CommandAssetInterface extends the AssetInterface to deal with command assets.

Static Public Member Functions

static MAXON_METHOD Result< CommandAsset > Create ()
 
static MAXON_METHOD Result< void > Execute (const AssetDescription &commandAsset, Bool withOptions)
 
static MAXON_METHOD Result< COMMAND_ASSET_STATEQueryState (const AssetDescription &commandAsset)
 
static MAXON_METHOD Result< IntGetLegacyId (const AssetDescription &commandAsset)
 
static MAXON_METHOD Result< Array< Id > > GetCommandScopes (const AssetDescription &commandAsset)
 
static MAXON_METHOD Result< BoolAddCommandScope (const Id &scope, Array< Id > &scopeArray)
 
static MAXON_METHOD Result< BoolEraseCommandScope (const Id &scope, Array< Id > &scopeArray)
 
static MAXON_METHOD Result< void > StoreCommandScopes (const AssetDescription &commandAsset, Array< Id > &&scopeArray)
 
static MAXON_METHOD Result< BoolContainsCommandScope (const AssetDescription &commandAsset, const Id &scope)
 
static MAXON_METHOD Result< BaseArray< String > > GetCommandScopeNames (const AssetDescription &commandAsset)
 
static MAXON_METHOD String GetCommandScopeName (const Id &scope)
 
static MAXON_METHOD Result< IdGetCommandType (const AssetDescription &commandAsset)
 
static MAXON_METHOD Result< StringGetCommandTypeName (const Id &commandType, const AssetRepositoryRef &repository)
 
static MAXON_METHOD Bool AssetIsObjectCommandType (const AssetDescription &commandAsset)
 
static MAXON_METHOD Bool IsObjectCommandType (const Id &commandType)
 
static MAXON_METHOD Result< void > RegisterLegacyCommandScopes (Int32 commandId, const BaseArray< Id > &scopes)
 
static MAXON_METHOD Result< BaseArray< Id > > GetRegisteredLegacyCommandScopes (Int32 commandId)
 
static MAXON_METHOD Result< void > RegisterLegacyCommandType (Int32 commandId, const Id &type)
 
static MAXON_METHOD Id GetRegisteredLegacyCommandType (Int32 commandId)
 

Static Public Attributes

static constexpr Int LEGACY_ID_UNDEF
 

Private Member Functions

 MAXON_INTERFACE (CommandAssetInterface, MAXON_REFERENCE_COPY_ON_WRITE, "net.maxon.interface.commandasset")
 

Member Function Documentation

◆ MAXON_INTERFACE()

MAXON_INTERFACE ( CommandAssetInterface  ,
MAXON_REFERENCE_COPY_ON_WRITE  ,
"net.maxon.interface.commandasset"   
)
private

◆ Create()

static MAXON_METHOD Result<CommandAsset> Create ( )
static

◆ Execute()

static MAXON_METHOD Result<void> Execute ( const AssetDescription &  commandAsset,
Bool  withOptions 
)
static

Executes the command asset.

See also
ASSETMETADATA::AssetCommandExecuteDelegate.
Parameters
[in]commandAssetThe command asset.
[in]withOptionsIf command has options (COMMAND_ASSET_STATE::HAS_OPTION), set to true to show the options dialog before executing the command asset.
Returns
OK on success.

◆ QueryState()

static MAXON_METHOD Result<COMMAND_ASSET_STATE> QueryState ( const AssetDescription &  commandAsset)
static

Queries the command asset state.

See also
ASSETMETADATA::AssetCommandQueryStateDelegate and COMMAND_ASSET_STATE.
Parameters
[in]commandAssetThe command asset.
Returns
The state of the command asset. COMMAND_ASSET_STATE.

◆ GetLegacyId()

static MAXON_METHOD Result<Int> GetLegacyId ( const AssetDescription &  commandAsset)
static

◆ GetCommandScopes()

static MAXON_METHOD Result<Array<Id> > GetCommandScopes ( const AssetDescription &  commandAsset)
static

Gets the command asset scopes, e.g. ASSETMETADATA::CommandScopeMesh.

Parameters
[in]commandAssetThe command asset.
Returns
Array with command scope IDs.

◆ AddCommandScope()

static MAXON_METHOD Result<Bool> AddCommandScope ( const Id scope,
Array< Id > &  scopeArray 
)
static

Adds the scope into the scopeArray.

Parameters
[in]scopeThe command asset scope ID.
[in,out]scopeArrayArray with scope IDs to ad the scope to.
Returns
true if the scope has been successfully added (it didn't exists in scopeArray), false if the scope already exists in the scopeArray.

◆ EraseCommandScope()

static MAXON_METHOD Result<Bool> EraseCommandScope ( const Id scope,
Array< Id > &  scopeArray 
)
static

Removes the scope out of the scopeArray.

Parameters
[in]scopeThe command asset scope ID.
[in,out]scopeArrayArray with scope IDs to erase the scope from.
Returns
true if the scope has been successfully removed (it existed in scopeArray), false if the scope wasn't removed because scopeArray doesn't contain it.

◆ StoreCommandScopes()

static MAXON_METHOD Result<void> StoreCommandScopes ( const AssetDescription &  commandAsset,
Array< Id > &&  scopeArray 
)
static

Stores the scopeArray into the commandAsset metadata in the built-in database in a persistent way.

Parameters
[in]commandAssetThe command asset.
[in]scopeArrayArray with scope IDs to be stored.
Returns
OK on success.

◆ ContainsCommandScope()

static MAXON_METHOD Result<Bool> ContainsCommandScope ( const AssetDescription &  commandAsset,
const Id scope 
)
static

Checks whether commandAsset has the scope assigned.

Parameters
[in]commandAssetThe command asset.
[in]scopeThe Scope ID to check.
Returns
true if commandAsset contains the scope, otherwise false.

◆ GetCommandScopeNames()

static MAXON_METHOD Result<BaseArray<String> > GetCommandScopeNames ( const AssetDescription &  commandAsset)
static

Gets an array with all the names the @formatP of the scopes contained inChecks whether commandAsset has the scope assigned.

Parameters
[in]commandAssetThe command asset.
Returns
Array with scope names.

◆ GetCommandScopeName()

static MAXON_METHOD String GetCommandScopeName ( const Id scope)
static

Gets the name of a command scope.

Parameters
[in]scopeThe command asset scope.
Returns
The scope name.

◆ GetCommandType()

static MAXON_METHOD Result<Id> GetCommandType ( const AssetDescription &  commandAsset)
static

Gets the command asset type, e.g. ASSETMETADATA::CommandTypeCommand

Parameters
[in]commandAssetThe command asset.
Returns
The command asset type.

◆ GetCommandTypeName()

static MAXON_METHOD Result<String> GetCommandTypeName ( const Id commandType,
const AssetRepositoryRef &  repository 
)
static

Gets the name of a command type.

Parameters
[in]commandTypeThe command asset type.
[in]repositoryThe asset repository.
Returns
The command type name.

◆ AssetIsObjectCommandType()

static MAXON_METHOD Bool AssetIsObjectCommandType ( const AssetDescription &  commandAsset)
static

Checks if commandAsset is of type Object, e.g. ASSETMETADATA::CommandTypeObjectEffector.

Parameters
[in]commandAssetThe command asset.
Returns
true if commandAsset is of type Object, otherwise false.

◆ IsObjectCommandType()

static MAXON_METHOD Bool IsObjectCommandType ( const Id commandType)
static

Checks if commandType is of type Object, e.g. ASSETMETADATA::CommandTypeObjectEffector.

Parameters
[in]commandTypeThe command type.
Returns
true if commandType is of type Object, otherwise false.

◆ RegisterLegacyCommandScopes()

static MAXON_METHOD Result<void> RegisterLegacyCommandScopes ( Int32  commandId,
const BaseArray< Id > &  scopes 
)
static

Registers an array of scopes for a legacy commandId.

Parameters
[in]commandIdThe legacy command ID.
[in]scopesThe array with the scopes to assign to legacy command ID.
Returns
OK on success.

◆ GetRegisteredLegacyCommandScopes()

static MAXON_METHOD Result<BaseArray<Id> > GetRegisteredLegacyCommandScopes ( Int32  commandId)
static

Gets the scopes registered to the legacy commandId.

Parameters
[in]commandIdThe legacy command ID.
Returns
The array with the scopes assigned to legacy command ID

◆ RegisterLegacyCommandType()

static MAXON_METHOD Result<void> RegisterLegacyCommandType ( Int32  commandId,
const Id type 
)
static

Registers a command type for a legacy commandId, e.g. ASSETMETADATA::CommandTypeObjectField.

Parameters
[in]commandIdThe legacy command ID.
[in]typeThe command type to assign to commandId.
Returns
OK on success.

◆ GetRegisteredLegacyCommandType()

static MAXON_METHOD Id GetRegisteredLegacyCommandType ( Int32  commandId)
static

Gets the type registered to the legacy commandId, e.g. ASSETMETADATA::CommandTypeObjectField.

Parameters
[in]commandIdThe legacy command ID.
Returns
The command type assigned to commandId.

Member Data Documentation

◆ LEGACY_ID_UNDEF

constexpr Int LEGACY_ID_UNDEF
staticconstexpr