def buildEyeRig(pGrp):
    #--------------------------------------------------------- ADD LEFT EYE DEFORMER
    edgeLoop = [pm.PyNode(edge) for edge in pGrp.leftEyelidLoop.get()]
    eyePivot = pm.PyNode('LT_eyeball_geo')
    rigidLoops = 2
    falloffLoops = 6
    eye.buildEyeRigCmd('LT_eye', eyePivot, edgeLoop, rigidLoops, falloffLoops)

    #---------------------------------------------------------- RIGHT EYE DEFORMER
    # sym table - switch off deformers first to get perfect sym
    pm.PyNode('skinCluster1').envelope.set(0)
    symTable = sym.buildSymTable('CT_face_geo')
    pm.PyNode('skinCluster1').envelope.set(1)
    # mirror loop to right side
    pm.select(edgeLoop)
    mel.ConvertSelectionToVertices()
    vertsLoop = mc.ls(sl=True, fl=True)
    sym.flipSelection(vertsLoop, symTable)
    mel.ConvertSelectionToContainedEdges()
    edgeLoop = pm.ls(sl=True)
    eyePivot = pm.PyNode('RT_eyeball_geo')
    eye.buildEyeRigCmd('RT_eye', eyePivot, edgeLoop, rigidLoops, falloffLoops)

    weights.setEyelidLoopWeights('LT')
    weights.setEyelidLoopWeights('RT')
Exemple #2
0
def buildEyeRig(pGrp):
    #--------------------------------------------------------- ADD LEFT EYE DEFORMER
    edgeLoop = [pm.PyNode(edge) for edge in pGrp.leftEyelidLoop.get()]
    eyePivot = pm.PyNode('LT_eyeball_geo')
    rigidLoops = 2
    falloffLoops = 8
    eye.buildEyeRigCmd('LT_eye', eyePivot, edgeLoop, rigidLoops, falloffLoops)
    
    #---------------------------------------------------------- RIGHT EYE DEFORMER
    # sym table - switch off deformers first to get perfect sym
    pm.PyNode('skinCluster1').envelope.set(0)
    symTable = sym.buildSymTable('CT_face_geo')
    pm.PyNode('skinCluster1').envelope.set(1)
    # mirror loop to right side
    pm.select(edgeLoop)
    mel.ConvertSelectionToVertices()
    vertsLoop = mc.ls(sl=True, fl=True)
    sym.flipSelection(vertsLoop, symTable)
    mel.ConvertSelectionToContainedEdges()
    edgeLoop = pm.ls(sl=True)
    eyePivot = pm.PyNode('RT_eyeball_geo')
    eye.buildEyeRigCmd('RT_eye', eyePivot, edgeLoop, rigidLoops, falloffLoops)
    
    weights.setEyelidLoopWeights('LT')
    weights.setEyelidLoopWeights('RT')
Exemple #3
0
def buildEyeRig(pGrp):
    
    #--------------------------------------------------------- ADD LEFT EYE DEFORMER
    edgeLoop = [pm.PyNode(edge) for edge in pGrp.leftEyelidLoop.get()]
    eyePivot = pm.PyNode('LT_eyeball_geo')
    rigidLoops = 2
    falloffLoops = 4
    eye.buildEyeRigCmd('LT_eye', eyePivot, edgeLoop, rigidLoops, falloffLoops)
    
    #---------------------------------------------------------- RIGHT EYE DEFORMER
    # sym table - switch off deformers first to get perfect sym
    pm.PyNode('skinCluster1').envelope.set(0)
    symTable = sym.buildSymTable('CT_face_geo')
    pm.PyNode('skinCluster1').envelope.set(1)
    # mirror loop to right side
    pm.select(edgeLoop)
    mel.ConvertSelectionToVertices()
    vertsLoop = mc.ls(sl=True, fl=True)
    sym.flipSelection(vertsLoop, symTable)
    mel.ConvertSelectionToContainedEdges()
    edgeLoop = pm.ls(sl=True)
    eyePivot = pm.PyNode('RT_eyeball_geo')
    eye.buildEyeRigCmd('RT_eye', eyePivot, edgeLoop, rigidLoops, falloffLoops)
    

    def assignEyelidBndNames(prefix):

        upperBnds = [nt.Joint(prefix+'_inner_eyelid_bnd'),
                     nt.Joint(prefix+'_upperInner_eyelid_bnd'),
                     nt.Joint(prefix+'_upper_eyelid_bnd'),
                     nt.Joint(prefix+'_upperOuter_eyelid_bnd'),
                     nt.Joint(prefix+'_outer_eyelid_bnd')]
        lowerBnds = [nt.Joint(prefix+'_inner_eyelid_bnd'),
                     nt.Joint(prefix+'_lowerInner_eyelid_bnd'),
                     nt.Joint(prefix+'_lower_eyelid_bnd'),
                     nt.Joint(prefix+'_lowerOuter_eyelid_bnd'),
                     nt.Joint(prefix+'_outer_eyelid_bnd')]
        return upperBnds, lowerBnds
    upperBnds, lowerBnds = assignEyelidBndNames('LT')
    weights.setEyelidLoopWeights('LT', upperBnds, lowerBnds)
    upperBnds, lowerBnds = assignEyelidBndNames('RT')
    weights.setEyelidLoopWeights('RT', upperBnds, lowerBnds)
Exemple #4
0
# motion weights cleanup

#===============================================================================
# POST-BUILD ADD-ON FEATURES
# mathilda_facerigB_v008.ma
#===============================================================================

#--------------------------------------------------------- ADD LEFT EYE DEFORMER
edgeLoop = [pm.PyNode(edge) for edge in pGrp.leftEyelidLoop.get()]
eyePivot = pm.PyNode('LT_eyeball_geo')
rigidLoops = 2
falloffLoops = 4
eye.buildEyeRigCmd('LT_eye', eyePivot, edgeLoop, rigidLoops, falloffLoops)

#---------------------------------------------------------- RIGHT EYE DEFORMER
symTable = sym.buildSymTable('CT_face_geo')
pm.select(edgeLoop)
mel.ConvertSelectionToVertices()
vertsLoop = mc.ls(sl=True, fl=True)
sym.flipSelection(vertsLoop, symTable)
mel.ConvertSelectionToContainedEdges()
edgeLoop = pm.ls(sl=True)
eyePivot = pm.PyNode('RT_eyeball_geo')
eye.buildEyeRigCmd('RT_eye', eyePivot, edgeLoop, rigidLoops, falloffLoops)

weights.setEyelidLoopWeights('LT')
weights.setEyelidLoopWeights('RT')

#------------------------------------------ EYEBALL RIG (SIMPLE AIM CONSTRAINTS)
eye.buildEyeballRig()
eye.addEyeAim(prefix='LT_', distance=25)
# motion weights cleanup

#===============================================================================
# POST-BUILD ADD-ON FEATURES
# mathilda_facerigB_v008.ma
#===============================================================================

#--------------------------------------------------------- ADD LEFT EYE DEFORMER
edgeLoop = [pm.PyNode(edge) for edge in pGrp.leftEyelidLoop.get()]
eyePivot = pm.PyNode('LT_eyeball_geo')
rigidLoops = 2
falloffLoops = 4
eye.buildEyeRigCmd('LT_eye', eyePivot, edgeLoop, rigidLoops, falloffLoops)

#---------------------------------------------------------- RIGHT EYE DEFORMER
symTable = sym.buildSymTable('CT_face_geo')
pm.select(edgeLoop)
mel.ConvertSelectionToVertices()
vertsLoop = mc.ls(sl=True, fl=True)
sym.flipSelection(vertsLoop, symTable)
mel.ConvertSelectionToContainedEdges()
edgeLoop = pm.ls(sl=True)
eyePivot = pm.PyNode('RT_eyeball_geo')
eye.buildEyeRigCmd('RT_eye', eyePivot, edgeLoop, rigidLoops, falloffLoops)

weights.setEyelidLoopWeights('LT')
weights.setEyelidLoopWeights('RT')

#------------------------------------------ EYEBALL RIG (SIMPLE AIM CONSTRAINTS)
eye.buildEyeballRig()
eye.addEyeAim(prefix='LT_', distance=25)