Maya: Refactor Create Rig to new publisher

This commit is contained in:
Roy Nieterau 2023-01-27 00:46:22 +01:00
parent e57b7aaf17
commit fadf3a111a

View file

@ -1,25 +1,25 @@
from maya import cmds
from openpype.hosts.maya.api import (
lib,
plugin
)
from openpype.hosts.maya.api import plugin
class CreateRig(plugin.Creator):
class CreateRig(plugin.MayaCreator):
"""Artist-friendly rig with controls to direct motion"""
name = "rigDefault"
identifier = "io.openpype.creators.maya.rig"
label = "Rig"
family = "rig"
icon = "wheelchair"
def process(self):
def create(self, subset_name, instance_data, pre_create_data):
with lib.undo_chunk():
instance = super(CreateRig, self).process()
instance = super(CreateRig, self).create(subset_name,
instance_data,
pre_create_data)
self.log.info("Creating Rig instance set up ...")
controls = cmds.sets(name="controls_SET", empty=True)
pointcache = cmds.sets(name="out_SET", empty=True)
cmds.sets([controls, pointcache], forceElement=instance)
instance_node = instance.get("instance_node")
self.log.info("Creating Rig instance set up ...")
controls = cmds.sets(name="controls_SET", empty=True)
pointcache = cmds.sets(name="out_SET", empty=True)
cmds.sets([controls, pointcache], forceElement=instance_node)