Skip to content

collect_rig_sets

CollectRigSets

Bases: MayaInstancePlugin

Ensure rig contains pipeline-critical content

Every rig must contain at least two object sets

"controls_SET" - Set of all animatable controls "out_SET" - Set of all cacheable meshes

Source code in client/ayon_maya/plugins/publish/collect_rig_sets.py
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
class CollectRigSets(plugin.MayaInstancePlugin):
    """Ensure rig contains pipeline-critical content

    Every rig must contain at least two object sets:
        "controls_SET" - Set of all animatable controls
        "out_SET" - Set of all cacheable meshes

    """

    order = pyblish.api.CollectorOrder + 0.05
    label = "Collect Rig Sets"
    families = ["rig"]

    accepted_output = ["mesh", "transform"]
    accepted_controllers = ["transform"]

    def process(self, instance):

        # Find required sets by suffix
        searching = {"controls_SET", "out_SET",
                     "skeletonAnim_SET", "skeletonMesh_SET"}
        found = {}
        for node in cmds.ls(instance, exactType="objectSet"):
            for suffix in searching:
                if node.endswith(suffix):
                    found[suffix] = node
                    searching.remove(suffix)
                    break
            if not searching:
                break

        self.log.debug("Found sets: {}".format(found))
        rig_sets = instance.data.setdefault("rig_sets", {})
        for name, objset in found.items():
            rig_sets[name] = objset