diff --git a/openpype/hosts/maya/plugins/create/create_yeti_cache.py b/openpype/hosts/maya/plugins/create/create_yeti_cache.py index e8c3203f21..395aa62325 100644 --- a/openpype/hosts/maya/plugins/create/create_yeti_cache.py +++ b/openpype/hosts/maya/plugins/create/create_yeti_cache.py @@ -1,15 +1,14 @@ -from collections import OrderedDict - from openpype.hosts.maya.api import ( lib, plugin ) +from openpype.lib import NumberDef -class CreateYetiCache(plugin.Creator): +class CreateYetiCache(plugin.MayaCreator): """Output for procedural plugin nodes of Yeti """ - name = "yetiDefault" + identifier = "io.openpype.creators.maya.yeticache" label = "Yeti Cache" family = "yeticache" icon = "pagelines" @@ -17,14 +16,23 @@ class CreateYetiCache(plugin.Creator): def __init__(self, *args, **kwargs): super(CreateYetiCache, self).__init__(*args, **kwargs) - self.data["preroll"] = 0 + defs = [ + NumberDef("preroll", + label="Preroll", + minimum=0, + default=0, + decimals=0) + ] # Add animation data without step and handles - anim_data = lib.collect_animation_data() - anim_data.pop("step") - anim_data.pop("handleStart") - anim_data.pop("handleEnd") - self.data.update(anim_data) + defs.extend(lib.collect_animation_defs()) + remove = {"step", "handleStart", "handleEnd"} + defs = [attr_def for attr_def in defs if attr_def.key not in remove] - # Add samples - self.data["samples"] = 3 + # Add samples after frame range + defs.append( + NumberDef("samples", + label="Samples", + default=3, + decimals=0) + ) diff --git a/openpype/hosts/maya/plugins/create/create_yeti_rig.py b/openpype/hosts/maya/plugins/create/create_yeti_rig.py index 7abe2988cd..445bcf46d8 100644 --- a/openpype/hosts/maya/plugins/create/create_yeti_rig.py +++ b/openpype/hosts/maya/plugins/create/create_yeti_rig.py @@ -6,18 +6,22 @@ from openpype.hosts.maya.api import ( ) -class CreateYetiRig(plugin.Creator): +class CreateYetiRig(plugin.MayaCreator): """Output for procedural plugin nodes ( Yeti / XGen / etc)""" + identifier = "io.openpype.creators.maya.yetirig" label = "Yeti Rig" family = "yetiRig" icon = "usb" - def process(self): + def create(self, subset_name, instance_data, pre_create_data): with lib.undo_chunk(): - instance = super(CreateYetiRig, self).process() + instance = super(CreateYetiRig, self).create(subset_name, + instance_data, + pre_create_data) + instance_node = instance.get("instance_node") self.log.info("Creating Rig instance set up ...") input_meshes = cmds.sets(name="input_SET", empty=True) - cmds.sets(input_meshes, forceElement=instance) + cmds.sets(input_meshes, forceElement=instance_node)