def autoSkin(self, paralelLoops=5, holdJoint=None): skinCls = skinTools.findSkinCluster(self.mesh) edgeloop = self.upEdgeLoop + self.lowEdgeLoop if not skinCls: pm.skinCluster(self.mesh, holdJoint) influencesToAdd = self.skinJoints else: influenceList = pm.skinCluster(skinCls, query=True, influence=True) influencesToAdd = [ x for x in self.skinJoints if x not in influenceList ] pm.skinCluster(skinCls, e=True, ai=influencesToAdd, wt=0) vtx = vtxWalk.edgeLoopToVextex(edgeloop) pm.skinPercent(skinCls, vtx, resetToDefault=True) skinTools.edgeSkin(edgeLoopOriginal=edgeloop, paralelLoopNum=5)
def autoSkinEdgeLoop(edgeLoop=None, paralelLoops=5, jointList=None, holdJoint=None): mesh = pm.ls(edgeLoop[0], o=True)[0] skinCls = findSkinCluster(mesh) if not skinCls: pm.skinCluster(mesh, holdJoint) influencesToAdd = jointList else: influenceList = pm.skinCluster(skinCls, query=True, influence=True) influencesToAdd = [x for x in skinJoints if x not in influenceList] pm.skinCluster(skinCls, e=True, ai=influencesToAdd, wt=0) vtx = vtxWalk.edgeLoopToVextex(edgeLoop) pm.skinPercent(skinCls, vtx, resetToDefault=True) skinTools.edgeSkin(edgeLoopOriginal=edgeLoop, paralelLoopNum=5)
def autoSkin(self, mesh=None, paralelLoopNum=3, holdJoint=None): edgeloop1 = vtxWalk.getLoopByLocators(mesh=mesh, loc1=self.inCorner, loc2=self.outCorner, loc3=self.upCorner) edgeloop2 = vtxWalk.getLoopByLocators(mesh=mesh, loc1=self.inCorner, loc2=self.outCorner, loc3=self.lowCorner) edgeloop=edgeloop1+edgeloop2 skinCls = skinTools.findSkinCluster(mesh=mesh) if not skinCls: pm.skinCluster(self.mesh, holdJoint) influencesToAdd = self.skinJoints else: influenceList = pm.skinCluster(skinCls, query=True, influence=True) influencesToAdd = [x for x in self.skinJoints if x not in influenceList] print influencesToAdd pm.skinCluster(skinCls, e=True, ai=influencesToAdd, wt=0) vtx = vtxWalk.edgeLoopToVextex(edgeloop) pm.skinPercent(skinCls, vtx, resetToDefault=True) skinTools.edgeSkin(edgeLoopOriginal=edgeloop, paralelLoopNum=paralelLoopNum)
import autoRig3.dev.stickyLips as stickyLips import pymel.core as pm import autoRig3.tools.skinTools as skinTools import autoRig3.tools.vertexWalkTools as vtxWalk edges = pm.ls(sl=True, fl=True) x = stickyLips.StickyLips() x.doGuide(edgeLoop=edges) x.doRig(iniOffset=True) edges2 = pm.ls(sl=True, fl=True) skinTools.edgeSkin(edgeLoopOriginal=edges2, paralelLoopNum=4) skinJoints = pm.ls('L_stick*_Offset') print skinJoints sk = [y for y in [x.getChildren() for x in skinJoints]] print sk
total = len(L_jointsUp) incr = 20.0/total-1 print incr for i, jnts in enumerate(zip(L_jointsUp, L_jointsLw)): print i, jnts print incr*i stickyPairSetup(name='L_sticky'+str(i), upperJnt=jnts[0], lowerJnt=jnts[1], ctrl1=L_ctrl, ctrl2=R_ctrl, stickyMin1=incr*i, stickyMin2=40-incr*(i+1), stickyMax1=incr*(i+1), stickyMax2=40-incr*i, iniOffset=False) stickyPairSetup(name='mid_sticky', upperJnt=jntUpper, lowerJnt=jntLower, ctrl1=L_ctrl, ctrl2=R_ctrl, stickyMin1=total, stickyMin2=40-total-incr, stickyMax1=total+incr, stickyMax2=40-incr, iniOffset=False) for i, jnts in enumerate(zip(R_jointsUp, R_jointsLw)): print i, jnts print incr*i stickyPairSetup(name='R_sticky'+str(i), upperJnt=jnts[0], lowerJnt=jnts[1], ctrl1=R_ctrl, ctrl2=L_ctrl, stickyMin1=incr*i, stickyMin2=40-incr*(i+1), stickyMax1=incr*(i+1), stickyMax2=40-incr*i, iniOffset=False) edgeloop = pm.ls(sl=True, fl=True) skinTools.edgeSkin(edgeLoopOriginal=edgeloop, paralelLoopNum= 2)