def layer_brow(mll): ''' ''' mesh, skn = mll.getTargetInfo() mesh = pm.PyNode(mesh) jntInfs = [u'CT__brow_bnd', u'LT_in_brow_bnd', u'LT_mid_brow_bnd', u'LT_out_brow_bnd', u'LT_in_forehead_bnd', u'LT_out_forehead_bnd', u'LT__temple_bnd'] periLocs = [u'RT_in_forehead_pLoc', u'LT_in_forehead_pLoc', u'LT_out_forehead_pLoc', u'LT__temple_pLoc', u'LT_out_brow_pLoc', u'LT_mid_brow_pLoc', u'LT_in_brow_pLoc', u'CT__brow_pLoc', u'RT_in_brow_pLoc'] # calc vecScales # based on distance from browLoc to eyelidLoc midBrowLoc = pm.PyNode('LT_mid_brow_bnd') upLidLoc = pm.PyNode('LT_upper_eyelid_pLoc') distance = (pm.dt.Point(midBrowLoc.getTranslation(space='world')) - pm.dt.Point(upLidLoc.getTranslation(space='world'))).length() print distance inMaskVec = 0.85 * distance print inMaskVec outMaskVec = 1.5 * distance print outMaskVec inMaskInfsGrp = layer_weighting.addPerimeterBndSystem(mesh, periLocs, vecScale=inMaskVec, suffix='_in') inMaskInfs = inMaskInfsGrp.getChildren(ad=True, type='joint') inMaskInfs = [inf.name() for inf in inMaskInfs] outMaskInfsGrp = layer_weighting.addPerimeterBndSystem(mesh, periLocs, vecScale=outMaskVec, suffix='_out') outMaskInfs = outMaskInfsGrp.getChildren(ad=True, type='joint') outMaskInfs = [inf.name() for inf in outMaskInfs] layerInfo = 'Brow', jntInfs, inMaskInfs, outMaskInfs layerId = layer_weighting.buildLayer(mll, layerInfo) layer_weighting.mirrorLayer(mll, layerId) layer_weighting.smoothLayerMask(mll, layerId, [10.0, 20.0, 10.0]) layer_weighting.relaxLayerInfluences(mll, layerId, [41,23], [0.2333,0.0941]) pm.delete(outMaskInfsGrp, inMaskInfsGrp)
def layer_jaw(mll): ''' ''' mesh, skn = mll.getTargetInfo() mesh = pm.PyNode(mesh) jntInfs = [u'LT_in_cheek_bnd', u'LT_up_cheek_bnd', u'LT__squint_bnd', u'LT_up_jaw_bnd', u'LT_corner_jaw_bnd', u'LT__neck_bnd', u'CT__neck_bnd'] periLocs = [u'RT_in_cheek_pLoc', u'LT_in_cheek_pLoc', u'LT_up_cheek_pLoc', u'LT__squint_pLoc', u'LT_up_jaw_pLoc', u'LT_corner_jaw_pLoc', u'LT__neck_pLoc', u'CT__neck_pLoc', u'RT__neck_pLoc'] maskInfsGrp = layer_weighting.addPerimeterBndSystem(mesh, periLocs) maskInfs = maskInfsGrp.getChildren(ad=True, type='joint') maskInfs = [inf.name() for inf in maskInfs] layerInfo = 'Jaw', jntInfs, jntInfs, maskInfs layerId = layer_weighting.buildLayer(mll, layerInfo) layer_weighting.mirrorLayer(mll, layerId) layer_weighting.smoothLayerMask(mll, layerId, [2.0, 2.0, 2.0]) layer_weighting.relaxLayerInfluences(mll, layerId, [41,41,41], [0.2333,0.2333,0.2333]) pm.delete(maskInfsGrp)
def layer_brow(mll): ''' ''' mesh, skn = mll.getTargetInfo() mesh = pm.PyNode(mesh) jntInfs = [u'CT__brow_bnd', u'LT_in_brow_bnd', u'LT_mid_brow_bnd', u'LT_out_brow_bnd', u'LT_in_forehead_bnd', u'LT_out_forehead_bnd', u'LT__temple_bnd'] periLocs = [u'RT_in_forehead_pLoc', u'LT_in_forehead_pLoc', u'LT_out_forehead_pLoc', u'LT__temple_pLoc', u'LT_out_brow_pLoc', u'LT_mid_brow_pLoc', u'LT_in_brow_pLoc', u'CT__brow_pLoc', u'RT_in_brow_pLoc'] inMaskInfsGrp = layer_weighting.addPerimeterBndSystem(mesh, periLocs, vecScale=0.125, suffix='_in') inMaskInfs = inMaskInfsGrp.getChildren(ad=True, type='joint') inMaskInfs = [inf.name() for inf in inMaskInfs] outMaskInfsGrp = layer_weighting.addPerimeterBndSystem(mesh, periLocs, vecScale=0.22, suffix='_out') outMaskInfs = outMaskInfsGrp.getChildren(ad=True, type='joint') outMaskInfs = [inf.name() for inf in outMaskInfs] layerInfo = 'Brow', jntInfs, inMaskInfs, outMaskInfs layerId = layer_weighting.buildLayer(mll, layerInfo) layer_weighting.mirrorLayer(mll, layerId) ''' layer_weighting.smoothLayerMask(mll, layerId, [10.0, 20.0, 10.0]) layer_weighting.relaxLayerInfluences(mll, layerId, [41,23], [0.2333,0.0941])''' pm.delete(outMaskInfsGrp, inMaskInfsGrp)
def layer_brow(mll): ''' ''' mesh, skn = mll.getTargetInfo() mesh = pm.PyNode(mesh) jntInfs = [u'CT__brow_bnd', u'LT_in_brow_bnd', u'LT_mid_brow_bnd', u'LT_out_brow_bnd', u'LT_in_forehead_bnd', u'LT_out_forehead_bnd', u'LT__temple_bnd'] periLocs = [u'RT_in_forehead_pLoc', u'LT_in_forehead_pLoc', u'LT_out_forehead_pLoc', u'LT__temple_pLoc', u'LT_out_brow_pLoc', u'LT_mid_brow_pLoc', u'LT_in_brow_pLoc', u'CT__brow_pLoc', u'RT_in_brow_pLoc'] inMaskInfsGrp = layer_weighting.addPerimeterBndSystem(mesh, periLocs, vecScale=1.0, suffix='_in') inMaskInfs = inMaskInfsGrp.getChildren(ad=True, type='joint') inMaskInfs = [inf.name() for inf in inMaskInfs] outMaskInfsGrp = layer_weighting.addPerimeterBndSystem(mesh, periLocs, vecScale=1.75, suffix='_out') outMaskInfs = outMaskInfsGrp.getChildren(ad=True, type='joint') outMaskInfs = [inf.name() for inf in outMaskInfs] layerInfo = 'Brow', jntInfs, inMaskInfs, outMaskInfs layerId = layer_weighting.buildLayer(mll, layerInfo) layer_weighting.mirrorLayer(mll, layerId) layer_weighting.smoothLayerMask(mll, layerId, [10.0, 20.0, 10.0]) layer_weighting.relaxLayerInfluences(mll, layerId, [41,23], [0.2333,0.0941]) pm.delete(outMaskInfsGrp, inMaskInfsGrp)
def layer_neck(mll): ''' ''' mesh, skn = mll.getTargetInfo() mesh = pm.PyNode(mesh) jntInfs = [u'LT__squint_bnd', u'LT_up_jaw_bnd', u'LT_corner_jaw_bnd', u'LT__neck_bnd', u'CT__neck_bnd'] periLocs = [u'RT_in_cheek_pLoc', u'LT_in_cheek_pLoc', u'LT_up_cheek_pLoc', u'LT__squint_pLoc', u'LT_up_jaw_pLoc', u'LT_corner_jaw_pLoc', u'LT__neck_pLoc', u'CT__neck_pLoc', u'RT__neck_pLoc'] # calc vector scale # based of pLoc scale locScale = pm.PyNode('CT_placement_grp').locScale.get() vecScale = locScale * 6.25 maskInfsGrp = layer_weighting.addPerimeterBndSystem(mesh, periLocs, vecScale=vecScale) maskInfs = maskInfsGrp.getChildren(ad=True, type='joint') maskInfs = [inf.name() for inf in maskInfs] layerInfo = 'Neck', jntInfs, jntInfs, maskInfs layerId = layer_weighting.buildLayer(mll, layerInfo) layer_weighting.mirrorLayer(mll, layerId) layer_weighting.smoothLayerMask(mll, layerId, [2.0, 2.0, 2.0]) layer_weighting.relaxLayerInfluences(mll, layerId, [41,41,41], [0.2333,0.2333,0.2333]) pm.delete(maskInfsGrp)