Esempio n. 1
0
    def ikSplineSolver(self, startJoint=None, endEffector=None, curve=None, side=None, name=None, suffix=None):
        ########################################################################
        # do the proper naming checks
        self.check_ik_name(startJoint=startJoint, endEffector=endEffector, side=side, name=name, suffix=suffix)

        # create the ik_handle
        if curve == None:
            ik = cmds.ik_handle(
                startJoint=startJoint,
                endEffector=endEffector,
                createCurve=True,
                name=self.ik_name,
                solver="ikSplineSolver",
            )
        else:
            if cmds.objExists(curve):
                ik = cmds.ik_handle(
                    startJoint=startJoint,
                    endEffector=endEffector,
                    curve=curve,
                    createCurve=False,
                    name=self.ik_name,
                    solver="ikSplineSolver",
                )
            else:
                raise Exception("There is no specified curve: " + curve)

        # rename the effector
        eff = cmds.rename(ik[1], ik[0] + "EFF")

        # store the ik_handle and effector in a list to return
        if curve == None:
            # rename the automated curve
            crv = cmds.rename(ik[-1], ik[0] + "CRV")
            ik_handle = [ik[0], eff, crv]
        else:
            ik_handle = [ik[0], eff, curve]

        cmds.select(clear=1)
        return ik_handle
Esempio n. 2
0
    def ikSCsolver(self, startJoint=None, endEffector=None, side=None, name=None, suffix=None):
        ########################################################################
        # do the proper naming checks
        self.check_ik_name(startJoint=startJoint, endEffector=endEffector, side=side, name=name, suffix=suffix)

        # create the ik_handle
        ik = cmds.ik_handle(startJoint=startJoint, endEffector=endEffector, name=self.ik_name, solver="ikSCsolver")

        # rename the effector
        eff = cmds.rename(ik[-1], ik[0] + "EFF")

        # store the ik_handle and effector in a list to return
        ik_handle = [ik[0], eff]

        cmds.select(clear=1)
        return ik_handle