ftrack_connect_pipeline.host.engine

ftrack_connect_pipeline.host.engine.getEngine(baseClass, engineType)[source]

Returns the Class or Subclass of the given baseClass that matches the name of the given engineType

class ftrack_connect_pipeline.host.engine.BaseEngine(event_manager, host_types, host_id, asset_type_name)[source]

Bases: object

Base engine class.

engine_type = 'base'

Engine type for this engine class

class FtrackObjectManager(event_manager)

Bases: object

FtrackObjectManager class. Mantain the syncronization between asset_info and the ftrack information of the objects in the scene.

class DccObject(name=None, from_id=None, **kwargs)

Bases: dict

Base DccObject class.

__init__(name=None, from_id=None, **kwargs)

If the from_id is provided find an object in the dcc with the given from_id as assset_info_id. If a name is provided create a new object in the dcc.

connect_objects(objects)

Link the given objects ftrack attribute to the self name object asset_link attribute in the DCC.

objects List of DCC objects

create(name)

Creates a new dcc_object with the given name.

static dictionary_from_object(object_name)

Static method to be used without initializing the current class. Returns a dictionary with the keys and values of the given object_name if exists.

object_name ftrack object type from the DCC.

from_asset_info_id(asset_info_id)

Checks the dcc to get all the ftrack objects. Compares them with the given asset_info_id and returns them if matches.

ftrack_plugin_id = None

Plugin id used on some DCC applications

get(k, default=None)

If exists, returns the value of the given k otherwise returns default.

k : Key of the current dictionary.

default : Default value of the given Key.

property name

Return name of the object

property objects_loaded

Returns the attribute objects_loaded of the current self name

setdefault(key, value=None)

Sets a default value for the given key.

update(*args, **kwargs)

Updates the current keys and values with the given ones.

__init__(event_manager)

Initialize FtrackObjectManager with instance of EventManager

property asset_info

Returns instance of FtrackAssetInfo

connect_objects(objects)

Link the given objects ftrack attribute to the self dcc_object.

objects List of objects

create_new_dcc_object()

Creates a new dcc_object with a unique name.

property dcc_object

Returns instance of DccObject

property event_manager

Returns instance of EventManager

property is_sync

Returns if the self dcc_object is sync with the self asset_info

property objects_loaded

Returns whether the objects are loaded in the scene or not.

property session

Returns instance of ftrack_api.session.Session

class DccObject(name=None, from_id=None, **kwargs)

Bases: dict

Base DccObject class.

__init__(name=None, from_id=None, **kwargs)

If the from_id is provided find an object in the dcc with the given from_id as assset_info_id. If a name is provided create a new object in the dcc.

connect_objects(objects)

Link the given objects ftrack attribute to the self name object asset_link attribute in the DCC.

objects List of DCC objects

create(name)

Creates a new dcc_object with the given name.

static dictionary_from_object(object_name)

Static method to be used without initializing the current class. Returns a dictionary with the keys and values of the given object_name if exists.

object_name ftrack object type from the DCC.

from_asset_info_id(asset_info_id)

Checks the dcc to get all the ftrack objects. Compares them with the given asset_info_id and returns them if matches.

ftrack_plugin_id = None

Plugin id used on some DCC applications

get(k, default=None)

If exists, returns the value of the given k otherwise returns default.

k : Key of the current dictionary.

default : Default value of the given Key.

property name

Return name of the object

property objects_loaded

Returns the attribute objects_loaded of the current self name

setdefault(key, value=None)

Sets a default value for the given key.

update(*args, **kwargs)

Updates the current keys and values with the given ones.

property ftrack_object_manager

Initializes and returns an instance of FtrackObjectManager

property dcc_object

Returns the dcc_object from the FtrackObjectManager

property asset_info

Returns the asset_info from the FtrackObjectManager

property host_id

Returns the current host id.

property host_types

Return the current host type.

__init__(event_manager, host_types, host_id, asset_type_name)[source]

Initialise HostConnection with instance of EventManager , and host, host_id and asset_type_name

host : Host type.. (ex: python, maya, nuke….) host_id : Host id. asset_type_name : If engine is initialized to publish or load, the asset type should be specified.

run_event(plugin_name, plugin_type, host_type, data, options, context_data, method)[source]

Returns an ftrack_api.event.base.Event with the topic PIPELINE_RUN_PLUGIN_TOPIC with the data of the given plugin_name, plugin_type, host_definition, data, options, context_data, method

plugin_name : Name of the plugin.

plugin_type : Type of plugin.

host_definition : Host type.

data : data to pass to the plugin.

options : options to pass to the plugin

context_data : result of the context plugin containing the context_id, aset_name… Or None

method : Method of the plugin to be executed.

run(data)[source]

Executes the _run_plugin() with the provided data. Returns the result of the mentioned method.

data : pipeline[‘data’] provided from the client host connection at run()

run_stage(stage_name, plugins, stage_context, stage_options, stage_data, plugins_order=None, step_type=None, step_name=None)[source]

Returns the bool status and the result list of dictionaries of executing all the plugins in the stage. This function executes all the defined plugins for this stage using the _run_plugin()

stage_name : Name of the stage that’s executing.

plugins : List of plugins that has to execute.

stage_context : Context dictionary with the result of the context plugin containing the context_id, aset_name… Or None

stage_options : Options dictionary to be passed to each plugin.

stage_data : Data list of dictionaries to be passed to each stage.

plugins_order : Order of the plugins to be executed.

step_type : Type of the step.

run_step(step_name, stages, step_context, step_options, step_data, stages_order, step_type)[source]

Returns the bool status and the result list of dictionaries of executing all the stages in the step. This function executes all the defined stages for for this step using the run_stage() with the given stage_order.

step_name : Name of the step that’s executing.

stages : List of stages that has to execute.

step_context : Context dictionary with the result of the context plugin containing the context_id, aset_name… Or None

step_options : Options dictionary to be passed to each stage.

step_data : Data list of dictionaries to be passed to each stage.

stages_order : Order of the stages to be executed.

step_type : Type of the step.

run_definition(data)[source]

Runs the whole definition from the provided data. Call the method run_step() for each context, component and finalizer steps.

data : pipeline[‘data’] provided from the client host connection at run() Should be a valid definition.

ftrack_connect_pipeline.host.engine.asset_manager

class ftrack_connect_pipeline.host.engine.asset_manager.AssetManagerEngine(event_manager, host_types, host_id, asset_type_name=None)[source]

Bases: BaseEngine

Base Asset Manager Engine class.

engine_type = 'asset_manager'

Engine type for this engine class

__init__(event_manager, host_types, host_id, asset_type_name=None)[source]

Initialise AssetManagerEngine with instance of EventManager , and host, host_id and asset_type_name

host : Host type.. (ex: python, maya, nuke….)

host_id : Host id.

asset_type_name : Default None. If engine is initialized to publish or load, the asset type should be specified.

discover_assets(assets=None, options=None, plugin=None)[source]

Should be overridden by child

(Standalone mode, dev, testing) Discover 10 random assets from Ftrack with component name main. Returns status and ftrack_asset_info_list which is a list of FtrackAssetInfo

resolve_dependencies(context_id, options=None, plugin=None)[source]

Returns a list of the asset versions that task identified by context_id is depending upon, with additional options using the given plugin.

context_id : id of the task.

options : Options to resolver.

plugin : Plugin definition, a dictionary with the plugin information.

select_assets(assets, options=None, plugin=None)[source]

Returns status dictionary and results dictionary keyed by the id for executing the select_asset() for all the FtrackAssetInfo in the given assets list.

assets: List of FtrackAssetInfo

select_asset(asset_info, options=None, plugin=None)[source]

(Not implemented for python standalone mode) Returns the status and the result of selecting the given asset_info

asset_info : FtrackAssetInfo

update_assets(assets, options=None, plugin=None)[source]

Returns status dictionary and results dictionary keyed by the id for executing the update_asset() using the criteria of the given plugin for all the FtrackAssetInfo in the given assets list.

assets: List of FtrackAssetInfo

update_asset(asset_info, options=None, plugin=None)[source]

Returns the status and the result of updating the given asset_info using the criteria of the given plugin

asset_info : FtrackAssetInfo

options : Options to update the asset.

plugin : Plugin definition, a dictionary with the plugin information.

load_assets(assets, options=None, plugin=None)[source]

Returns status dictionary and results dictionary keyed by the id for executing the remove_asset() for all the FtrackAssetInfo in the given assets list.

assets: List of FtrackAssetInfo

load_asset(asset_info, options=None, plugin=None)[source]

(Not implemented for python standalone mode) Returns the status and the result of removing the given asset_info

asset_info : FtrackAssetInfo

change_version(asset_info, options, plugin=None)[source]

Returns the status and the result of changing the version of the given asset_info to the new version id passed in the given options

asset_info : FtrackAssetInfo

options : Options should contain the new_version_id key with the id value

plugin : Default None. Plugin definition, a dictionary with the plugin information.

unload_assets(assets, options=None, plugin=None)[source]

Returns status dictionary and results dictionary keyed by the id for executing the remove_asset() for all the FtrackAssetInfo in the given assets list.

assets: List of FtrackAssetInfo

unload_asset(asset_info, options=None, plugin=None)[source]

(Not implemented for python standalone mode) Returns the status and the result of unloading the given asset_info.

asset_info : FtrackAssetInfo

remove_assets(assets, options=None, plugin=None)[source]

Returns status dictionary and results dictionary keyed by the id for executing the remove_asset() for all the FtrackAssetInfo in the given assets list.

assets: List of FtrackAssetInfo

remove_asset(asset_info, options=None, plugin=None)[source]

(Not implemented for python standalone mode) Returns the status and the result of removing the given asset_info.

asset_info : FtrackAssetInfo

run(data)[source]

Override method of engine() Executes the method defined in the given data method key or in case is not given will execute the _run_plugin() with the provided data plugin key. Returns the result of the executed method or plugin.

data : pipeline[‘data’] provided from the client host connection at run()

ftrack_connect_pipeline.host.engine.open

class ftrack_connect_pipeline.host.engine.open.OpenerEngine(event_manager, host_types, host_id, asset_type_name)[source]

Bases: BaseEngine

engine_type = 'opener'

Engine type for this engine class

__init__(event_manager, host_types, host_id, asset_type_name)[source]

Initialise HostConnection with instance of EventManager , and host, host_id and asset_type_name

host : Host type.. (ex: python, maya, nuke….) host_id : Host id. asset_type_name : If engine is initialized to publish or load, the asset type should be specified.

ftrack_connect_pipeline.host.engine.load

class ftrack_connect_pipeline.host.engine.load.LoaderEngine(event_manager, host_types, host_id, asset_type_name)[source]

Bases: BaseEngine

engine_type = 'loader'

Engine type for this engine class

__init__(event_manager, host_types, host_id, asset_type_name)[source]

Initialise HostConnection with instance of EventManager , and host, host_id and asset_type_name

host : Host type.. (ex: python, maya, nuke….) host_id : Host id. asset_type_name : If engine is initialized to publish or load, the asset type should be specified.

ftrack_connect_pipeline.host.engine.publish

class ftrack_connect_pipeline.host.engine.publish.PublisherEngine(event_manager, host_types, host_id, asset_type_name)[source]

Bases: BaseEngine

engine_type = 'publisher'

Engine type for this engine class

__init__(event_manager, host_types, host_id, asset_type_name)[source]

Initialise HostConnection with instance of EventManager , and host, host_id and asset_type_name

host : Host type.. (ex: python, maya, nuke….) host_id : Host id. asset_type_name : If engine is initialized to publish or load, the asset type should be specified.