Esempio n. 1
0
    def selectNextItem(self):
        '''
        '''
        if self.txt_jntCurrent.getLabel() == 'Select mouth lips loop':

            self.txt_jntCurrent.setLabel('Select left eyelid loop')
            fullRefPath = self.imageRefPath + "LT_eyeLidLoop.jpg"
            pm.image(self.img_jntReference, image=fullRefPath, e=True)

            # assign selection to placement_grp attr
            sel = pm.ls(sl=True, fl=True)
            self.placementGrp.addAttr('mouthLipsLoop', dt='stringArray')
            self.placementGrp.attr('mouthLipsLoop').set(len(sel),
                                                        *sel,
                                                        type='stringArray')
            pm.select(cl=True)

            placementGrp.addMouthLoopPlacements(self.placementGrp)

        elif self.txt_jntCurrent.getLabel() == 'Select left eyelid loop':
            # READY!
            self.txt_jntCurrent.setLabel('Ready to Build!')
            fullRefPath = self.imageRefPath + "default.jpg"
            pm.image(self.img_jntReference, image=fullRefPath, e=True)
            self.btn_jntScrollRt.setEnable(False)
            self.btn_updateLocs.setEnable(True)
            self.btn_buildRig.setEnable(True)
            pm.setToolTo('selectSuperContext')

            # assign selection to placement_grp attr
            sel = pm.ls(sl=True, fl=True)
            self.placementGrp.addAttr('leftEyelidLoop', dt='stringArray')
            self.placementGrp.attr('leftEyelidLoop').set(len(sel),
                                                         *sel,
                                                         type='stringArray')

            placementGrp.addEyeLoopPlacements(self.placementGrp)
            # override for mathilda
            # placementGrp.addEyeLoopPlacements(self.placementGrp, [23,15,9,3])
            # mathilda_override
            # pm.PyNode('LT_innerUpper_eyelid_pLoc').cv_id.set(18)

            placementGrp.addIndependentPlacers(self.placementGrp,
                                               self.indMapping)

            # align jaw pLoc
            cons = mc.aimConstraint('CT__mouthMover_pLoc',
                                    'CT__jaw_pLoc',
                                    aim=[0, 0, 1],
                                    u=[1, 0, 0],
                                    wu=[1, 0, 0])
            mc.delete(cons)

            pm.selectMode(object=True)
            mel.setObjectPickMask("Surface", False)

            placementGrp.snapPlacementsToMesh(self.placementGrp)
            placementGrp.mirrorAllPlacements(self.placementGrp)
            placementGrp.orientAllPlacements(self.placementGrp)
Esempio n. 2
0
 def selectNextItem(self):
     '''
     '''
     if self.txt_jntCurrent.getLabel() == 'Select mouth lips loop':
         
         self.txt_jntCurrent.setLabel('Select left eyelid loop')
         fullRefPath = self.imageRefPath + "LT_eyeLidLoop.jpg"
         pm.image(self.img_jntReference, image=fullRefPath, e=True)
         
         # assign selection to placement_grp attr
         sel = pm.ls(sl=True, fl=True)
         self.placementGrp.addAttr('mouthLipsLoop', dt='stringArray')
         self.placementGrp.attr('mouthLipsLoop').set(len(sel), *sel, type='stringArray')
         pm.select(cl=True)
         
         placementGrp.addMouthLoopPlacements(self.placementGrp)
         
     elif self.txt_jntCurrent.getLabel() == 'Select left eyelid loop':
         # READY!
         self.txt_jntCurrent.setLabel('Ready to Build!')
         fullRefPath = self.imageRefPath + "default.jpg"
         pm.image(self.img_jntReference, image=fullRefPath, e=True)
         self.btn_jntScrollRt.setEnable(False)
         self.btn_updateLocs.setEnable(True)
         self.btn_buildRig.setEnable(True)
         pm.setToolTo('selectSuperContext')
         
         # assign selection to placement_grp attr
         sel = pm.ls(sl=True, fl=True)
         self.placementGrp.addAttr('leftEyelidLoop', dt='stringArray')
         self.placementGrp.attr('leftEyelidLoop').set(len(sel), *sel, type='stringArray')
         
         placementGrp.addEyeLoopPlacements(self.placementGrp)
         # override for mathilda
         # placementGrp.addEyeLoopPlacements(self.placementGrp, [23,15,9,3])
         # mathilda_override
         # pm.PyNode('LT_innerUpper_eyelid_pLoc').cv_id.set(18)
         
         placementGrp.addIndependentPlacers(self.placementGrp, self.indMapping)
         
         # align jaw pLoc
         cons = mc.aimConstraint('CT__mouthMover_pLoc', 'CT__jaw_pLoc',
                                 aim=[0,0,1], u=[1,0,0], wu=[1,0,0])
         mc.delete(cons)
         
         pm.selectMode(object=True)
         mel.setObjectPickMask("Surface", False)
         
         placementGrp.snapPlacementsToMesh(self.placementGrp)
         placementGrp.mirrorAllPlacements(self.placementGrp)
         placementGrp.orientAllPlacements(self.placementGrp)
Esempio n. 3
0
def buildEyeShaper():
    createLattice(
        [nt.Transform(u"LT_eyeball_geo"), nt.Transform(u"RT_eyeball_geo")],
        [nt.Mesh(u"CT_face_geoShape"), nt.Mesh(u"LT_brow_geoShape"), nt.Mesh(u"RT_brow_geoShape")],
    )

    # add placement locs
    pGrp = nt.Transform(u"CT_eyeLattice_placement_grp")
    import rigger.modules.placementGrp as placementGrp

    reload(placementGrp)
    placementGrp.mirrorAllPlacements(pGrp)

    # create bnds
    import rigger.modules.face as face

    bndGrp = face.createBndsFromPlacement(pGrp)
    # motion sys
    # mesh is passed in for legacy reasons
    face.buildSecondaryControlSystem(pGrp, bndGrp, mesh=None)

    priCtlMappings = {
        "LT_midUp_eyeShaper_pri_ctrl": {
            u"LT_inUp_eyeShaper_bnd": 1,
            u"LT_midUp_eyeShaper_bnd": 1,
            u"LT_outUp_eyeShaper_bnd": 1,
        },
        "LT_midLow_eyeShaper_pri_ctrl": {
            u"LT_inLow_eyeShaper_bnd": 1,
            u"LT_midLow_eyeShaper_bnd": 1,
            u"LT_outLow_eyeShaper_bnd": 1,
        },
        "RT_midUp_eyeShaper_pri_ctrl": {
            u"RT_inUp_eyeShaper_bnd": 1,
            u"RT_midUp_eyeShaper_bnd": 1,
            u"RT_outUp_eyeShaper_bnd": 1,
        },
        "RT_midLow_eyeShaper_pri_ctrl": {
            u"RT_inLow_eyeShaper_bnd": 1,
            u"RT_midLow_eyeShaper_bnd": 1,
            u"RT_outLow_eyeShaper_bnd": 1,
        },
    }
    import rigger.modules.priCtl as priCtl

    reload(priCtl)
    priCtl.setupPriCtlSecondPass(priCtlMappings)
Esempio n. 4
0
def buildEyeShaper():
    createLattice(
        [nt.Transform(u'LT_eyeball_geo'),
         nt.Transform(u'RT_eyeball_geo')], [
             nt.Mesh(u'CT_face_geoShape'),
             nt.Mesh(u'LT_brow_geoShape'),
             nt.Mesh(u'RT_brow_geoShape')
         ])

    # add placement locs
    pGrp = nt.Transform(u'CT_eyeLattice_placement_grp')
    import rigger.modules.placementGrp as placementGrp
    reload(placementGrp)
    placementGrp.mirrorAllPlacements(pGrp)

    # create bnds
    import rigger.modules.face as face
    bndGrp = face.createBndsFromPlacement(pGrp)
    # motion sys
    # mesh is passed in for legacy reasons
    face.buildSecondaryControlSystem(pGrp, bndGrp, mesh=None)

    priCtlMappings = {
        'LT_midUp_eyeShaper_pri_ctrl': {
            u'LT_inUp_eyeShaper_bnd': 1,
            u'LT_midUp_eyeShaper_bnd': 1,
            u'LT_outUp_eyeShaper_bnd': 1
        },
        'LT_midLow_eyeShaper_pri_ctrl': {
            u'LT_inLow_eyeShaper_bnd': 1,
            u'LT_midLow_eyeShaper_bnd': 1,
            u'LT_outLow_eyeShaper_bnd': 1
        },
        'RT_midUp_eyeShaper_pri_ctrl': {
            u'RT_inUp_eyeShaper_bnd': 1,
            u'RT_midUp_eyeShaper_bnd': 1,
            u'RT_outUp_eyeShaper_bnd': 1
        },
        'RT_midLow_eyeShaper_pri_ctrl': {
            u'RT_inLow_eyeShaper_bnd': 1,
            u'RT_midLow_eyeShaper_bnd': 1,
            u'RT_outLow_eyeShaper_bnd': 1
        }
    }
    import rigger.modules.priCtl as priCtl
    reload(priCtl)
    priCtl.setupPriCtlSecondPass(priCtlMappings)
Esempio n. 5
0
 def mirrorLocs(self):
     placementGrp.mirrorAllPlacements(self.placementGrp)
Esempio n. 6
0
# Align for sliding
slidingBnds = data.slidingBnds
for eachBnd in slidingBnds:
    rt.alignTransformToMesh(eachBnd, mesh, method='sliding')

# manual orienting and tweaking
# notes:
# cheek locs should have Y-up, so they can translate up and make a bulge, etc
# align jaw locs along jawline
# brow neg-Y should point outwards to maintain brow volume
    
#------------------------------------------------------------------------------ 
# Mirror
placementGrp.snapPlacementsToMesh(pGrp)
placementGrp.mirrorAllPlacements(pGrp)
pDict = data.placeLocXforms
placementGrp.setPlacementGrpFromDict(pGrp, pDict)
#===============================================================================
# BUILD BNDS
# start - mathilda_facerigB_v003.ma
# mathilda_facerigB_v005.ma (update geometry with lips closed)
# mathilda_facerigB_v006.ma (update loc orientations)
#===============================================================================
bndGrp = face.createBndsFromPlacement(pGrp)
face.buildSecondaryControlSystem(pGrp, bndGrp, mesh)
priCtls = face.buildPrimaryControlSystem()
perimeterGrp = face.addPerimeterBndSystem(mesh)
mll = face.createSkinLayers(mesh)

#------------------------------------------------------- SET PRIMARY CTL WEIGHTS
Esempio n. 7
0
# Align for sliding
slidingBnds = data.slidingBnds
for eachBnd in slidingBnds:
    rt.alignTransformToMesh(eachBnd, mesh, method='sliding')

# manual orienting and tweaking
# notes:
# cheek locs should have Y-up, so they can translate up and make a bulge, etc
# align jaw locs along jawline
# brow neg-Y should point outwards to maintain brow volume

#------------------------------------------------------------------------------
# Mirror
placementGrp.snapPlacementsToMesh(pGrp)
placementGrp.mirrorAllPlacements(pGrp)
pDict = data.placeLocXforms
placementGrp.setPlacementGrpFromDict(pGrp, pDict)
#===============================================================================
# BUILD BNDS
# start - mathilda_facerigB_v003.ma
# mathilda_facerigB_v005.ma (update geometry with lips closed)
# mathilda_facerigB_v006.ma (update loc orientations)
#===============================================================================
bndGrp = face.createBndsFromPlacement(pGrp)
face.buildSecondaryControlSystem(pGrp, bndGrp, mesh)
priCtls = face.buildPrimaryControlSystem()
perimeterGrp = face.addPerimeterBndSystem(mesh)
mll = face.createSkinLayers(mesh)

#------------------------------------------------------- SET PRIMARY CTL WEIGHTS
Esempio n. 8
0
 def mirrorLocs(self):
     placementGrp.mirrorAllPlacements(self.placementGrp)