Esempio n. 1
0
    def rigAll(self):
        neck, neckMiddle, head, eyeL, eyeR, eyeAimPiv = self.HeadInitCtlData.getSortList(
        )

        aimObject = rigbase.makeAimObject(head,
                                          neck,
                                          axis=1,
                                          replaceTarget='InitCTL',
                                          replace='InitCtl')[0]
        aimObject = cmds.rename(aimObject,
                                aimObject.replace('AimObj', 'AimGrp'))

        rigbase.betweenRigInAimObject(neckMiddle,
                                      aimObject,
                                      replaceTarget='InitCTL',
                                      replace='InitCtl')
        rigbase.AttrEdit(neckMiddle).lockAttrs('tx')

        aimObjectNeck = rigbase.makeAimObject(neckMiddle,
                                              neck,
                                              axis=1,
                                              replaceTarget='InitCTL',
                                              replace='InitCtl')[0]
        aimObjectNeckMiddle = rigbase.makeAimObject(head,
                                                    neckMiddle,
                                                    axis=1,
                                                    replaceTarget='InitCTL',
                                                    replace='InitCtl')[0]

        cmds.parent(eyeL, eyeR, eyeAimPiv, head)

        self.outputTransform = [neck, neckMiddle, head, eyeL, eyeR, eyeAimPiv]
Esempio n. 2
0
 def rigSelf(self):
     root, waist, chest = self.torsoInitCtlData.getSortList()[:3]
     aimObject = rigbase.makeAimObject( chest, root, axis=1, replaceTarget = 'InitCTL', replace='InitCtl' )[0]
     
     rigbase.betweenRigInAimObject( waist, aimObject, replaceTarget='InitCTL', replace='InitCtl' )
     
     rigbase.AttrEdit( root, waist, chest ).lockAttrs( 'r', 's', 'tx' )
     
     self.outputTransform = [ root, waist, chest ]
Esempio n. 3
0
 def rigSide(self, side ):
     inverseAim = False
     inverseUp = False
     globalMult = 1
     if side.find( 'R' ) != -1:
         inverseAim = True
         inverseUp = True
         globalMult = -1
         
     shoulder, elbow, wrist, poleV = self.armInitCtlData.getSortList( side )
     upperArm, lowerArm  = self.armInitCtlAdd.getSortList( side )
     
     aimObjectOptions = { 'axis':0, 'upAxis':2, 'inverseAim':inverseAim, 'inverseUp':inverseUp, 'upType':'object', 'upObject':poleV, 'replaceTarget':'InitCTL', 'replace':'InitCtl' }
     
     aimObject, wristPoseMltDcmp = rigbase.makeAimObject( wrist, shoulder, **aimObjectOptions )
     aimObject = cmds.rename( aimObject, aimObject.replace( 'AimObj', 'AimGrp' ) )
     
     rigbase.betweenRigInAimObject( elbow, aimObject, dcmp = wristPoseMltDcmp, replaceTarget='InitCTL', replace='InitCtl', globalMult = globalMult )
     rigbase.AttrEdit( elbow ).lockAttrs( 'ty' )
     
     aimObjectElbow = rigbase.makeAimObject( wrist, elbow, **aimObjectOptions )[0]
     aimObjectShoulder = rigbase.makeAimObject( elbow, shoulder, **aimObjectOptions )[0]
     
     cmds.parent( upperArm, aimObjectShoulder )
     cmds.parent( lowerArm, aimObjectElbow )
     
     upperArmGrp = rigbase.addParent( upperArm )
     lowerArmGrp = rigbase.addParent( lowerArm )
     
     upperMtxDcmp = rigbase.getChildMtxDcmp( elbow, aimObjectShoulder )
     lowerMtxDcmp = rigbase.getChildMtxDcmp( wrist, aimObjectElbow )
     upperMultMiddle = cmds.createNode( 'multiplyDivide', n=upperArm.replace( 'InitCTL', 'InitCtlMiddleMult' ) )
     lowerMultMiddle = cmds.createNode( 'multiplyDivide', n=lowerArm.replace( 'InitCTL', 'InitCtlMiddleMult' ) )
     
     cmds.connectAttr( upperMtxDcmp+'.ot', upperMultMiddle+'.input1' )
     cmds.connectAttr( lowerMtxDcmp+'.ot', lowerMultMiddle+'.input1' )
     
     cmds.setAttr( upperMultMiddle+'.input2', .5,.5,.5 )
     cmds.setAttr( lowerMultMiddle+'.input2', .5,.5,.5 )
     
     cmds.connectAttr( upperMultMiddle+'.output', upperArmGrp+'.t' )
     cmds.connectAttr( lowerMultMiddle+'.output', lowerArmGrp+'.t' )
     
     cmds.setAttr( upperArmGrp+'.r', 0,0,0 )
     cmds.setAttr( lowerArmGrp+'.r', 0,0,0 )
     
     if side.find( 'L' ) != -1:
         self.outputTransformL = [ aimObjectShoulder, aimObjectElbow, wrist, poleV ]
         self.outputAddTrL = [ upperArm, lowerArm ]
         cmds.transformLimits( elbow, tz= [-1,0.01], etz=[False, True] )
     else:
         self.outputTransformR = [ aimObjectShoulder, aimObjectElbow, wrist, poleV ]
         self.outputAddTrR = [ upperArm, lowerArm ]
         cmds.transformLimits( elbow, tz= [0.01,1], etz=[True, False] )
Esempio n. 4
0
 def rigLegPart(self, side ):
     inverseAim = False
     inverseUp = True
     globalMult = 1
     if side.find( 'R' ) != -1:
         inverseAim= True
         inverseUp = False
         globalMult = -1
         
     hip, knee, ankle, poleV = self.legInitCtlData.getSortList( side )[:4]
     upperLeg, lowerLeg      = self.legInitCtlAdd.getSortList( side )
     
     aimObjectOptions = { 'axis':0, 'upAxis':2, 'inverseAim':inverseAim, 'inverseUp':inverseUp, 'upType':'object', 'upObject':poleV, 'replaceTarget':'InitCTL', 'replace':'InitCtl' }
     
     aimObject, anklePoseMltDcmp = rigbase.makeAimObject( ankle, hip, **aimObjectOptions )
     aimObject = cmds.rename( aimObject, aimObject.replace( 'AimObj', 'AimGrp' ) )
     
     rigbase.betweenRigInAimObject( knee, aimObject, dcmp = anklePoseMltDcmp, replaceTarget='InitCTL', replace='InitCtl', globalMult = globalMult )
     rigbase.AttrEdit( knee ).lockAttrs( 'ty' )
     
     aimObjectKnee = rigbase.makeAimObject( ankle, knee, **aimObjectOptions )[0]
     aimObjectHip = rigbase.makeAimObject( knee, hip, **aimObjectOptions )[0]
     
     cmds.parent( upperLeg, aimObjectHip )
     cmds.parent( lowerLeg, aimObjectKnee )
     
     upperLegGrp = rigbase.addParent( upperLeg )
     lowerLegGrp = rigbase.addParent( lowerLeg )
     
     upperMtxDcmp = rigbase.getChildMtxDcmp( knee, aimObjectHip )
     lowerMtxDcmp = rigbase.getChildMtxDcmp( ankle, aimObjectKnee )
     upperMultMiddle = cmds.createNode( 'multiplyDivide', n=upperLeg.replace( 'InitCTL', 'InitCtlMiddleMult' ) )
     lowerMultMiddle = cmds.createNode( 'multiplyDivide', n=lowerLeg.replace( 'InitCTL', 'InitCtlMiddleMult' ) )
     
     cmds.connectAttr( upperMtxDcmp+'.ot', upperMultMiddle+'.input1' )
     cmds.connectAttr( lowerMtxDcmp+'.ot', lowerMultMiddle+'.input1' )
     
     cmds.setAttr( upperMultMiddle+'.input2', .5,.5,.5 )
     cmds.setAttr( lowerMultMiddle+'.input2', .5,.5,.5 )
     
     cmds.connectAttr( upperMultMiddle+'.output', upperLegGrp+'.t' )
     cmds.connectAttr( lowerMultMiddle+'.output', lowerLegGrp+'.t' )
     
     cmds.setAttr( upperLegGrp+'.r', 0,0,0 )
     cmds.setAttr( lowerLegGrp+'.r', 0,0,0 )
     
     if side.find( 'L' ) != -1:
         self.outputTransformL = [ aimObjectHip, aimObjectKnee, ankle, poleV ]
         self.outputAddTrL = [ upperLeg, lowerLeg ]
         cmds.transformLimits( knee, tz= [0.01,1], etz=[True, False] )
     else:
         self.outputTransformR = [ aimObjectHip, aimObjectKnee, ankle, poleV ]
         self.outputAddTrR = [ upperLeg, lowerLeg ]
         cmds.transformLimits( knee, tz= [-1,0.01], etz=[False, True] )
Esempio n. 5
0
 def rigAll(self):
     neck, neckMiddle, head, eyeL, eyeR, eyeAimPiv = self.HeadInitCtlData.getSortList()
     
     aimObject= rigbase.makeAimObject( head, neck, axis=1, replaceTarget = 'InitCTL', replace='InitCtl' )[0]
     aimObject = cmds.rename( aimObject, aimObject.replace( 'AimObj', 'AimGrp' ) )
     
     rigbase.betweenRigInAimObject( neckMiddle, aimObject, replaceTarget='InitCTL', replace='InitCtl' )
     rigbase.AttrEdit( neckMiddle ).lockAttrs( 'tx' )
     
     aimObjectNeck = rigbase.makeAimObject( neckMiddle, neck, axis=1, replaceTarget = 'InitCTL', replace='InitCtl' )[0]
     aimObjectNeckMiddle = rigbase.makeAimObject( head, neckMiddle, axis=1, replaceTarget = 'InitCTL', replace='InitCtl' )[0]
     
     cmds.parent( eyeL, eyeR, eyeAimPiv, head )
     
     self.outputTransform = [ neck, neckMiddle, head, eyeL, eyeR, eyeAimPiv ]
Esempio n. 6
0
    def rigSelf(self):
        root, waist, chest = self.torsoInitCtlData.getSortList()[:3]
        aimObject = rigbase.makeAimObject(chest,
                                          root,
                                          axis=1,
                                          replaceTarget='InitCTL',
                                          replace='InitCtl')[0]

        rigbase.betweenRigInAimObject(waist,
                                      aimObject,
                                      replaceTarget='InitCTL',
                                      replace='InitCtl')

        rigbase.AttrEdit(root, waist, chest).lockAttrs('r', 's', 'tx')

        self.outputTransform = [root, waist, chest]
Esempio n. 7
0
 def rigEachPart( self, index, side ):
     outputTransform = []
     
     inverseAim = False
     globalMult = 1
     if side.find( 'R' ) != -1:
         inverseAim = True
         globalMult = -1
         
     aimObjectOptions = { 'axis':0, 'inverseAim':inverseAim, 'replaceTarget':'InitCTL', 'replace':'InitCtl' }
     
     fingerInitCtlNameList = self.fingerInitCtlData.getEachFingerList( index, side )
     
     firstFingerInitCtl = fingerInitCtlNameList[0]
     secondFingerInitCtl = fingerInitCtlNameList[1]
     betweenFingerInitCtls = fingerInitCtlNameList[2:-1]
     endFingerInitCtl = fingerInitCtlNameList[-1]
     
     aimObject0= rigbase.makeAimObject( secondFingerInitCtl, firstFingerInitCtl, **aimObjectOptions )[0]
     outputTransform.append( aimObject0 )
     aimObject1 = rigbase.makeAimObject( endFingerInitCtl, secondFingerInitCtl, **aimObjectOptions )[0]
     aimObject1 = cmds.rename( aimObject1, aimObject1.replace( 'AimObj', 'AimGrp' ) )
     
     rigbase.betweenRigInAimObject( betweenFingerInitCtls, aimObject1, replaceTarget='InitCTL', replace='InitCtl', globalMult = globalMult )
     
     for fingerInitCtl in betweenFingerInitCtls:
         rigbase.AttrEdit( fingerInitCtl ).lockAttrs( 'tz' )
         if side.find( 'L' ) != -1:
             cmds.transformLimits( fingerInitCtl, ty= [0.01,1], ety=[True, False] )
         else:
             cmds.transformLimits( fingerInitCtl, ty= [-1,0.01], ety=[False, True] )
     betweenFingerInitCtls.append( endFingerInitCtl )
         
     aimObjectParent = secondFingerInitCtl
     for fingerInitCtl in betweenFingerInitCtls:
         aimObject = rigbase.makeAimObject( fingerInitCtl, aimObjectParent, **aimObjectOptions )[0]
         aimObjectParent = fingerInitCtl
         outputTransform.append( aimObject )
     
     outputTransform.append( endFingerInitCtl )
     return outputTransform
Esempio n. 8
0
    def rigEachPart(self, index, side):
        outputTransform = []

        inverseAim = False
        globalMult = 1
        if side.find('R') != -1:
            inverseAim = True
            globalMult = -1

        aimObjectOptions = {
            'axis': 0,
            'inverseAim': inverseAim,
            'replaceTarget': 'InitCTL',
            'replace': 'InitCtl'
        }

        fingerInitCtlNameList = self.fingerInitCtlData.getEachFingerList(
            index, side)

        firstFingerInitCtl = fingerInitCtlNameList[0]
        secondFingerInitCtl = fingerInitCtlNameList[1]
        betweenFingerInitCtls = fingerInitCtlNameList[2:-1]
        endFingerInitCtl = fingerInitCtlNameList[-1]

        aimObject0 = rigbase.makeAimObject(secondFingerInitCtl,
                                           firstFingerInitCtl,
                                           **aimObjectOptions)[0]
        outputTransform.append(aimObject0)
        aimObject1 = rigbase.makeAimObject(endFingerInitCtl,
                                           secondFingerInitCtl,
                                           **aimObjectOptions)[0]
        aimObject1 = cmds.rename(aimObject1,
                                 aimObject1.replace('AimObj', 'AimGrp'))

        rigbase.betweenRigInAimObject(betweenFingerInitCtls,
                                      aimObject1,
                                      replaceTarget='InitCTL',
                                      replace='InitCtl',
                                      globalMult=globalMult)

        for fingerInitCtl in betweenFingerInitCtls:
            rigbase.AttrEdit(fingerInitCtl).lockAttrs('tz')
            if side.find('L') != -1:
                cmds.transformLimits(fingerInitCtl,
                                     ty=[0.01, 1],
                                     ety=[True, False])
            else:
                cmds.transformLimits(fingerInitCtl,
                                     ty=[-1, 0.01],
                                     ety=[False, True])
        betweenFingerInitCtls.append(endFingerInitCtl)

        aimObjectParent = secondFingerInitCtl
        for fingerInitCtl in betweenFingerInitCtls:
            aimObject = rigbase.makeAimObject(fingerInitCtl, aimObjectParent,
                                              **aimObjectOptions)[0]
            aimObjectParent = fingerInitCtl
            outputTransform.append(aimObject)

        outputTransform.append(endFingerInitCtl)
        return outputTransform
Esempio n. 9
0
    def rigLegPart(self, side):
        inverseAim = False
        inverseUp = True
        globalMult = 1
        if side.find('R') != -1:
            inverseAim = True
            inverseUp = False
            globalMult = -1

        hip, knee, ankle, poleV = self.legInitCtlData.getSortList(side)[:4]
        upperLeg, lowerLeg = self.legInitCtlAdd.getSortList(side)

        aimObjectOptions = {
            'axis': 0,
            'upAxis': 2,
            'inverseAim': inverseAim,
            'inverseUp': inverseUp,
            'upType': 'object',
            'upObject': poleV,
            'replaceTarget': 'InitCTL',
            'replace': 'InitCtl'
        }

        aimObject, anklePoseMltDcmp = rigbase.makeAimObject(
            ankle, hip, **aimObjectOptions)
        aimObject = cmds.rename(aimObject,
                                aimObject.replace('AimObj', 'AimGrp'))

        rigbase.betweenRigInAimObject(knee,
                                      aimObject,
                                      dcmp=anklePoseMltDcmp,
                                      replaceTarget='InitCTL',
                                      replace='InitCtl',
                                      globalMult=globalMult)
        rigbase.AttrEdit(knee).lockAttrs('ty')

        aimObjectKnee = rigbase.makeAimObject(ankle, knee,
                                              **aimObjectOptions)[0]
        aimObjectHip = rigbase.makeAimObject(knee, hip, **aimObjectOptions)[0]

        cmds.parent(upperLeg, aimObjectHip)
        cmds.parent(lowerLeg, aimObjectKnee)

        upperLegGrp = rigbase.addParent(upperLeg)
        lowerLegGrp = rigbase.addParent(lowerLeg)

        upperMtxDcmp = rigbase.getChildMtxDcmp(knee, aimObjectHip)
        lowerMtxDcmp = rigbase.getChildMtxDcmp(ankle, aimObjectKnee)
        upperMultMiddle = cmds.createNode('multiplyDivide',
                                          n=upperLeg.replace(
                                              'InitCTL', 'InitCtlMiddleMult'))
        lowerMultMiddle = cmds.createNode('multiplyDivide',
                                          n=lowerLeg.replace(
                                              'InitCTL', 'InitCtlMiddleMult'))

        cmds.connectAttr(upperMtxDcmp + '.ot', upperMultMiddle + '.input1')
        cmds.connectAttr(lowerMtxDcmp + '.ot', lowerMultMiddle + '.input1')

        cmds.setAttr(upperMultMiddle + '.input2', .5, .5, .5)
        cmds.setAttr(lowerMultMiddle + '.input2', .5, .5, .5)

        cmds.connectAttr(upperMultMiddle + '.output', upperLegGrp + '.t')
        cmds.connectAttr(lowerMultMiddle + '.output', lowerLegGrp + '.t')

        cmds.setAttr(upperLegGrp + '.r', 0, 0, 0)
        cmds.setAttr(lowerLegGrp + '.r', 0, 0, 0)

        if side.find('L') != -1:
            self.outputTransformL = [aimObjectHip, aimObjectKnee, ankle, poleV]
            self.outputAddTrL = [upperLeg, lowerLeg]
            cmds.transformLimits(knee, tz=[0.01, 1], etz=[True, False])
        else:
            self.outputTransformR = [aimObjectHip, aimObjectKnee, ankle, poleV]
            self.outputAddTrR = [upperLeg, lowerLeg]
            cmds.transformLimits(knee, tz=[-1, 0.01], etz=[False, True])
Esempio n. 10
0
    def rigSide(self, side):
        inverseAim = False
        inverseUp = False
        globalMult = 1
        if side.find('R') != -1:
            inverseAim = True
            inverseUp = True
            globalMult = -1

        shoulder, elbow, wrist, poleV = self.armInitCtlData.getSortList(side)
        upperArm, lowerArm = self.armInitCtlAdd.getSortList(side)

        aimObjectOptions = {
            'axis': 0,
            'upAxis': 2,
            'inverseAim': inverseAim,
            'inverseUp': inverseUp,
            'upType': 'object',
            'upObject': poleV,
            'replaceTarget': 'InitCTL',
            'replace': 'InitCtl'
        }

        aimObject, wristPoseMltDcmp = rigbase.makeAimObject(
            wrist, shoulder, **aimObjectOptions)
        aimObject = cmds.rename(aimObject,
                                aimObject.replace('AimObj', 'AimGrp'))

        rigbase.betweenRigInAimObject(elbow,
                                      aimObject,
                                      dcmp=wristPoseMltDcmp,
                                      replaceTarget='InitCTL',
                                      replace='InitCtl',
                                      globalMult=globalMult)
        rigbase.AttrEdit(elbow).lockAttrs('ty')

        aimObjectElbow = rigbase.makeAimObject(wrist, elbow,
                                               **aimObjectOptions)[0]
        aimObjectShoulder = rigbase.makeAimObject(elbow, shoulder,
                                                  **aimObjectOptions)[0]

        cmds.parent(upperArm, aimObjectShoulder)
        cmds.parent(lowerArm, aimObjectElbow)

        upperArmGrp = rigbase.addParent(upperArm)
        lowerArmGrp = rigbase.addParent(lowerArm)

        upperMtxDcmp = rigbase.getChildMtxDcmp(elbow, aimObjectShoulder)
        lowerMtxDcmp = rigbase.getChildMtxDcmp(wrist, aimObjectElbow)
        upperMultMiddle = cmds.createNode('multiplyDivide',
                                          n=upperArm.replace(
                                              'InitCTL', 'InitCtlMiddleMult'))
        lowerMultMiddle = cmds.createNode('multiplyDivide',
                                          n=lowerArm.replace(
                                              'InitCTL', 'InitCtlMiddleMult'))

        cmds.connectAttr(upperMtxDcmp + '.ot', upperMultMiddle + '.input1')
        cmds.connectAttr(lowerMtxDcmp + '.ot', lowerMultMiddle + '.input1')

        cmds.setAttr(upperMultMiddle + '.input2', .5, .5, .5)
        cmds.setAttr(lowerMultMiddle + '.input2', .5, .5, .5)

        cmds.connectAttr(upperMultMiddle + '.output', upperArmGrp + '.t')
        cmds.connectAttr(lowerMultMiddle + '.output', lowerArmGrp + '.t')

        cmds.setAttr(upperArmGrp + '.r', 0, 0, 0)
        cmds.setAttr(lowerArmGrp + '.r', 0, 0, 0)

        if side.find('L') != -1:
            self.outputTransformL = [
                aimObjectShoulder, aimObjectElbow, wrist, poleV
            ]
            self.outputAddTrL = [upperArm, lowerArm]
            cmds.transformLimits(elbow, tz=[-1, 0.01], etz=[False, True])
        else:
            self.outputTransformR = [
                aimObjectShoulder, aimObjectElbow, wrist, poleV
            ]
            self.outputAddTrR = [upperArm, lowerArm]
            cmds.transformLimits(elbow, tz=[0.01, 1], etz=[True, False])