make ftrack integrators more robust and flexible

This commit is contained in:
Milan Kolar 2019-05-22 00:13:29 +02:00
parent 111b316866
commit 693ad2ab42
3 changed files with 5 additions and 4 deletions

View file

@ -24,6 +24,7 @@ class CollectFtrackApi(pyblish.api.ContextPlugin):
project = os.environ.get('AVALON_PROJECT', '')
asset = os.environ.get('AVALON_ASSET', '')
task = os.environ.get('AVALON_TASK', None)
self.log.debug(task)
if task:
result = session.query('Task where\

View file

@ -58,7 +58,7 @@ class IntegrateFtrackApi(pyblish.api.InstancePlugin):
session = instance.context.data["ftrackSession"]
if instance.context.data.get("ftrackTask"):
task = instance.context.data["ftrackTask"]
name = task['full_name']
name = task
parent = task["parent"]
elif instance.context.data.get("ftrackEntity"):
task = None

View file

@ -60,7 +60,7 @@ class IntegrateFtrackInstance(pyblish.api.InstancePlugin):
if not comp.get('startFrameReview'):
comp['startFrameReview'] = comp['startFrame']
if not comp.get('endFrameReview'):
comp['endFrameReview'] = instance.data['endFrame']
comp['endFrameReview'] = comp['endFrame']
location = ft_session.query(
'Location where name is "ftrack.server"').one()
component_data = {
@ -69,11 +69,11 @@ class IntegrateFtrackInstance(pyblish.api.InstancePlugin):
"metadata": {'ftr_meta': json.dumps({
'frameIn': int(comp['startFrameReview']),
'frameOut': int(comp['endFrameReview']),
'frameRate': float(comp['frameRate')]})}
'frameRate': comp['frameRate']})}
}
else:
component_data = {
"name": comp['representation'] # Default component name is "main".
"name": comp['name']
}
location = ft_session.query(
'Location where name is "ftrack.unmanaged"').one()