Beispiel #1
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 = 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')
Beispiel #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')
Beispiel #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)
Beispiel #4
0
# 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)
eye.addEyeAim(prefix='RT_', distance=25)
# BUG - version F_v003:
# eyes will flip if head ctrl is rotated. this is because Y axis is trying to
# align with world Y. this is fixed manually in v004
Beispiel #5
0
# 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)
eye.addEyeAim(prefix='RT_', distance=25)
# BUG - version F_v003:
# eyes will flip if head ctrl is rotated. this is because Y axis is trying to
# align with world Y. this is fixed manually in v004