ayon-core/pype/plugins/maya/publish/collect_model.py
2018-10-02 22:55:04 +02:00

26 lines
762 B
Python

from maya import cmds
import pyblish.api
class CollectModelData(pyblish.api.InstancePlugin):
"""Collect model data
Ensures always only a single frame is extracted (current frame).
Note:
This is a workaround so that the `studio.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.499
label = 'Collect Model Data'
families = ["studio.model"]
def process(self, instance):
# Extract only current frame (override)
frame = cmds.currentTime(query=True)
instance.data['startFrame'] = frame
instance.data['endFrame'] = frame