Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
2.3 kB
3
Indexable
Never
import maya.cmds as mc

def FingTweak():
    srName = ['R_PinkyKnucle_Sr','R_MidKnucle_Sr','R_IndexKnucle_Sr',
    'R_PinkyCrease_Sr','R_MidCrease_Sr','R_IndexCrease_Sr']
    DrvCtrl = ['R_ShirtKnuckleTweekA_Main_Drv','R_ShirtKnuckleTweekB_Main_Drv','R_ShirtKnuckleTweekC_Main_Drv',
    'R_ShirtKnuckleTweekF_Main_Drv','R_ShirtKnuckleTweekE_Main_Drv','R_ShirtKnuckleTweekD_Main_Drv']
    DrvJnt = ['R_Pinky_A_Bind_Jnt','R_Middle_A_Bind_Jnt','R_Index_A_Bind_Jnt','R_Pinky_A_Bind_Jnt','R_Middle_A_Bind_Jnt','R_Index_A_Bind_Jnt']
    
    zip_object = zip(srName, DrvCtrl,DrvJnt)

    for sr,dc,dj in zip_object:

        mc.createNode('setRange', n=sr)
        mc.connectAttr(dj + '.rotateX', sr + '.valueX')
        mc.connectAttr(dj + '.rotateX', sr + '.valueY')
        mc.connectAttr(dj + '.rotateX', sr + '.valueZ')
        mc.connectAttr(sr + '.outValueX', dc + '.translateX')
        mc.connectAttr(sr + '.outValueY', dc + '.translateY')
        mc.connectAttr(sr + '.outValueZ', dc + '.translateZ')
        
    # R_PinkyKnucle_Sr Values
    mc.setAttr(srName[0] + '.oldMaxY', 30)
    mc.setAttr(srName[0] + '.oldMaxZ', 30)
    mc.setAttr(srName[0] + ".maxY", -0.25)
    mc.setAttr(srName[0] + ".maxZ", 0.15)
    
    # R_MidKnucle_Sr Values
    mc.setAttr(srName[1] + '.oldMaxY', 30)
    mc.setAttr(srName[1] + '.oldMaxZ', 30)
    mc.setAttr(srName[1] + ".maxY", -0.25)
    mc.setAttr(srName[1] + ".maxZ", 0)
    
    # R_IndexKnucle_Sr
    mc.setAttr(srName[2] + '.oldMaxY', 30)
    mc.setAttr(srName[2] + '.oldMaxZ', 30)
    mc.setAttr(srName[2] + ".maxY", -0.25)
    mc.setAttr(srName[2] + ".maxZ", -0.25)
    
    # R_PinkyCrease_Sr Values
    mc.setAttr(srName[3] + '.oldMinY', -30)
    mc.setAttr(srName[3] + '.oldMinZ', -30)
    mc.setAttr(srName[3] + ".minY", 0.25)
    mc.setAttr(srName[3] + ".minZ", 0.25)
    
    # R_MidCrease_Sr Values
    mc.setAttr(srName[4] + '.oldMinY', -30)
    mc.setAttr(srName[4] + '.oldMinZ', -30)
    mc.setAttr(srName[4] + ".minY", 0.25)
    mc.setAttr(srName[4] + ".minZ", 0)
    
    # R_IndexCrease_Sr
    mc.setAttr(srName[5] + '.oldMinY', -30)
    mc.setAttr(srName[5] + '.oldMinZ', -30)
    mc.setAttr(srName[5] + ".minY", 0.25)
    mc.setAttr(srName[5] + ".minZ", -0.25)
    
    
    
FingTweak()