API reference

ftrack_action_handler

BaseAction

class ftrack_action_handler.action.BaseAction(session)[source]

Custom Action base class

label a descriptive string identifing your action.

variant To group actions together, give them the same label and specify a unique variant per action.

identifier a unique identifier for your action.

description a verbose descriptive text for you action

label = None
variant = None
identifier = None
description = None
icon = None
__init__(session)[source]

Expects a ftrack_api.Session instance

session

Return current session.

register(standalone=False)[source]

Registers the action, subscribing the the discover and launch topics. standalone lets the action run in self.session useful for testing and development

discover(session, entities, event)[source]

Return true if we can handle the selected entities.

session is a ftrack_api.Session instance

entities is a list of tuples each containing the entity type and the entity id. If the entity is a hierarchical you will always get the entity type TypedContext, once retrieved through a get operation you will have the “real” entity type ie. example Shot, Sequence or Asset Build.

event the unmodified original event

launch(session, entities, event)[source]

Callback method for the custom action.

return either a bool ( True if successful or False if the action failed ) or a dictionary with they keys message and success, the message should be a string and will be displayed as feedback to the user, success should be a bool, True if successful or False if the action failed.

session is a ftrack_api.Session instance

entities is a list of tuples each containing the entity type and the entity id. If the entity is a hierarchical you will always get the entity type TypedContext, once retrieved through a get operation you will have the “real” entity type ie. example Shot, Sequence or Asset Build.

event the unmodified original event

interface(session, entities, event)[source]

Return a interface if applicable or None

session is a ftrack_api.Session instance

entities is a list of tuples each containing the entity type and the entity id. If the entity is a hierarchical you will always get the entity type TypedContext, once retrieved through a get operation you will have the “real” entity type ie. example Shot, Sequence or Asset Build.

event the unmodified original event

AdvancedBaseAction

class ftrack_action_handler.action.AdvancedBaseAction(session, limit_to_user=None, make_unique=False)[source]

Custom Action base class

label a descriptive string identifying your action.

variant To group actions together, give them the same label and specify a unique variant per action.

identifier a unique identifier for your action.

description a verbose descriptive text for you action

allowed_roles = []
allowed_groups = []
ignored_types = []
allowed_types = []
allow_empty_context = False
__init__(session, limit_to_user=None, make_unique=False)[source]

Expects a ftrack_api.Session instance and optional user limiter

limit_to_user = None
label = None
identifier = None
read_settings_from_user(event)[source]

read settings from the user if there are any Returns a dict like values coming from the interface

write_settings_to_user(event, settings=None)[source]

event the unmodified original event settings dict with information to store related to the action if none is provided all values from the event[data] are taken

get_action_user(event)[source]

From a raw event dictionary, extract the source user, and return it in form of an ftrack.UserEntity

discover(session, entities, event)[source]

Return true if we can handle the selected entities.

session is a ftrack_api.Session instance

entities is a list of tuples each containing the entity type and the entity id. If the entity is a hierarchical you will always get the entity type TypedContext, once retrieved through a get operation you will have the ‘real’ entity type ie. example Shot, Sequence or Asset Build.

event the unmodified original event

create_job(event, description)[source]

Create a new job.

attach_component_to_job(job_id, component_id, description)[source]

Attach a component to a job.

description = None
icon = None
interface(session, entities, event)

Return a interface if applicable or None

session is a ftrack_api.Session instance

entities is a list of tuples each containing the entity type and the entity id. If the entity is a hierarchical you will always get the entity type TypedContext, once retrieved through a get operation you will have the “real” entity type ie. example Shot, Sequence or Asset Build.

event the unmodified original event

launch(session, entities, event)

Callback method for the custom action.

return either a bool ( True if successful or False if the action failed ) or a dictionary with they keys message and success, the message should be a string and will be displayed as feedback to the user, success should be a bool, True if successful or False if the action failed.

session is a ftrack_api.Session instance

entities is a list of tuples each containing the entity type and the entity id. If the entity is a hierarchical you will always get the entity type TypedContext, once retrieved through a get operation you will have the “real” entity type ie. example Shot, Sequence or Asset Build.

event the unmodified original event

register(standalone=False)

Registers the action, subscribing the the discover and launch topics. standalone lets the action run in self.session useful for testing and development

session

Return current session.

variant = None
mark_job_as_failed(job_id, error_message)[source]

Mark a job as failed.

mark_job_as_done(job_id, description)[source]

Mark a job as done.