Actions
Actions are tools, with or without a UI, that are designed to be launched from the ftrack Studio interface. Actions can be used to launch applications, perform operations on entities, or interact with external services.
Connect uses actions to launch applications through the application launcher, which act as a bridge between ftrack Studio and integrations configured through application launcher configuration extensions.
ftrack.action.discover
The ftrack.action.discover
hook is triggered from the ftrack interface to request a list of available actions for launching.
For more information, see actions.
The default hook is a placeholder and should be extended to include a complete list of actions that can be launched.
Example event passed to hook:
Event(
topic='ftrack.action.discover',
data=dict(
selection=[
dict(
entityId='eb16970c-5fc6-11e2-bb9a-f23c91df25eb',
entityType='task',
)
]
)
)
Expects reply data in the form:
dict(
items=[
dict(
label='Mega Modeling',
variant='2014',
actionIdentifier='ftrack-connect-launch-applications-action',
icon='URL to custom icon or predefined name',
applicationIdentifier='mega_modeling_2014'
),
dict(
label='Professional Painter',
icon='URL to custom icon or predefined name',
actionIdentifier='ftrack-connect-launch-applications-action',
applicationIdentifier='professional_painter'
),
dict(
label='Cool Compositor',
variant='v2',
actionIdentifier='ftrack-connect-launch-applications-action'
icon='URL to custom icon or predefined name',
applicationIdentifier='cc_v2',
cc_plugins=['foo', 'bar']
)
]
)
The response should be a dictionary with an items
list. The list should contain a dictionary for each menu item to be returned.
To add an action, add an item in the following format.
dict(
label='Crazy Compositor',
actionIdentifier='ftrack-connect-launch-applications-action',
variant='v2',
description='Launch Crazy Compositor',
icon='URL to custom icon or predefined name',
cc_plugins=['foo', 'bar'],
applicationIdentifier='cc_v2'
)
The different options are:
-
label
: Used to display the action in the ftrack interface. -
actionIdentifier
: Used to target a specific callback for an action. -
variant
: A variant of the action, such as application version. -
description
: A helpful description for the user. -
icon
: Icon to display in the ftrack interface. Can be either an URL to a custom icon or the name of a predefined icon. Predefined icons arehiero
,hieroplayer
,nuke
,nukex
,maya
,premiere
anddefault
In addition, you can add any extra data you want to include in the event. The data returned will be passed on to the action_launch hook.In the default hook each item contains an
applicationIdentifier
which is used to uniquely identify which application to start.
ftrack.action.launch
The ftrack.action.launch
hook is triggered from the ftrack interface when a user selects an action in the Actions
menu. For more information about launching actions from the web UI, see actions.
The list of actions is provided by the developing/hooks/action_discover
hook
. The action.discover hook provides a list of actions. All parameters from these actions are passed to this hook and can be used when launching the action.
The default hook is a placeholder and should be extended to include correct action commands.
Example event passed to hook:
Event(
topic='ftrack.action.launch',
data=dict(
actionIdentifier='ftrack-connect-launch-applications-action',
applicationIdentifier='maya-2014',
foo='bar',
selection=[
dict(
entityId='eb16970c-5fc6-11e2-bb9a-f23c91df25eb',
entityType='task'
)
]
)
)
Expects reply data in the form:
dict(
success=True,
message='maya-2014 launched successfully.'
)