Example #1
0
def addFingerRotateControl():
    
    sides = ['Mathilda_lf_', 'Mathilda_rt_']
    fingers = ['index', 'middle', 'ring', 'pinky']
    sections = {'_b':'Mid', '_c':'Tip'}
    channels = ['rx', 'rz']
    
    for side in sides:
        for finger in fingers:
            for jntSec, ctlSec in sections.items():
                ctl = side + finger + ctlSec + '_fk_ctrl'
                ctl = pm.PyNode(ctl)
                jnt = side + finger + jntSec + '_jnt'
                jnt = pm.PyNode(jnt)
                for channel in channels:
                    mod = modulate.addInput(jnt.attr(channel), 0, '_ctlRotate')
                    ctl.attr(channel) >> mod
    
    fingers = ['thumb']
    channels = ['rx', 'ry']
    
    for side in sides:
        for finger in fingers:
            for jntSec, ctlSec in sections.items():
                ctl = side + finger + ctlSec + '_fk_ctrl'
                ctl = pm.PyNode(ctl)
                jnt = side + finger + jntSec + '_jnt'
                jnt = pm.PyNode(jnt)
                for channel in channels:
                    mod = modulate.addInput(jnt.attr(channel), 0, '_ctlRotate')
                    ctl.attr(channel) >> mod
Example #2
0
def addLowerLipCurlsSDKs():
    '''
    '''
    # lower lips
    coeffs = pm.group(em=True, n='CT_lowerLipCurls_coeffs')
    coeffs.addAttr('leftPinch', k=True)
    coeffs.addAttr('leftSneer', k=True)
    coeffs.addAttr('leftSide', k=True)
    coeffs.addAttr('centerMid', k=True)
    coeffs.addAttr('rightSide', k=True)
    coeffs.addAttr('rightSneer', k=True)
    coeffs.addAttr('rightPinch', k=True)
    rt.connectSDK('LT_lowerPinch_lip_ctrl.rx',
    coeffs.leftPinch, {-90:-1, 0:0, 90:1})
    rt.connectSDK('LT_lowerSneer_lip_ctrl.rx',
    coeffs.leftSneer, {-90:-1, 0:0, 90:1})
    rt.connectSDK('LT_lowerSide_lip_ctrl.rx',
    coeffs.leftSide, {-90:-1, 0:0, 90:1})
    rt.connectSDK('CT_lower_lip_ctrl.rx',
    coeffs.centerMid, {-90:-1, 0:0, 90:1})
    rt.connectSDK('RT_lowerSneer_lip_ctrl.rx',
    coeffs.rightSneer, {-90:-1, 0:0, 90:1})
    rt.connectSDK('RT_lowerSide_lip_ctrl.rx',
    coeffs.rightSide, {-90:-1, 0:0, 90:1})
    rt.connectSDK('RT_lowerPinch_lip_ctrl.rx',
    coeffs.rightPinch, {-90:-1, 0:0, 90:1})
    
    priCtls = [nt.Transform(u'RT_lowerSneer_lip_pri_ctrl'),
                nt.Transform(u'CT_lower_lip_pri_ctrl'),
                nt.Transform(u'LT_lowerSneer_lip_pri_ctrl')]
                
    attrs = ['leftPinch',
    'leftSneer',
    'leftSide',
    'centerMid',
    'rightSide',
    'rightSneer',
    'rightPinch']
           
        
    for pCtl in priCtls:
        token = pCtl.split('_')[0]
        for attr in attrs:
            mod = modulate.addInput(coeffs.attr(attr), 0, token)
            rt.connectSDK(pCtl.rx, mod, {-90:-1, 0:0, 90:1})
            
    rt.connectSDK(coeffs.leftPinch, 
    'blendShapeCt_face_geo.lipCurlIn_lowerPinch_Lf', {0:0, -1:1})
    rt.connectSDK(coeffs.leftSneer, 
    'blendShapeCt_face_geo.lipCurlIn_lowerSneer_Lf', {0:0, -1:1})
    rt.connectSDK(coeffs.leftSide, 
    'blendShapeCt_face_geo.lipCurlIn_lowerSide_Lf', {0:0, -1:1})
    rt.connectSDK(coeffs.centerMid, 
    'blendShapeCt_face_geo.lipCurlIn_lower_Ct', {0:0, -1:1})
    rt.connectSDK(coeffs.rightPinch, 
    'blendShapeCt_face_geo.lipCurlIn_lowerPinch_Rt', {0:0, -1:1})
    rt.connectSDK(coeffs.rightSneer, 
    'blendShapeCt_face_geo.lipCurlIn_lowerSneer_Rt', {0:0, -1:1})
    rt.connectSDK(coeffs.rightSide, 
    'blendShapeCt_face_geo.lipCurlIn_lowerSide_Rt', {0:0, -1:1})
Example #3
0
# modulate by centers
import rigger.utils.modulate as modulate

reload(modulate)

priCtls = [
    nt.Transform(u'CT_upper_lip_pri_ctrl'),
    nt.Transform(u'CT_lower_lip_pri_ctrl')
]

attrs = ['leftLower', 'leftUpper', 'rightLower', 'rightUpper']

for pCtl in priCtls:
    token = pCtl.split('_')[1]
    for attr in attrs:
        mod = modulate.addInput(coeffs.attr(attr), 0, '_' + token)
        rt.connectSDK(pCtl.rx, mod, {-45: -1, 0: 0, 45: 1})

rt.connectSDK(coeffs.leftLower, 'blendShapeCt_face_geo.lipCurlOut_lower_Lf', {
    0: 0,
    1: 1
})
rt.connectSDK(coeffs.leftUpper, 'blendShapeCt_face_geo.lipCurlOut_upper_Lf', {
    0: 0,
    1: 1
})
rt.connectSDK(coeffs.rightLower, 'blendShapeCt_face_geo.lipCurlOut_lower_Rt', {
    0: 0,
    1: 1
})
rt.connectSDK(coeffs.rightUpper, 'blendShapeCt_face_geo.lipCurlOut_upper_Rt', {
Example #4
0
            nt.Transform(u'CT_lower_lip_pri_ctrl_negator'),
            nt.Transform(u'LT_lowerSneer_lip_pri_ctrl_negator')]
            
attrs = ['leftPinch',
'leftSneer',
'leftSide',
'centerMid',
'rightSide',
'rightSneer',
'rightPinch']
       
import rigger.utils.modulate as modulate
for pCtl in priCtls:
    token = pCtl.split('_')[0]
    for attr in attrs:
        mod = modulate.addInput(coeffs.attr(attr), 0, token)
        rt.connectSDK(pCtl.rx, mod, {-40:-1, 0:0, 40:1})
        
rt.connectSDK(coeffs.leftPinch, 
'LT_lowerPinch_lip_local_bnd_lipCurl.lipCurlVal', {-1:-0.5, 1:0.5})
rt.connectSDK(coeffs.leftSneer, 
'LT_lowerSneer_lip_local_bnd_lipCurl.lipCurlVal', {-1:-0.8, 1:0.8})
rt.connectSDK(coeffs.leftSide, 
'LT_lowerSide_lip_local_bnd_lipCurl.lipCurlVal', {-1:-1, 1:1})
rt.connectSDK(coeffs.centerMid, 
'CT_lower_lip_local_bnd_lipCurl.lipCurlVal', {-1:-1, 1:1})
rt.connectSDK(coeffs.rightPinch, 
'RT_lowerPinch_lip_local_bnd_lipCurl.lipCurlVal', {-1:-0.5, 1:0.5})
rt.connectSDK(coeffs.rightSneer, 
'RT_lowerSneer_lip_local_bnd_lipCurl.lipCurlVal', {-1:-0.8, 1:0.8})
rt.connectSDK(coeffs.rightSide, 
Example #5
0
def addLowerLipCurls():
    coeffs = pm.group(em=True, n='CT_lowerLipCurls_add_coeffs')
    bsp = pm.PyNode('FACE:blendShapeCt_face_geo')
    
    coeffs.addAttr('leftPinch', k=True)
    coeffs.addAttr('leftSneer', k=True)
    coeffs.addAttr('leftSide', k=True)
    coeffs.addAttr('leftMid', k=True)
    coeffs.addAttr('centerMid', k=True)
    coeffs.addAttr('rightMid', k=True)
    coeffs.addAttr('rightSide', k=True)
    coeffs.addAttr('rightSneer', k=True)
    coeffs.addAttr('rightPinch', k=True)
    
    # direct connect main curls
    jawCtl = pm.PyNode('FACE:CT_jaw_pri_ctrl')
    rt.connectSDK(jawCtl.leftLowerLipCurl, coeffs.leftPinch, {-1:1, 0:0, 1:-1})
    rt.connectSDK(jawCtl.leftLowerLipCurl, coeffs.leftSneer, {-1:1, 0:0, 1:-1})
    rt.connectSDK(jawCtl.leftLowerLipCurl, coeffs.leftSide, {-1:1, 0:0, 1:-1})
    rt.connectSDK(jawCtl.leftLowerLipCurl, coeffs.leftMid, {-1:1, 0:0, 1:-1})
    rt.connectSDK(jawCtl.rightLowerLipCurl, coeffs.rightPinch, {-1:1, 0:0, 1:-1})
    rt.connectSDK(jawCtl.rightLowerLipCurl, coeffs.rightSneer, {-1:1, 0:0, 1:-1})
    rt.connectSDK(jawCtl.rightLowerLipCurl, coeffs.rightSide, {-1:1, 0:0, 1:-1})
    rt.connectSDK(jawCtl.rightLowerLipCurl, coeffs.rightMid, {-1:1, 0:0, 1:-1})
    
    # average for center
    pma = pm.createNode('plusMinusAverage', n='CT_lowerLipCurlsMidAvg_pma')
    pma.operation.set(3)
    coeffs.leftMid >> pma.input1D[0]
    coeffs.rightMid >> pma.input1D[1]
    pma.output1D >> coeffs.centerMid
    
    # disconnect secCtl rotateX
    ctls = [nt.Transform(u'FACE:RT_lower_pinch_lip_ctrl'),
            nt.Transform(u'FACE:RT_lower_sneer_lip_ctrl'),
            nt.Transform(u'FACE:RT_lower_side_lip_ctrl'),
            nt.Transform(u'FACE:CT_lower_lip_ctrl'),
            nt.Transform(u'FACE:LT_lower_side_lip_ctrl'),
            nt.Transform(u'FACE:LT_lower_sneer_lip_ctrl'),
            nt.Transform(u'FACE:LT_lower_pinch_lip_ctrl')]
    for ctl in ctls:
        outNode = ctl.r.outputs()[0]
        ctl.ry >> outNode.ry
        ctl.rz >> outNode.rz
        ctl.r // outNode.r
        
    # add secCtls to coeffs
    import rigger.utils.modulate as modulate
    reload(modulate)
    import utils.rigging as rt
    reload(rt)
    mod = modulate.addInput(coeffs.leftPinch, 0, '_secCtl')
    rt.connectSDK(ctls[6].rx, mod, {45:-1, 0:0, -45:1})
    mod = modulate.addInput(coeffs.leftSneer, 0, '_secCtl')
    rt.connectSDK(ctls[5].rx, mod, {45:-1, 0:0, -45:1})
    mod = modulate.addInput(coeffs.leftSide, 0, '_secCtl')
    rt.connectSDK(ctls[4].rx, mod, {45:-1, 0:0, -45:1})
    mod = modulate.addInput(coeffs.centerMid, 0, '_secCtl')
    rt.connectSDK(ctls[3].rx, mod, {45:-1, 0:0, -45:1})
    mod = modulate.addInput(coeffs.rightSide, 0, '_secCtl')
    rt.connectSDK(ctls[2].rx, mod, {45:-1, 0:0, -45:1})
    mod = modulate.addInput(coeffs.rightSneer, 0, '_secCtl')
    rt.connectSDK(ctls[1].rx, mod, {45:-1, 0:0, -45:1})
    mod = modulate.addInput(coeffs.rightPinch, 0, '_secCtl')
    rt.connectSDK(ctls[0].rx, mod, {45:-1, 0:0, -45:1})
    
    # connect to bsp
    coeffs.leftPinch >> bsp.lowLipPinchTweak_curl_Lf
    coeffs.leftSneer >> bsp.lowLipSneerTweak_curl_Lf
    coeffs.leftSide >> bsp.lowLipSideTweak_curl_Lf
    coeffs.centerMid >> bsp.lowLipTweak_curl_Ct
    coeffs.rightSide >> bsp.lowLipSideTweak_curl_Rt
    coeffs.rightSneer >> bsp.lowLipSneerTweak_curl_Rt
    coeffs.rightPinch >> bsp.lowLipPinchTweak_curl_Rt
Example #6
0
def addLipCurlsSDKs():
    '''
    '''
    # upper lips
    coeffs = pm.group(em=True, n='CT_upperLipCurls_coeffs')
    coeffs.addAttr('leftPinch', k=True)
    coeffs.addAttr('leftSneer', k=True)
    coeffs.addAttr('leftSide', k=True)
    coeffs.addAttr('centerMid', k=True)
    coeffs.addAttr('rightSide', k=True)
    coeffs.addAttr('rightSneer', k=True)
    coeffs.addAttr('rightPinch', k=True)
    rt.connectSDK('FACE:LT_upper_pinch_lip_ctrl.rx',
    coeffs.leftPinch, {-90:1, 0:0, 90:-1})
    rt.connectSDK('FACE:LT_upper_sneer_lip_ctrl.rx',
    coeffs.leftSneer, {-90:1, 0:0, 90:-1})
    rt.connectSDK('FACE:LT_upper_side_lip_ctrl.rx',
    coeffs.leftSide, {-90:1, 0:0, 90:-1})
    rt.connectSDK('FACE:CT_upper_lip_ctrl.rx',
    coeffs.centerMid, {-90:1, 0:0, 90:-1})
    rt.connectSDK('FACE:RT_upper_sneer_lip_ctrl.rx',
    coeffs.rightSneer, {-90:1, 0:0, 90:-1})
    rt.connectSDK('FACE:RT_upper_side_lip_ctrl.rx',
    coeffs.rightSide, {-90:1, 0:0, 90:-1})
    rt.connectSDK('FACE:RT_upper_pinch_lip_ctrl.rx',
    coeffs.rightPinch, {-90:1, 0:0, 90:-1})
    
    priCtls = [nt.Transform(u'FACE:RT_upper_sneer_lip_pri_ctrl'),
                nt.Transform(u'FACE:CT_upper_lip_pri_ctrl'),
                nt.Transform(u'FACE:LT_upper_sneer_lip_pri_ctrl')]
                
    attrs = ['leftPinch',
    'leftSneer',
    'leftSide',
    'centerMid',
    'rightSide',
    'rightSneer',
    'rightPinch']
           
    import rigger.utils.modulate as modulate     
    for pCtl in priCtls:
        token = pCtl.split(':')[1].split('_')[0]
        for attr in attrs:
            mod = modulate.addInput(coeffs.attr(attr), 0, token)
            rt.connectSDK(pCtl.rx, mod, {-90:1, 0:0, 90:-1})
            
    rt.connectSDK(coeffs.leftPinch, 
    'FACE:blendShapeCt_face_geo.upLipTweakPinch_curlOut_Lf', {0:0, 1:1})
    rt.connectSDK(coeffs.leftPinch, 
    'FACE:blendShapeCt_face_geo.upLipTweakPinch_curlIn_Lf', {0:0, -1:1})
    
    rt.connectSDK(coeffs.leftSneer, 
    'FACE:blendShapeCt_face_geo.upLipTweakSneer_curlOut_Lf', {0:0, 1:1})
    rt.connectSDK(coeffs.leftSneer, 
    'FACE:blendShapeCt_face_geo.upLipTweakSneer_curlIn_Lf', {0:0, -1:1})
    
    rt.connectSDK(coeffs.leftSide, 
    'FACE:blendShapeCt_face_geo.upLipTweakSide_curlOut_Lf', {0:0, 1:1})
    rt.connectSDK(coeffs.leftSide, 
    'FACE:blendShapeCt_face_geo.upLipTweakSide_curlIn_Lf', {0:0, -1:1})
    
    rt.connectSDK(coeffs.centerMid, 
    'FACE:blendShapeCt_face_geo.upLipTweakMid_curlOut_Ct', {0:0, 1:1})
    rt.connectSDK(coeffs.centerMid, 
    'FACE:blendShapeCt_face_geo.upLipTweakMid_curlIn_Ct', {0:0, -1:1})
    
    rt.connectSDK(coeffs.rightPinch, 
    'FACE:blendShapeCt_face_geo.upLipTweakPinch_curlOut_Rt', {0:0, 1:1})
    rt.connectSDK(coeffs.rightPinch, 
    'FACE:blendShapeCt_face_geo.upLipTweakPinch_curlIn_Rt', {0:0, -1:1})
    
    rt.connectSDK(coeffs.rightSneer, 
    'FACE:blendShapeCt_face_geo.upLipTweakSneer_curlOut_Rt', {0:0, 1:1})
    rt.connectSDK(coeffs.rightSneer, 
    'FACE:blendShapeCt_face_geo.upLipTweakSneer_curlIn_Rt', {0:0, -1:1})
    
    rt.connectSDK(coeffs.rightSide, 
    'FACE:blendShapeCt_face_geo.upLipTweakSide_curlOut_Rt', {0:0, 1:1})
    rt.connectSDK(coeffs.rightSide, 
    'FACE:blendShapeCt_face_geo.upLipTweakSide_curlIn_Rt', {0:0, -1:1})
    
    # lower lips
    coeffs = pm.group(em=True, n='CT_lowerLipCurls_coeffs')
    coeffs.addAttr('leftPinch', k=True)
    coeffs.addAttr('leftSneer', k=True)
    coeffs.addAttr('leftSide', k=True)
    coeffs.addAttr('centerMid', k=True)
    coeffs.addAttr('rightSide', k=True)
    coeffs.addAttr('rightSneer', k=True)
    coeffs.addAttr('rightPinch', k=True)
    rt.connectSDK('FACE:LT_lower_pinch_lip_ctrl.rx',
    coeffs.leftPinch, {-90:-1, 0:0, 90:1})
    rt.connectSDK('FACE:LT_lower_sneer_lip_ctrl.rx',
    coeffs.leftSneer, {-90:-1, 0:0, 90:1})
    rt.connectSDK('FACE:LT_lower_side_lip_ctrl.rx',
    coeffs.leftSide, {-90:-1, 0:0, 90:1})
    rt.connectSDK('FACE:CT_lower_lip_ctrl.rx',
    coeffs.centerMid, {-90:-1, 0:0, 90:1})
    rt.connectSDK('FACE:RT_lower_sneer_lip_ctrl.rx',
    coeffs.rightSneer, {-90:-1, 0:0, 90:1})
    rt.connectSDK('FACE:RT_lower_side_lip_ctrl.rx',
    coeffs.rightSide, {-90:-1, 0:0, 90:1})
    rt.connectSDK('FACE:RT_lower_pinch_lip_ctrl.rx',
    coeffs.rightPinch, {-90:-1, 0:0, 90:1})
    
    priCtls = [nt.Transform(u'FACE:RT_lower_sneer_lip_pri_ctrl'),
                nt.Transform(u'FACE:CT_lower_lip_pri_ctrl'),
                nt.Transform(u'FACE:LT_lower_sneer_lip_pri_ctrl')]
                
    attrs = ['leftPinch',
    'leftSneer',
    'leftSide',
    'centerMid',
    'rightSide',
    'rightSneer',
    'rightPinch']
           
    import rigger.utils.modulate as modulate     
    for pCtl in priCtls:
        token = pCtl.split(':')[1].split('_')[0]
        for attr in attrs:
            mod = modulate.addInput(coeffs.attr(attr), 0, token)
            rt.connectSDK(pCtl.rx, mod, {-90:-1, 0:0, 90:1})
            
    rt.connectSDK(coeffs.leftPinch, 
    'FACE:blendShapeCt_face_geo.lowLipTweakPinch_curlOut_Lf', {0:0, 1:1})
    rt.connectSDK(coeffs.leftPinch, 
    'FACE:blendShapeCt_face_geo.lowLipTweakPinch_curlIn_Lf', {0:0, -1:1})
    
    rt.connectSDK(coeffs.leftSneer, 
    'FACE:blendShapeCt_face_geo.lowLipTweakSneer_curlOut_Lf', {0:0, 1:1})
    rt.connectSDK(coeffs.leftSneer, 
    'FACE:blendShapeCt_face_geo.lowLipTweakSneer_curlIn_Lf', {0:0, -1:1})
    
    rt.connectSDK(coeffs.leftSide, 
    'FACE:blendShapeCt_face_geo.lowLipTweakSide_curlOut_Lf', {0:0, 1:1})
    rt.connectSDK(coeffs.leftSide, 
    'FACE:blendShapeCt_face_geo.lowLipTweakSide_curlIn_Lf', {0:0, -1:1})
    
    rt.connectSDK(coeffs.centerMid, 
    'FACE:blendShapeCt_face_geo.lowLipTweakMid_curlOut_Ct', {0:0, 1:1})
    rt.connectSDK(coeffs.centerMid, 
    'FACE:blendShapeCt_face_geo.lowLipTweakMid_curlIn_Ct', {0:0, -1:1})
    
    rt.connectSDK(coeffs.rightPinch, 
    'FACE:blendShapeCt_face_geo.lowLipTweakPinch_curlOut_Rt', {0:0, 1:1})
    rt.connectSDK(coeffs.rightPinch, 
    'FACE:blendShapeCt_face_geo.lowLipTweakPinch_curlIn_Rt', {0:0, -1:1})
    
    rt.connectSDK(coeffs.rightSneer, 
    'FACE:blendShapeCt_face_geo.lowLipTweakSneer_curlOut_Rt', {0:0, 1:1})
    rt.connectSDK(coeffs.rightSneer, 
    'FACE:blendShapeCt_face_geo.lowLipTweakSneer_curlIn_Rt', {0:0, -1:1})
    
    rt.connectSDK(coeffs.rightSide, 
    'FACE:blendShapeCt_face_geo.lowLipTweakSide_curlOut_Rt', {0:0, 1:1})
    rt.connectSDK(coeffs.rightSide, 
    'FACE:blendShapeCt_face_geo.lowLipTweakSide_curlIn_Rt', {0:0, -1:1})