ftrack_connect_pipeline.plugin¶
- class ftrack_connect_pipeline.plugin.BasePluginValidation(plugin_name, required_output, return_type, return_value)[source]¶
Bases:
object
Plugin Validation base class
- __init__(plugin_name, required_output, return_type, return_value)[source]¶
Initialise PluginValidation with plugin_name, required_output, return_type, return_value.
plugin_name : current plugin name.
required_output : required exporters of the current plugin.
return_type : required return type of the current plugin.
return_value : Expected return value of the current plugin.
- validate_required_output(result)[source]¶
Ensures that result contains all the expected
required_output
keys defined for the current plugin.result : exporters value of the plugin execution.
Return tuple (bool,str)
- validate_result_type(result)[source]¶
Ensures that result is instance of the defined
return_type
of the current plugin.result : exporters value of the plugin execution.
Return tuple (bool,str)
- class ftrack_connect_pipeline.plugin.BasePlugin(session)[source]¶
Bases:
object
Base Class to represent a Plugin
- plugin_type = None¶
Type of the plugin
- plugin_name = None¶
Name of the plugin
- type = 'base'¶
Type of the plugin default base. (action, collector…)
- category = 'plugin'¶
Category of the plugin (plugin, plugin.widget…)
- host_type = 'python'¶
Host type of the plugin
- return_type = None¶
Required return type
- return_value = None¶
Required return Value
- 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
- 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 selfasset_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
- 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 theFtrackObjectManager
- property asset_info¶
Returns the
asset_info
from theFtrackObjectManager
- property output¶
Returns a copy of
required_output
- property discover_topic¶
Return a formatted PIPELINE_DISCOVER_PLUGIN_TOPIC
- property run_topic¶
Return a formatted PIPELINE_RUN_PLUGIN_TOPIC
- property session¶
Returns instance of
ftrack_api.session.Session
- property event_manager¶
Returns instance of
EventManager
- property raw_data¶
Returns the current context id
- property plugin_settings¶
Returns the current plugin_settings
- property method¶
Returns the current method
- __init__(session)[source]¶
Initialise BasePlugin with instance of
ftrack_api.session.Session
- plugin_id = None¶
Id of the plugin
- register()[source]¶
Register function of the plugin to regiter it self.
Note
This function subscribes the plugin to two
ftrack_api.event.base.Event
topics:PIPELINE_DISCOVER_PLUGIN_TOPIC
: Topic to make the plugin discoverable for the host.PIPELINE_RUN_PLUGIN_TOPIC
: Topic to execute the plugin
- run(context_data=None, data=None, options=None)[source]¶
Runs the current plugin with , context_data , data and options.
context_data provides a mapping with the asset_name, context_id, asset_type_name, comment and status_id of the asset that we are working on.
data a list of data coming from previous collector or empty list
options a dictionary of options passed from outside.
Note
Use always self.exporters as a base to return the values, don’t override self.exporters as it contains the _required_output
- fetch(context_data=None, data=None, options=None)[source]¶
Runs the current plugin with , context_data , data and options.
context_data provides a mapping with the asset_name, context_id, asset_type_name, comment and status_id of the asset that we are working on.
data a list of data coming from previous collector or empty list
options a dictionary of options passed from outside.
Note
This function is meant to be ran as an alternative of the default run function. Usually to fetch information for the widget or to test the plugin.
- ftrack_connect_pipeline.plugin.asset_manager
- ftrack_connect_pipeline.plugin.base
- ftrack_connect_pipeline.plugin.base.action
- ftrack_connect_pipeline.plugin.base.collector
- ftrack_connect_pipeline.plugin.base.context
- ftrack_connect_pipeline.plugin.base.discover
- ftrack_connect_pipeline.plugin.base.finalizer
- ftrack_connect_pipeline.plugin.base.importer
- ftrack_connect_pipeline.plugin.base.exporter
- ftrack_connect_pipeline.plugin.base.post_import
- ftrack_connect_pipeline.plugin.base.validator
- ftrack_connect_pipeline.plugin.open
- ftrack_connect_pipeline.plugin.open.collector
- ftrack_connect_pipeline.plugin.open.context
- ftrack_connect_pipeline.plugin.open.finalizer
- ftrack_connect_pipeline.plugin.open.importer
OpenerImporterPlugin
OpenerImporterPlugin.return_type
OpenerImporterPlugin.plugin_type
OpenerImporterPlugin.open_modes
OpenerImporterPlugin.dependency_open_mode
OpenerImporterPlugin.json_data
OpenerImporterPlugin.__init__()
OpenerImporterPlugin.get_current_objects()
OpenerImporterPlugin.init_nodes()
OpenerImporterPlugin.open_asset()
OpenerImporterPlugin.init_and_open()
- ftrack_connect_pipeline.plugin.open.post_import
- ftrack_connect_pipeline.plugin.load
- ftrack_connect_pipeline.plugin.load.collector
- ftrack_connect_pipeline.plugin.load.context
- ftrack_connect_pipeline.plugin.load.finalizer
- ftrack_connect_pipeline.plugin.load.importer
LoaderImporterPlugin
LoaderImporterPlugin.return_type
LoaderImporterPlugin.plugin_type
LoaderImporterPlugin.load_modes
LoaderImporterPlugin.dependency_load_mode
LoaderImporterPlugin.json_data
LoaderImporterPlugin.__init__()
LoaderImporterPlugin.get_current_objects()
LoaderImporterPlugin.init_nodes()
LoaderImporterPlugin.load_asset()
LoaderImporterPlugin.init_and_load()
- ftrack_connect_pipeline.plugin.load.post_import
- ftrack_connect_pipeline.plugin.publish