Beispiel #1
0
def addJawUpSquash():
    '''
    add CT__jawB_pLoc first - just duplicate CT__jaw_pLoc
    '''
    import rigger.modules.face as face
    reload(face)
    # add bnds
    pLoc = nt.Transform(u'CT__jawB_pLoc')
    bndGrp = nt.Transform(u'CT_bnd_grp')
    bnd = face.createBndFromPlacementLoc(pLoc, bndGrp)
    # sec system
    face.addSecondaryControlSystemToBnd(bnd)
    # connect to pri system
    import rigger.modules.priCtl as priCtl
    reload(priCtl)
    # add pri ctl
    priBnd = bnd
    newCtl = priCtl.addPrimaryCtlToBnd(priBnd)
    # drive other bnds
    bndsToDrive = [nt.Joint(u'LT_lowerSide_lip_bnd'),
                    nt.Joint(u'CT_upper_lip_bnd'),
                    nt.Joint(u'LT_lowerPinch_lip_bnd'),
                    nt.Joint(u'LT_upperPinch_lip_bnd'),
                    nt.Joint(u'CT_lower_lip_bnd'),
                    nt.Joint(u'LT_upperSide_lip_bnd'),
                    nt.Joint(u'LT_corner_lip_bnd'),
                    nt.Joint(u'LT_upperSneer_lip_bnd'),
                    nt.Joint(u'LT_lowerSneer_lip_bnd'),
                    nt.Joint(u'RT_lowerSide_lip_bnd'),
                    nt.Joint(u'RT_lowerPinch_lip_bnd'),
                    nt.Joint(u'RT_upperPinch_lip_bnd'),
                    nt.Joint(u'RT_upperSide_lip_bnd'),
                    nt.Joint(u'RT_corner_lip_bnd'),
                    nt.Joint(u'RT_upperSneer_lip_bnd'),
                    nt.Joint(u'RT_lowerSneer_lip_bnd'),
                    nt.Joint(u'LT_low_crease_bnd'),
                    nt.Joint(u'RT_low_crease_bnd'),
                    nt.Joint(u'CT__jawB_bnd'),
                    nt.Joint(u'LT__philtrum_bnd'),
                    nt.Joint(u'LT_in_philtrum_bnd'),
                    nt.Joint(u'LT__sneer_bnd'),
                    nt.Joint(u'RT__philtrum_bnd'),
                    nt.Joint(u'RT_in_philtrum_bnd'),
                    nt.Joint(u'RT__sneer_bnd')]
    
    for bnd in bndsToDrive:
        priCtl.connectBndToPriCtl(bnd, newCtl, False)
        
    # newCtl to drive other priCtls
    affectedPriCtlBnds = [nt.Joint(u'LT_lowerSneer_lip_bnd'),
                            nt.Joint(u'LT_corner_lip_bnd'),
                            nt.Joint(u'LT_upperSneer_lip_bnd'),
                            nt.Joint(u'CT_upper_lip_bnd'),
                            nt.Joint(u'RT_upperSneer_lip_bnd'),
                            nt.Joint(u'RT_corner_lip_bnd'),
                            nt.Joint(u'RT_lowerSneer_lip_bnd'),
                            nt.Joint(u'CT_lower_lip_bnd')]
    for bnd in affectedPriCtlBnds:
        priCtl.driveAttachedPriCtl(bnd, newCtl)
    nt.Joint(u'LT_corner_lip_bnd'),
    nt.Joint(u'LT_upperSneer_lip_bnd'),
    nt.Joint(u'LT_lowerSneer_lip_bnd'),
    nt.Joint(u'CT__jaw_bnd'),
    nt.Joint(u'CT__mouthMover_bnd'),
    nt.Joint(u'CT_upper_lip_bnd'),
    nt.Joint(u'CT_lower_lip_bnd'),
    nt.Joint(u'RT_upperSneer_lip_bnd'),
    nt.Joint(u'RT_lowerSneer_lip_bnd'),
    nt.Joint(u'RT_corner_lip_bnd'),
    nt.Joint(u'RT_high_cheek_bnd'),
    nt.Joint(u'RT_mid_cheek_bnd')
]
shaperCtl = nt.Transform(u'CT_lower_headShaperB_pri_ctrl')
for bnd in priBndsToDrive:
    priCtl.driveAttachedPriCtl(bnd, shaperCtl)

# lowerA
priBndsToDrive = [
    nt.Joint(u'LT__squint_bnd'),
    nt.Joint(u'CT__noseTip_bnd'),
    nt.Joint(u'LT_high_cheek_bnd'),
    nt.Joint(u'LT_mid_cheek_bnd'),
    nt.Joint(u'RT_lowerSneer_lip_bnd'),
    nt.Joint(u'CT__mouthMover_bnd'),
    nt.Joint(u'LT_upperSneer_lip_bnd'),
    nt.Joint(u'RT_corner_lip_bnd'),
    nt.Joint(u'RT_upperSneer_lip_bnd'),
    nt.Joint(u'CT_lower_lip_bnd'),
    nt.Joint(u'LT_lowerSneer_lip_bnd'),
    nt.Joint(u'LT_corner_lip_bnd'),
Beispiel #3
0
def addHighCheekControls():
    '''
    '''
    import rigger.modules.face as face
    reload(face)
    # add bnds
    pLoc = nt.Transform(u'LT_high_cheek_pLoc')
    bndGrp = nt.Transform(u'CT_bnd_grp')
    face.createBndFromPlacementLoc(pLoc, bndGrp)
    pLoc = nt.Transform(u'RT_high_cheek_pLoc')
    bndGrp = nt.Transform(u'CT_bnd_grp')
    face.createBndFromPlacementLoc(pLoc, bndGrp)
    # sec system
    bnd = nt.Joint(u'LT_high_cheek_bnd')
    face.addSecondaryControlSystemToBnd(bnd)
    bnd = nt.Joint(u'RT_high_cheek_bnd')
    face.addSecondaryControlSystemToBnd(bnd)
    # connect to pri system
    import rigger.modules.priCtl as priCtl
    reload(priCtl)
    # left
    bndsToConnect = [nt.Joint(u'LT_high_cheek_bnd')]
    pCtl = nt.Transform(u'LT__squint_pri_ctrl')
    priCtl.connectBndsToPriCtl(bndsToConnect, pCtl)
    pCtl = nt.Transform(u'CT__mouthMover_pri_ctrl')
    priCtl.connectBndsToPriCtl(bndsToConnect, pCtl)
    pCtl = nt.Transform(u'CT__jaw_pri_ctrl')
    priCtl.connectBndsToPriCtl(bndsToConnect, pCtl)
    pCtl = nt.Transform(u'LT_mid_cheek_pri_ctrl')
    priCtl.connectBndsToPriCtl(bndsToConnect, pCtl)
    pCtl = nt.Transform(u'LT_corner_lip_pri_ctrl')
    priCtl.connectBndsToPriCtl(bndsToConnect, pCtl)
    # right
    bndsToConnect = [nt.Joint(u'RT_high_cheek_bnd')]
    pCtl = nt.Transform(u'RT__squint_pri_ctrl')
    priCtl.connectBndsToPriCtl(bndsToConnect, pCtl)
    pCtl = nt.Transform(u'CT__mouthMover_pri_ctrl')
    priCtl.connectBndsToPriCtl(bndsToConnect, pCtl)
    pCtl = nt.Transform(u'CT__jaw_pri_ctrl')
    priCtl.connectBndsToPriCtl(bndsToConnect, pCtl)
    pCtl = nt.Transform(u'RT_mid_cheek_pri_ctrl_real')
    priCtl.connectBndsToPriCtl(bndsToConnect, pCtl)
    pCtl = nt.Transform(u'RT_corner_lip_pri_ctrl_real')
    priCtl.connectBndsToPriCtl(bndsToConnect, pCtl)

    # add pri ctl to high_cheek_bnd
    priBnd = nt.Joint(u'LT_high_cheek_bnd')
    newCtl = priCtl.addPrimaryCtlToBnd(priBnd)
    priCtl.addPriCtlDrivers(priBnd)
    priBnd = nt.Joint(u'RT_high_cheek_bnd')
    newCtl = priCtl.addPrimaryCtlToBnd(priBnd)
    priCtl.addPriCtlDrivers(priBnd)

    # drive other bnds
    newCtl = nt.Transform(u'LT_high_cheek_pri_ctrl')
    bndsToDrive = [
        nt.Joint(u'LT_up_crease_bnd'),
        nt.Joint(u'LT_in_cheek_bnd'),
        nt.Joint(u'LT_up_cheek_bnd'),
        nt.Joint(u'LT_out_cheek_bnd'),
        nt.Joint(u'LT__squint_bnd'),
        nt.Joint(u'LT_high_cheek_bnd'),
        nt.Joint(u'LT_mid_crease_bnd'),
        nt.Joint(u'LT_low_crease_bnd'),
        nt.Joint(u'LT_mid_cheek_bnd'),
        nt.Joint(u'LT_low_cheek_bnd')
    ]
    for bnd in bndsToDrive:
        priCtl.connectBndToPriCtl(bnd, newCtl, False)
    # drive other bnds
    newCtl = nt.Transform(u'RT_high_cheek_pri_ctrl')
    bndsToDrive = [
        nt.Joint(u'RT_up_crease_bnd'),
        nt.Joint(u'RT_in_cheek_bnd'),
        nt.Joint(u'RT_up_cheek_bnd'),
        nt.Joint(u'RT_out_cheek_bnd'),
        nt.Joint(u'RT__squint_bnd'),
        nt.Joint(u'RT_high_cheek_bnd'),
        nt.Joint(u'RT_mid_crease_bnd'),
        nt.Joint(u'RT_low_crease_bnd'),
        nt.Joint(u'RT_mid_cheek_bnd'),
        nt.Joint(u'RT_low_cheek_bnd')
    ]
    for bnd in bndsToDrive:
        priCtl.connectBndToPriCtl(bnd, newCtl, False)

    # newCtl to drive other priCtls
    newCtl = nt.Transform(u'LT_high_cheek_pri_ctrl')
    priCtl.driveAttachedPriCtl(nt.Joint(u'LT__squint_bnd'), newCtl)
    priCtl.driveAttachedPriCtl(nt.Joint(u'LT_mid_cheek_bnd'), newCtl)
    newCtl = nt.Transform(u'RT_high_cheek_pri_ctrl')
    priCtl.driveAttachedPriCtl(nt.Joint(u'RT__squint_bnd'), newCtl)
    priCtl.driveAttachedPriCtl(nt.Joint(u'RT_mid_cheek_bnd'), newCtl)
Beispiel #4
0
def addJawUpSquash():
    '''
    add CT__jawB_pLoc first - just duplicate CT__jaw_pLoc
    '''
    import rigger.modules.face as face
    reload(face)
    # add bnds
    pLoc = nt.Transform(u'CT__jawB_pLoc')
    bndGrp = nt.Transform(u'CT_bnd_grp')
    bnd = face.createBndFromPlacementLoc(pLoc, bndGrp)
    # sec system
    face.addSecondaryControlSystemToBnd(bnd)
    # connect to pri system
    import rigger.modules.priCtl as priCtl
    reload(priCtl)
    # add pri ctl
    priBnd = bnd
    newCtl = priCtl.addPrimaryCtlToBnd(priBnd)
    # drive other bnds
    bndsToDrive = [
        nt.Joint(u'LT_lowerSide_lip_bnd'),
        nt.Joint(u'CT_upper_lip_bnd'),
        nt.Joint(u'LT_lowerPinch_lip_bnd'),
        nt.Joint(u'LT_upperPinch_lip_bnd'),
        nt.Joint(u'CT_lower_lip_bnd'),
        nt.Joint(u'LT_upperSide_lip_bnd'),
        nt.Joint(u'LT_corner_lip_bnd'),
        nt.Joint(u'LT_upperSneer_lip_bnd'),
        nt.Joint(u'LT_lowerSneer_lip_bnd'),
        nt.Joint(u'RT_lowerSide_lip_bnd'),
        nt.Joint(u'RT_lowerPinch_lip_bnd'),
        nt.Joint(u'RT_upperPinch_lip_bnd'),
        nt.Joint(u'RT_upperSide_lip_bnd'),
        nt.Joint(u'RT_corner_lip_bnd'),
        nt.Joint(u'RT_upperSneer_lip_bnd'),
        nt.Joint(u'RT_lowerSneer_lip_bnd'),
        nt.Joint(u'LT_low_crease_bnd'),
        nt.Joint(u'RT_low_crease_bnd'),
        nt.Joint(u'CT__jawB_bnd'),
        nt.Joint(u'LT__philtrum_bnd'),
        nt.Joint(u'LT_in_philtrum_bnd'),
        nt.Joint(u'LT__sneer_bnd'),
        nt.Joint(u'RT__philtrum_bnd'),
        nt.Joint(u'RT_in_philtrum_bnd'),
        nt.Joint(u'RT__sneer_bnd')
    ]

    for bnd in bndsToDrive:
        priCtl.connectBndToPriCtl(bnd, newCtl, False)

    # newCtl to drive other priCtls
    affectedPriCtlBnds = [
        nt.Joint(u'LT_lowerSneer_lip_bnd'),
        nt.Joint(u'LT_corner_lip_bnd'),
        nt.Joint(u'LT_upperSneer_lip_bnd'),
        nt.Joint(u'CT_upper_lip_bnd'),
        nt.Joint(u'RT_upperSneer_lip_bnd'),
        nt.Joint(u'RT_corner_lip_bnd'),
        nt.Joint(u'RT_lowerSneer_lip_bnd'),
        nt.Joint(u'CT_lower_lip_bnd')
    ]
    for bnd in affectedPriCtlBnds:
        priCtl.driveAttachedPriCtl(bnd, newCtl)
Beispiel #5
0
def addBndsToEyeMover():
    '''
    '''
    pBnd = nt.Joint(u'LT__eyeMover_bnd')
    pCtl = priCtl.addPrimaryCtlToBnd(pBnd)
    bnds = [nt.Joint(u'LT_inner_eyelid_bnd'),
            nt.Joint(u'LT_inner_eyeSocket_bnd'),
            nt.Joint(u'LT_upperInner_eyelid_bnd'),
            nt.Joint(u'LT_upperInner_eyeSocket_bnd'),
            nt.Joint(u'LT_upper_eyelid_bnd'),
            nt.Joint(u'LT_upper_eyeSocket_bnd'),
            nt.Joint(u'LT_upperOuter_eyelid_bnd'),
            nt.Joint(u'LT_upperOuter_eyeSocket_bnd'),
            nt.Joint(u'LT_outer_eyelid_bnd'),
            nt.Joint(u'LT_outer_eyeSocket_bnd'),
            nt.Joint(u'LT_lowerOuter_eyeSocket_bnd'),
            nt.Joint(u'LT_lowerOuter_eyelid_bnd'),
            nt.Joint(u'LT_lower_eyeSocket_bnd'),
            nt.Joint(u'LT_lower_eyelid_bnd'),
            nt.Joint(u'LT_lowerInner_eyeSocket_bnd'),
            nt.Joint(u'LT_lowerInner_eyelid_bnd'),
            nt.Joint(u'CT_mid_squint_bnd'),
            nt.Joint(u'CT_mid_temple_bnd'),
            nt.Joint(u'LT_outerA_temple_bnd'),
            nt.Joint(u'LT_outerA_squint_bnd'),
            nt.Joint(u'LT_upperCorner_cheek_bnd'),
            nt.Joint(u'LT_upperPinch_outCrease_bnd'),
            nt.Joint(u'LT_upperSneer_outCrease_bnd'),
            nt.Joint(u'LT_upperSide_outCrease_bnd'),
            nt.Joint(u'CT_upper_cheek_bnd'),
            nt.Joint(u'CT_upper_outCrease_bnd'),
            nt.Joint(u'LT_upperSide_midCrease_bnd'),
            nt.Joint(u'LT_upperSneer_midCrease_bnd'),
            nt.Joint(u'LT_upperPinch_midCrease_bnd'),
            nt.Joint(u'LT_upperCorner_outCrease_bnd')]
    for bnd in bnds:
        priCtl.connectBndToPriCtl(bnd, pCtl, False)
    
    bnds = [nt.Joint(u'LT_inner_eyelid_bnd'),
            nt.Joint(u'LT_upper_eyelid_bnd'),
            nt.Joint(u'LT_outer_eyelid_bnd'),
            nt.Joint(u'LT_lower_eyelid_bnd')]
    for bnd in bnds:
        priCtl.driveAttachedPriCtl(bnd, pCtl)
        
    # same thing for right side
    pBnd = nt.Joint(u'RT__eyeMover_bnd')
    pCtl = priCtl.addPrimaryCtlToBnd(pBnd)
    bnds = [nt.Joint(u'RT_inner_eyelid_bnd'),
            nt.Joint(u'RT_inner_eyeSocket_bnd'),
            nt.Joint(u'RT_upperInner_eyelid_bnd'),
            nt.Joint(u'RT_upperInner_eyeSocket_bnd'),
            nt.Joint(u'RT_upper_eyelid_bnd'),
            nt.Joint(u'RT_upper_eyeSocket_bnd'),
            nt.Joint(u'RT_upperOuter_eyelid_bnd'),
            nt.Joint(u'RT_upperOuter_eyeSocket_bnd'),
            nt.Joint(u'RT_outer_eyelid_bnd'),
            nt.Joint(u'RT_outer_eyeSocket_bnd'),
            nt.Joint(u'RT_lowerOuter_eyeSocket_bnd'),
            nt.Joint(u'RT_lowerOuter_eyelid_bnd'),
            nt.Joint(u'RT_lower_eyeSocket_bnd'),
            nt.Joint(u'RT_lower_eyelid_bnd'),
            nt.Joint(u'RT_lowerInner_eyeSocket_bnd'),
            nt.Joint(u'RT_lowerInner_eyelid_bnd'),
            nt.Joint(u'CT_mid_squint_bnd'),
            nt.Joint(u'CT_mid_temple_bnd'),
            nt.Joint(u'RT_outerA_temple_bnd'),
            nt.Joint(u'RT_outerA_squint_bnd'),
            nt.Joint(u'RT_upperCorner_cheek_bnd'),
            nt.Joint(u'RT_upperPinch_outCrease_bnd'),
            nt.Joint(u'RT_upperSneer_outCrease_bnd'),
            nt.Joint(u'RT_upperSide_outCrease_bnd'),
            nt.Joint(u'CT_upper_cheek_bnd'),
            nt.Joint(u'CT_upper_outCrease_bnd'),
            nt.Joint(u'RT_upperSide_midCrease_bnd'),
            nt.Joint(u'RT_upperSneer_midCrease_bnd'),
            nt.Joint(u'RT_upperPinch_midCrease_bnd'),
            nt.Joint(u'RT_upperCorner_outCrease_bnd')]
    for bnd in bnds:
        priCtl.connectBndToPriCtl(bnd, pCtl, False)
    
    bnds = [nt.Joint(u'RT_inner_eyelid_bnd'),
            nt.Joint(u'RT_upper_eyelid_bnd'),
            nt.Joint(u'RT_outer_eyelid_bnd'),
            nt.Joint(u'RT_lower_eyelid_bnd')]
    for bnd in bnds:
        priCtl.driveAttachedPriCtl(bnd, pCtl)
    
    # zero scale weights for DQ skinning
    weights.zeroAllMatrixScaleWeights()
Beispiel #6
0
def addHighCheekControls():
    '''
    '''
    import rigger.modules.face as face
    reload(face)
    # add bnds
    pLoc = nt.Transform(u'LT_high_cheek_pLoc')
    bndGrp = nt.Transform(u'CT_bnd_grp')
    face.createBndFromPlacementLoc(pLoc, bndGrp)
    pLoc = nt.Transform(u'RT_high_cheek_pLoc')
    bndGrp = nt.Transform(u'CT_bnd_grp')
    face.createBndFromPlacementLoc(pLoc, bndGrp)
    # sec system
    bnd = nt.Joint(u'LT_high_cheek_bnd')
    face.addSecondaryControlSystemToBnd(bnd)
    bnd = nt.Joint(u'RT_high_cheek_bnd')
    face.addSecondaryControlSystemToBnd(bnd)
    # connect to pri system
    import rigger.modules.priCtl as priCtl
    reload(priCtl)
    # left
    bndsToConnect = [nt.Joint(u'LT_high_cheek_bnd')]
    pCtl = nt.Transform(u'LT__squint_pri_ctrl')
    priCtl.connectBndsToPriCtl(bndsToConnect, pCtl)
    pCtl = nt.Transform(u'CT__mouthMover_pri_ctrl')
    priCtl.connectBndsToPriCtl(bndsToConnect, pCtl)
    pCtl = nt.Transform(u'CT__jaw_pri_ctrl')
    priCtl.connectBndsToPriCtl(bndsToConnect, pCtl)
    pCtl = nt.Transform(u'LT_mid_cheek_pri_ctrl')
    priCtl.connectBndsToPriCtl(bndsToConnect, pCtl)
    pCtl = nt.Transform(u'LT_corner_lip_pri_ctrl')
    priCtl.connectBndsToPriCtl(bndsToConnect, pCtl)
    # right
    bndsToConnect = [nt.Joint(u'RT_high_cheek_bnd')]
    pCtl = nt.Transform(u'RT__squint_pri_ctrl')
    priCtl.connectBndsToPriCtl(bndsToConnect, pCtl)
    pCtl = nt.Transform(u'CT__mouthMover_pri_ctrl')
    priCtl.connectBndsToPriCtl(bndsToConnect, pCtl)
    pCtl = nt.Transform(u'CT__jaw_pri_ctrl')
    priCtl.connectBndsToPriCtl(bndsToConnect, pCtl)
    pCtl = nt.Transform(u'RT_mid_cheek_pri_ctrl_real')
    priCtl.connectBndsToPriCtl(bndsToConnect, pCtl)
    pCtl = nt.Transform(u'RT_corner_lip_pri_ctrl_real')
    priCtl.connectBndsToPriCtl(bndsToConnect, pCtl)
    
    # add pri ctl to high_cheek_bnd
    priBnd = nt.Joint(u'LT_high_cheek_bnd')
    newCtl = priCtl.addPrimaryCtlToBnd(priBnd)
    priCtl.addPriCtlDrivers(priBnd)
    priBnd = nt.Joint(u'RT_high_cheek_bnd')
    newCtl = priCtl.addPrimaryCtlToBnd(priBnd)
    priCtl.addPriCtlDrivers(priBnd)
    
    # drive other bnds
    newCtl = nt.Transform(u'LT_high_cheek_pri_ctrl')
    bndsToDrive = [nt.Joint(u'LT_up_crease_bnd'),
                    nt.Joint(u'LT_in_cheek_bnd'),
                    nt.Joint(u'LT_up_cheek_bnd'),
                    nt.Joint(u'LT_out_cheek_bnd'),
                    nt.Joint(u'LT__squint_bnd'),
                    nt.Joint(u'LT_high_cheek_bnd'),
                    nt.Joint(u'LT_mid_crease_bnd'),
                    nt.Joint(u'LT_low_crease_bnd'),
                    nt.Joint(u'LT_mid_cheek_bnd'),
                    nt.Joint(u'LT_low_cheek_bnd')]
    for bnd in bndsToDrive:
        priCtl.connectBndToPriCtl(bnd, newCtl, False)
    # drive other bnds
    newCtl = nt.Transform(u'RT_high_cheek_pri_ctrl')
    bndsToDrive = [nt.Joint(u'RT_up_crease_bnd'),
                    nt.Joint(u'RT_in_cheek_bnd'),
                    nt.Joint(u'RT_up_cheek_bnd'),
                    nt.Joint(u'RT_out_cheek_bnd'),
                    nt.Joint(u'RT__squint_bnd'),
                    nt.Joint(u'RT_high_cheek_bnd'),
                    nt.Joint(u'RT_mid_crease_bnd'),
                    nt.Joint(u'RT_low_crease_bnd'),
                    nt.Joint(u'RT_mid_cheek_bnd'),
                    nt.Joint(u'RT_low_cheek_bnd')]
    for bnd in bndsToDrive:
        priCtl.connectBndToPriCtl(bnd, newCtl, False)
        
    # newCtl to drive other priCtls
    newCtl = nt.Transform(u'LT_high_cheek_pri_ctrl')
    priCtl.driveAttachedPriCtl(nt.Joint(u'LT__squint_bnd'), newCtl)
    priCtl.driveAttachedPriCtl(nt.Joint(u'LT_mid_cheek_bnd'), newCtl)
    newCtl = nt.Transform(u'RT_high_cheek_pri_ctrl')
    priCtl.driveAttachedPriCtl(nt.Joint(u'RT__squint_bnd'), newCtl)
    priCtl.driveAttachedPriCtl(nt.Joint(u'RT_mid_cheek_bnd'), newCtl)
nt.Joint(u'LT_up_cheek_bnd'),
nt.Joint(u'LT_out_cheek_bnd'),
nt.Joint(u'LT__squint_bnd'),
nt.Joint(u'LT_up_jaw_bnd'),
nt.Joint(u'LT_low_cheek_bnd')]

pCtl = nt.Transform(u'LT_mid_cheek_pri_ctrl')

import rigger.modules.priCtl as priCtl
reload(priCtl)
for bnd in bndsToDrive:
    priCtl.connectBndToPriCtl(bnd, pCtl, False)
    
priBndsToDrive = [nt.Joint(u'LT__squint_bnd')]
for bnd in priBndsToDrive:
    priCtl.driveAttachedPriCtl(bnd, pCtl)
    
bndsToDrive = [nt.Joint(u'RT_mid_crease_bnd'),
nt.Joint(u'RT_up_cheek_bnd'),
nt.Joint(u'RT_out_cheek_bnd'),
nt.Joint(u'RT__squint_bnd'),
nt.Joint(u'RT_up_jaw_bnd'),
nt.Joint(u'RT_low_cheek_bnd')]

pCtl = nt.Transform(u'RT_mid_cheek_pri_ctrl')

import rigger.modules.priCtl as priCtl
reload(priCtl)
for bnd in bndsToDrive:
    priCtl.connectBndToPriCtl(bnd, pCtl, False)
    
    nt.Joint(u'LT_out_cheek_bnd'),
    nt.Joint(u'LT__squint_bnd'),
    nt.Joint(u'LT_up_jaw_bnd'),
    nt.Joint(u'LT_low_cheek_bnd')
]

pCtl = nt.Transform(u'LT_mid_cheek_pri_ctrl')

import rigger.modules.priCtl as priCtl
reload(priCtl)
for bnd in bndsToDrive:
    priCtl.connectBndToPriCtl(bnd, pCtl, False)

priBndsToDrive = [nt.Joint(u'LT__squint_bnd')]
for bnd in priBndsToDrive:
    priCtl.driveAttachedPriCtl(bnd, pCtl)

bndsToDrive = [
    nt.Joint(u'RT_mid_crease_bnd'),
    nt.Joint(u'RT_up_cheek_bnd'),
    nt.Joint(u'RT_out_cheek_bnd'),
    nt.Joint(u'RT__squint_bnd'),
    nt.Joint(u'RT_up_jaw_bnd'),
    nt.Joint(u'RT_low_cheek_bnd')
]

pCtl = nt.Transform(u'RT_mid_cheek_pri_ctrl')

import rigger.modules.priCtl as priCtl
reload(priCtl)
for bnd in bndsToDrive:
nt.Joint(u'LT_mid_cheek_bnd'),
nt.Joint(u'LT_corner_lip_bnd'),
nt.Joint(u'LT_upperSneer_lip_bnd'),
nt.Joint(u'LT_lowerSneer_lip_bnd'),
nt.Joint(u'CT__jaw_bnd'),
nt.Joint(u'CT__mouthMover_bnd'),
nt.Joint(u'CT_upper_lip_bnd'),
nt.Joint(u'CT_lower_lip_bnd'),
nt.Joint(u'RT_upperSneer_lip_bnd'),
nt.Joint(u'RT_lowerSneer_lip_bnd'),
nt.Joint(u'RT_corner_lip_bnd'),
nt.Joint(u'RT_high_cheek_bnd'),
nt.Joint(u'RT_mid_cheek_bnd')]
shaperCtl = nt.Transform(u'CT_lower_headShaperB_pri_ctrl')
for bnd in priBndsToDrive:
    priCtl.driveAttachedPriCtl(bnd, shaperCtl)
    
# lowerA
priBndsToDrive = [nt.Joint(u'LT__squint_bnd'),
                nt.Joint(u'CT__noseTip_bnd'),
                nt.Joint(u'LT_high_cheek_bnd'),
                nt.Joint(u'LT_mid_cheek_bnd'),
                nt.Joint(u'RT_lowerSneer_lip_bnd'),
                nt.Joint(u'CT__mouthMover_bnd'),
                nt.Joint(u'LT_upperSneer_lip_bnd'),
                nt.Joint(u'RT_corner_lip_bnd'),
                nt.Joint(u'RT_upperSneer_lip_bnd'),
                nt.Joint(u'CT_lower_lip_bnd'),
                nt.Joint(u'LT_lowerSneer_lip_bnd'),
                nt.Joint(u'LT_corner_lip_bnd'),
                nt.Joint(u'CT_upper_lip_bnd'),
Beispiel #10
0
def addCenterLipsPriCtls():
    '''
    '''
    import rigger.modules.priCtl as priCtl
    reload(priCtl)
    
    # add upper lip priCtl
    priBnd = nt.Joint(u'FACE:CT_upper_lip_bnd')
    secBnds = [nt.Joint(u'FACE:RT_upper_pinch_lip_bnd'),
                nt.Joint(u'FACE:RT_upper_sneer_lip_bnd'),
                nt.Joint(u'FACE:RT_upper_side_lip_bnd'),
                nt.Joint(u'FACE:CT_upper_lip_bnd'),
                nt.Joint(u'FACE:LT_upper_side_lip_bnd'),
                nt.Joint(u'FACE:LT_upper_sneer_lip_bnd'),
                nt.Joint(u'FACE:LT_upper_pinch_lip_bnd')]
    newCtl = priCtl.addPrimaryCtlToBnd(priBnd)
    for secBnd in secBnds:
        priCtl.connectBndToPriCtl(secBnd, newCtl, False)
        
    # get all priCtls driving this bnd
    attachedCtl = priBnd.attr('attached_pri_ctl').get()
    all_attrs = priBnd.listAttr(ud=True, l=True)
    all_attrs = [attr for attr in all_attrs if 'pri_ctrl_weights' in attr.name()]
    all_priCtls = [attr.attrName().replace('_weights','') for attr in all_attrs]
    
    # let other priCtl drive the new priCtl
    for ctl in all_priCtls:
        # add namespace
        ctl = 'FACE:'+ctl
        if ctl != attachedCtl:
            priCtl.driveAttachedPriCtl(priBnd, pm.PyNode(ctl))
        else:
            # don't drive an attached ctl
            pass
            
    # new priCtl should also drive other priCtls      
    priCtl.driveAttachedPriCtl(nt.Joint(u'FACE:LT_upper_sneer_lip_bnd'), newCtl)
    priCtl.driveAttachedPriCtl(nt.Joint(u'FACE:RT_upper_sneer_lip_bnd'), newCtl)
    
    # add lower lip priCtl
    priBnd = nt.Joint(u'FACE:CT_lower_lip_bnd')
    secBnds = [nt.Joint(u'FACE:RT_lower_pinch_lip_bnd'),
                nt.Joint(u'FACE:RT_lower_sneer_lip_bnd'),
                nt.Joint(u'FACE:RT_lower_side_lip_bnd'),
                nt.Joint(u'FACE:CT_lower_lip_bnd'),
                nt.Joint(u'FACE:LT_lower_side_lip_bnd'),
                nt.Joint(u'FACE:LT_lower_sneer_lip_bnd'),
                nt.Joint(u'FACE:LT_lower_pinch_lip_bnd')]
    newCtl = priCtl.addPrimaryCtlToBnd(priBnd)
    for secBnd in secBnds:
        priCtl.connectBndToPriCtl(secBnd, newCtl, False)
        
    # get all priCtls driving this bnd
    attachedCtl = priBnd.attr('attached_pri_ctl').get()
    all_attrs = priBnd.listAttr(ud=True, l=True)
    all_attrs = [attr for attr in all_attrs if 'pri_ctrl_weights' in attr.name()]
    all_priCtls = [attr.attrName().replace('_weights','') for attr in all_attrs]
    
    # let other priCtl drive the new priCtl
    for ctl in all_priCtls:
        # add namespace
        ctl = 'FACE:'+ctl
        if ctl != attachedCtl:
            priCtl.driveAttachedPriCtl(priBnd, pm.PyNode(ctl))
        else:
            # don't drive an attached ctl
            pass
            
    # new priCtl should also drive other priCtls      
    priCtl.driveAttachedPriCtl(nt.Joint(u'FACE:LT_lower_sneer_lip_bnd'), newCtl)
    priCtl.driveAttachedPriCtl(nt.Joint(u'FACE:RT_lower_sneer_lip_bnd'), newCtl)