From 61ebcee43cf0f611d9210cf9c8a91f73635d195b Mon Sep 17 00:00:00 2001 From: Milan Kolar Date: Fri, 12 Jul 2019 18:00:25 +0200 Subject: [PATCH] (hotfix) collect ftrack family --- .../maya/publish/collect_ftrack_family.py | 32 +++++++++++++++++++ pype/plugins/maya/publish/collect_model.py | 6 ---- 2 files changed, 32 insertions(+), 6 deletions(-) create mode 100644 pype/plugins/maya/publish/collect_ftrack_family.py diff --git a/pype/plugins/maya/publish/collect_ftrack_family.py b/pype/plugins/maya/publish/collect_ftrack_family.py new file mode 100644 index 0000000000..b339f2ef69 --- /dev/null +++ b/pype/plugins/maya/publish/collect_ftrack_family.py @@ -0,0 +1,32 @@ +import pyblish.api + + +class CollectFtrackFamilies(pyblish.api.InstancePlugin): + """Collect model data + + Ensures always only a single frame is extracted (current frame). + + Note: + This is a workaround so that the `pype.model` family can use the + same pointcache extractor implementation as animation and pointcaches. + This always enforces the "current" frame to be published. + + """ + + order = pyblish.api.CollectorOrder + 0.3 + label = 'Add ftrack family' + families = ["model", + "setdress", + "model", + "animation", + "workfile", + "look" + ] + + def process(self, instance): + + # make ftrack publishable + if instance.data.get('families'): + instance.data['families'].append('ftrack') + else: + instance.data['families'] = ['ftrack'] diff --git a/pype/plugins/maya/publish/collect_model.py b/pype/plugins/maya/publish/collect_model.py index 0fe5f29054..b412edf1e9 100644 --- a/pype/plugins/maya/publish/collect_model.py +++ b/pype/plugins/maya/publish/collect_model.py @@ -24,9 +24,3 @@ class CollectModelData(pyblish.api.InstancePlugin): frame = cmds.currentTime(query=True) instance.data['startFrame'] = frame instance.data['endFrame'] = frame - - # make ftrack publishable - if instance.data.get('families'): - instance.data['families'].append('ftrack') - else: - instance.data['families'] = ['ftrack']