Пример #1
0
 def create_outputs(self):
     rig_lib.create_output(name="{0}_head_OUTPUT".format(
         self.model.module_name),
                           parent=self.created_skn_jnts[0])
     rig_lib.create_output(name="{0}_jaw_OUTPUT".format(
         self.model.module_name),
                           parent=self.created_skn_jnts[2])
Пример #2
0
    def create_outputs(self):
        rig_lib.create_output(name="{0}_pelvis_OUTPUT".format(self.model.module_name), parent=self.created_pelvis_jnt)
        rig_lib.create_output(name="{0}_start_OUTPUT".format(self.model.module_name), parent=self.created_locs[0])
        rig_lib.create_output(name="{0}_end_OUTPUT".format(self.model.module_name), parent=self.created_spine_jnts[-1])

        for i, jnt in enumerate(self.created_spine_jnts):
            if jnt != self.created_spine_jnts[-1]:
                name = "{0}_jnt_{1}_OUTPUT".format(self.model.module_name, i)
                rig_lib.create_output(name=name, parent=jnt)
Пример #3
0
    def execute(self):
        self.prebuild()

        self.delete_existing_objects()
        self.connect_to_parent()

        cog_shape = rig_lib.large_box_curve("{0}_CTRL_shape".format(self.model.module_name))
        cog_ctrl = rig_lib.create_jnttype_ctrl(name="{0}_CTRL".format(self.model.module_name), shape=cog_shape,
                                               drawstyle=2)
        cog_ofs = pmc.group(cog_ctrl, n="{0}_ctrl_OFS".format(self.model.module_name))
        cog_ofs.setAttr("translate", pmc.xform(self.guide, q=1, ws=1, translation=1))
        pmc.parent(cog_ofs, self.ctrl_input_grp)

        rig_lib.create_output(name="{0}_OUTPUT".format(self.model.module_name), parent=cog_ctrl)

        rig_lib.clean_ctrl(cog_ctrl, 20, trs="s")

        self.jnt_input_grp.setAttr("visibility", 0)
        self.parts_grp.setAttr("visibility", 0)
        self.guides_grp.setAttr("visibility", 0)

        info_crv = rig_lib.signature_shape_curve("{0}_INFO".format(self.model.module_name))
        info_crv.getShape().setAttr("visibility", 0)
        info_crv.setAttr("hiddenInOutliner", 1)
        info_crv.setAttr("translateX", lock=True, keyable=False, channelBox=False)
        info_crv.setAttr("translateY", lock=True, keyable=False, channelBox=False)
        info_crv.setAttr("translateZ", lock=True, keyable=False, channelBox=False)
        info_crv.setAttr("rotateX", lock=True, keyable=False, channelBox=False)
        info_crv.setAttr("rotateY", lock=True, keyable=False, channelBox=False)
        info_crv.setAttr("rotateZ", lock=True, keyable=False, channelBox=False)
        info_crv.setAttr("scaleX", lock=True, keyable=False, channelBox=False)
        info_crv.setAttr("scaleY", lock=True, keyable=False, channelBox=False)
        info_crv.setAttr("scaleZ", lock=True, keyable=False, channelBox=False)
        info_crv.setAttr("visibility", lock=True, keyable=False, channelBox=False)
        info_crv.setAttr("overrideEnabled", 1)
        info_crv.setAttr("overrideDisplayType", 2)
        pmc.parent(info_crv, self.parts_grp)

        rig_lib.add_parameter_as_extra_attr(info_crv, "Module", "cog")
        rig_lib.add_parameter_as_extra_attr(info_crv, "parent_Module", self.model.selected_module)
        rig_lib.add_parameter_as_extra_attr(info_crv, "parent_output", self.model.selected_output)

        pmc.select(cl=1)
Пример #4
0
 def create_outputs(self):
     for i, jnt in enumerate(self.all_spine_jnt):
         name = "{0}_jnt_{1}_OUTPUT".format(self.model.module_name, i)
         rig_lib.create_output(name=name, parent=jnt)
Пример #5
0
    def execute(self):
        self.prebuild()
        check_list = [
            "{0}_RIG".format(self.model.character_name), "GEO_GRP", "CTRL_GRP",
            "JNT_GRP", "MESH_GRP", "PARTS_GRP", "global_CTRL",
            "{0}_global_OUTPUT".format(self.model.module_name),
            "{0}_local_INPUT".format(self.model.module_name),
            "{0}_local_ctrl_OFS".format(self.model.module_name),
            "{0}_local_CTRL".format(self.model.module_name),
            "{0}_local_ctrl_OUTPUT".format(self.model.module_name),
            "{0}_global_scale_MDL".format(self.model.module_name)
        ]
        if rig_lib.exists_check(check_list):
            pmc.select(cl=1)
            return

        if rig_lib.exists_check("{0}_RIG".format(self.model.character_name)):
            pmc.delete("{0}_RIG".format(self.model.character_name))

        main_grp = pmc.group(em=1,
                             n="{0}_RIG".format(self.model.character_name))
        geo_grp = pmc.group(em=1, n="GEO_GRP")
        ctrl_grp = pmc.group(em=1, n="CTRL_GRP")
        jnt_grp = pmc.group(em=1, n="JNT_GRP")
        mesh_grp = pmc.group(em=1, n="MESH_GRP")
        parts_grp = pmc.group(em=1, n="PARTS_GRP")
        global_shape = rig_lib.square_arrow_curve(
            "{0}_global_CTRL_shape".format(self.model.module_name))
        global_ctrl = rig_lib.create_jnttype_ctrl(name="global_CTRL",
                                                  shape=global_shape,
                                                  drawstyle=2)
        global_output = pmc.spaceLocator(p=(0, 0, 0),
                                         n="{0}_global_OUTPUT".format(
                                             self.model.module_name))
        global_output.visibility.set(0)

        pmc.parent(geo_grp, ctrl_grp, jnt_grp, mesh_grp, parts_grp,
                   global_ctrl, main_grp)
        pmc.parent(global_output, global_ctrl, r=1)
        local_input = pmc.group(em=1,
                                n="{0}_local_ctrl_INPUT".format(
                                    self.model.module_name))
        pmc.parent(local_input, ctrl_grp, r=1)

        rig_lib.matrix_constraint(global_output, local_input, srt="trs")

        local_shape = pmc.circle(c=(0, 0, 0),
                                 nr=(0, 1, 0),
                                 sw=360,
                                 r=5,
                                 d=3,
                                 s=8,
                                 n="{0}_local_CTRL_shape".format(
                                     self.model.module_name),
                                 ch=0)[0]
        local_ctrl = rig_lib.create_jnttype_ctrl(name="{0}_local_CTRL".format(
            self.model.module_name),
                                                 shape=local_shape,
                                                 drawstyle=2)
        pmc.parent(local_ctrl, local_input, r=1)

        rig_lib.create_output(name="{0}_local_ctrl_OUTPUT".format(
            self.model.module_name),
                              parent=local_ctrl)

        global_scale_mult_node = pmc.createNode(
            "multDoubleLinear",
            n="{0}_global_mult_local_scale_MDL".format(self.model.module_name))

        global_ctrl.scaleY >> global_ctrl.scaleX
        global_ctrl.scaleY >> global_ctrl.scaleZ
        local_ctrl.scaleY >> local_ctrl.scaleX
        local_ctrl.scaleY >> local_ctrl.scaleZ
        global_ctrl.scaleY >> global_scale_mult_node.input1
        local_ctrl.scaleY >> global_scale_mult_node.input2
        pmc.aliasAttr("global_scale", global_ctrl.scaleY)
        pmc.aliasAttr("local_scale", local_ctrl.scaleY)

        global_ctrl.setAttr("scaleX",
                            lock=True,
                            keyable=False,
                            channelBox=False)
        global_ctrl.setAttr("scaleY", keyable=False, channelBox=True)
        global_ctrl.setAttr("scaleZ",
                            lock=True,
                            keyable=False,
                            channelBox=False)
        local_ctrl.setAttr("scaleX",
                           lock=True,
                           keyable=False,
                           channelBox=False)
        local_ctrl.setAttr("scaleY", keyable=False, channelBox=True)
        local_ctrl.setAttr("scaleZ",
                           lock=True,
                           keyable=False,
                           channelBox=False)

        rig_lib.clean_ctrl(global_ctrl, 3, trs="")
        rig_lib.clean_ctrl(local_ctrl, 17, trs="")

        info_crv = rig_lib.signature_shape_curve("{0}_INFO".format(
            self.model.module_name))
        info_crv.getShape().setAttr("visibility", 0)
        info_crv.setAttr("hiddenInOutliner", 1)
        info_crv.setAttr("translateX",
                         lock=True,
                         keyable=False,
                         channelBox=False)
        info_crv.setAttr("translateY",
                         lock=True,
                         keyable=False,
                         channelBox=False)
        info_crv.setAttr("translateZ",
                         lock=True,
                         keyable=False,
                         channelBox=False)
        info_crv.setAttr("rotateX", lock=True, keyable=False, channelBox=False)
        info_crv.setAttr("rotateY", lock=True, keyable=False, channelBox=False)
        info_crv.setAttr("rotateZ", lock=True, keyable=False, channelBox=False)
        info_crv.setAttr("scaleX", lock=True, keyable=False, channelBox=False)
        info_crv.setAttr("scaleY", lock=True, keyable=False, channelBox=False)
        info_crv.setAttr("scaleZ", lock=True, keyable=False, channelBox=False)
        info_crv.setAttr("visibility",
                         lock=True,
                         keyable=False,
                         channelBox=False)
        info_crv.setAttr("overrideEnabled", 1)
        info_crv.setAttr("overrideDisplayType", 2)
        pmc.parent(info_crv, parts_grp)

        rig_lib.add_parameter_as_extra_attr(info_crv, "Module",
                                            "mandatory_base")
        rig_lib.add_parameter_as_extra_attr(info_crv, "character_name",
                                            self.model.character_name)

        pmc.select(cl=1)