ftrack_connect_pipeline.asset

class ftrack_connect_pipeline.asset.FtrackObjectManager(event_manager)[source]

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.

property asset_info

Returns instance of FtrackAssetInfo

property dcc_object

Returns instance of DccObject

property session

Returns instance of ftrack_api.session.Session

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.

__init__(event_manager)[source]

Initialize FtrackObjectManager with instance of EventManager

connect_objects(objects)[source]

Link the given objects ftrack attribute to the self dcc_object.

objects List of objects

create_new_dcc_object()[source]

Creates a new dcc_object with a unique name.

ftrack_connect_pipeline.constants.asset.asset_info

ftrack_connect_pipeline.asset.asset_info.generate_asset_info_dict_from_args(context_data, data, options, session)[source]

Returns a dictionary constructed from the needed values of the given context_data, data and options

context_data : Context dictionary of the current asset. Should contain the keys asset_type_name, asset_name, asset_id, version_number, version_id, context_id.

data : Data of the current operation or plugin. Should contain the component_path from the asset that we are working on.

options : Options of the current widget or operation, should contain the load_mode that we want to/or had apply to the current asset.

session : should be instance of ftrack_api.session.Session to use for communication with the server.

class ftrack_connect_pipeline.asset.asset_info.FtrackAssetInfo(mapping=None, **kwargs)[source]

Bases: dict

Base FtrackAssetInfo class.

__init__(mapping=None, **kwargs)[source]

Initialize the FtrackAssetInfo with the given mapping.

mapping Dictionary with the asset information.

encode_options(asset_info_options)[source]

Encodes the json value from the given asset_info_opitons to base64.

asset_info_opitons : Options used to load the asset in the scene.

decode_options(asset_info_options)[source]

Decodes the json value from the given asset_info_opitons from base64.

asset_info_opitons : Options used to load the asset in the scene.

get(k, default=None)[source]

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.

setdefault(k, default=None)[source]

Sets the default value for the given k.

k : Key of the current dictionary.

default : Default value of the given Key.

classmethod from_version_entity(version_entity, component_name)[source]

Returns an FtrackAssetInfo object generated from the given ftrack_version and the given component_name

ftrack_version : ftrack_api.entity.asset_version.AssetVersion

component_name : Component name

ftrack_connect_pipeline.constants.asset.dcc_object

class ftrack_connect_pipeline.asset.dcc_object.DccObject(name=None, from_id=None, **kwargs)[source]

Bases: dict

Base DccObject class.

ftrack_plugin_id = None

Plugin id used on some DCC applications

property name

Return name of the object

property objects_loaded

Returns the attribute objects_loaded of the current self name

__init__(name=None, from_id=None, **kwargs)[source]

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.

get(k, default=None)[source]

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.

update(*args, **kwargs)[source]

Updates the current keys and values with the given ones.

setdefault(key, value=None)[source]

Sets a default value for the given key.

create(name)[source]

Creates a new dcc_object with the given name.

from_asset_info_id(asset_info_id)[source]

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

static dictionary_from_object(object_name)[source]

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.

connect_objects(objects)[source]

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

objects List of DCC objects