Example #1
0
        def addCurveBtn():
            sl = utility.checkSelection([('nurbsCurve', 1, 1)])
            if sl:
                functions.saveCurve(sl[0])
                button_list = cmds.shelfLayout(shelf, q=1, childArray=1)[1:]
                #print(button_list)
                for btn in button_list:
                    cmds.deleteUI(btn)

                listAllCurve()
Example #2
0
    def _groupIt(self, *args):
        sl = utility.checkSelection([('any', 1, 0)])
        if sl:
            if utility.detectConnect(sl):
                makeChoice(
                    "Warning",
                    "Detected that transformation has connections, break them will change behavior, keep them may cause object shifting, so what's your choice?",
                    "Break them", "Keep them", partial(functions.groupIt, sl,
                                                       1),
                    partial(functions.groupIt, sl, 0))

            else:
                functions.groupIt(sl, 1)
Example #3
0
    def _setWorldUp(self, *args):
        sl = utility.checkSelection([('any', 1, 0)])
        if sl:
            upSelected = cmds.radioButtonGrp("rbgUp", q=True, sl=True)
            upReverse = cmds.checkBox("chbReverseUp", q=True, v=True)
            upAxis = [0, 0, 0]
            if upReverse == 1:
                upAxis[upSelected - 1] = -1
            else:
                upAxis[upSelected - 1] = 1

            objVector = utility.getVector(sl[0], upAxis)
            cmds.floatFieldGrp("rbgWorldUp", e=1, v1=objVector[0])
            cmds.floatFieldGrp("rbgWorldUp", e=1, v2=objVector[1])
            cmds.floatFieldGrp("rbgWorldUp", e=1, v3=objVector[2])
            cmds.select(sl, r=True)
Example #4
0
    def _orientJointsUI(self, *args):
        sl = utility.checkSelection([('joint', 1, 0)])
        if sl:
            aimSelected = cmds.radioButtonGrp("rbgAim", q=True, sl=True)
            upSelected = cmds.radioButtonGrp("rbgUp", q=True, sl=True)

            upReverse = cmds.checkBox("chbReverseUp", q=True, v=True)

            worldUp = [0, 0, 0]
            worldUp[0] = cmds.floatFieldGrp("rbgWorldUp", q=True, v1=True)
            worldUp[1] = cmds.floatFieldGrp("rbgWorldUp", q=True, v2=True)
            worldUp[2] = cmds.floatFieldGrp("rbgWorldUp", q=True, v3=True)

            operateOn = cmds.checkBox("chbAllOrSelected", q=True, v=True)
            guessUp = cmds.checkBox("chbGuess", q=True, v=True)

            aimAxis = [0, 0, 0]
            upAxis = [0, 0, 0]

            aimAxis[aimSelected - 1] = 1

            if upReverse == 1:
                upAxis[upSelected - 1] = -1
            else:
                upAxis[upSelected - 1] = 1

            if operateOn == 1:
                # Hierarchy
                cmds.select(hi=True)
                jointsToOrient = cmds.ls(typ="joint", sl=1)
            else:
                # Selected
                jointsToOrient = cmds.ls(typ="joint", sl=1)
            # print(jointsToOrient)

            functions.orientJoint(jointsToOrient, aimAxis, upAxis, worldUp,
                                  guessUp)
            functions.rotateOrder(jointsToOrient, aimAxis, upAxis)
Example #5
0
 def _hideSelectedLocalAxis(self, *args):
     sl = utility.checkSelection([('any', 1, 0)])
     if sl: functions.doToggleLocalAxis(sl, 0)
Example #6
0
 def _autoSplineFKIK(self, *args):
     sl = utility.checkSelection([('joint', 2, 2), ('any', 1, 1)])
     if sl: autoRig.autoSplineFKIK(sl[0], sl[1], sl[2])
Example #7
0
 def _snapPivot(self, *args):
     sl = utility.checkSelection([('any', 2, 0)])
     if sl: functions.snapPivot(sl[0], sl[1])
Example #8
0
 def _spaceSwitchSetup(self, *args):
     sl = utility.checkSelection([('any', 2, 0)])
     if sl: functions.spaceSwitchSetup(sl[0:-1], sl[-1])
Example #9
0
 def _mergeCurves(self, *args):
     sl = utility.checkSelection([('nurbsCurve', 2, 0)])
     if sl: functions.mergeCurves(sl)
Example #10
0
 def _replaceCurves(self, *args):
     sl = utility.checkSelection([('nurbsCurve', 2, 2)])
     if sl: functions.replaceCurves(sl[0], sl[1])
Example #11
0
 def _zeroAll(self, *args):
     sl = utility.checkSelection([('any', 1, 0)])
     if sl: functions.zeroAll(sl)