예제 #1
0
def combinClusters():

    clusterHandles = cmds.ls(sl=True)

    for cluster in clusterHandles:
        clusterTransform = cluster
        clusterDeformer = cmds.connectionInfo('%s.worldMatrix[0]' %
                                              clusterTransform,
                                              dfs=True)[0].split('.')[0]

        if cmds.nodeType(clusterDeformer) == 'cluster':
            DeformerLib.combineCluster(clusterHandles, True)
예제 #2
0
def transferReversedWeights(fromMesh, toMesh, fromDeformer, toDeformer):

    deformerTool = DeformerLib.WeightListTool(fromMesh, fromDeformer)
    weightList = deformerTool.reverseWeightList()

    deformerTool.__init__(toMesh, toDeformer)
    deformerTool.setWeightList(weightList)
예제 #3
0
def transferMirroredWeights(fromMesh, toMesh, fromDeformer, toDeformer, axis,
                            direction, table):

    deformerTool = DeformerLib.WeightListTool(fromMesh, fromDeformer)
    weightList = deformerTool.mirrorWeightList(axis, direction, table)

    deformerTool.__init__(toMesh, toDeformer)
    deformerTool.setMembershipList(weightList[1])
    deformerTool.setWeightList(weightList[0])
예제 #4
0
def transferWeights(fromMesh, toMesh, fromDeformer, toDeformer):

    deformerTool = DeformerLib.WeightListTool(fromMesh, fromDeformer)
    membershipList = deformerTool.getMembershipList()
    weightList = deformerTool.getWeightList()

    deformerTool.__init__(toMesh, toDeformer)
    deformerTool.setMembershipList(membershipList)
    deformerTool.setWeightList(weightList)
예제 #5
0
def clusterWeightToJoints(geo,cluster,jointFrom,jointTo):
    
    weightTool = DeformerLib.WeightListTool(geo,cluster)
    weightList = weightTool.getWeightList()
    print weightList
    
    skincluster = SkinningTool.getSkinCluster(geo)[1]
    print skincluster
    
    skinningTool = SkinningTool(skincluster,geo)
    influences = skinningTool.getInfluencesFromSkincluster()
    
    
    for i in range(influences.length()):
        cmds.setAttr('%s.liw'%influences[i].fullPathName(), 1)
        
    cmds.setAttr('%s.liw'%jointFrom, 0)
    cmds.setAttr('%s.liw'%jointTo, 0)
    
    skinningTool.setWeights(GenAPI.getDagPath(jointTo), weightList)
    print jointFrom,jointTo
예제 #6
0
def meshToCluster():

    fromMesh = cmds.ls(sl=True)[0]
    toMesh = cmds.ls(sl=True)[1]
    DeformerLib.createClusterFromMesh(fromMesh, toMesh)
예제 #7
0
def combinClusters():

    clusterHandles = cmds.ls(sl=True)
    DeformerLib.combineCluster(clusterHandles, True)
예제 #8
0
def softSelToCluster():

    DeformerLib.createClusterFromSoftSelection('SoftSelection_CL')
예제 #9
0
def extrapToExistingDeformer(deformer):

    sel = cmds.ls(sl=True)
    transform = sel[0]
    meshes = sel[1:]
    DeformerLib.extrapWeightsToExistingDeformer(transform, meshes, deformer)
예제 #10
0
def extrapToCluster(sel):

    transform = sel[0]
    meshes = sel[1:]

    DeformerLib.extrapToCluster(transform, meshes)
예제 #11
0
def softSelToCluster():
    
    DeformerLib.createClusterFromSoftSelection('SoftSelection_CL')
예제 #12
0
def flipClusterWeights(deformer, prefix, oppPrefix, direction, axis, table):

    DeformerLib.flipDeformerWeights(deformer, prefix, oppPrefix, direction,
                                    axis, table)
예제 #13
0
def extrapToCluster(sel):
    
    transform = sel[0]
    meshes = sel[1:]
    
    DeformerLib.extrapToCluster(transform,meshes)
예제 #14
0
def mirrorDeformerWeights(deformerName,prefix,oppPrefix,direction ,axis, table):
    
    DeformerLib.mirrorDeformerWeights(deformerName, prefix, oppPrefix, axis,direction, table )
예제 #15
0
def flipClusterWeights(deformer,prefix,oppPrefix,direction ,axis, table):
    
    DeformerLib.flipDeformerWeights(deformer, prefix, oppPrefix, direction, axis, table)
예제 #16
0
def mirrorDeformer(transform,deformerName,prefix,oppPrefix,direction ,axis, table):
    
    DeformerLib.mirrorCluster(transform, deformerName, prefix, oppPrefix,direction,axis, table )
예제 #17
0
def meshToCluster():
    
    fromMesh = cmds.ls(sl = True)[0]
    toMesh = cmds.ls(sl = True)[1]
    DeformerLib.createClusterFromMesh(fromMesh, toMesh)
예제 #18
0
def combinClusters():
    
    clusterHandles = cmds.ls(sl = True)
    DeformerLib.combineCluster(clusterHandles,True)
예제 #19
0
def mirrorDeformer(transform, deformerName, prefix, oppPrefix, direction, axis,
                   table):

    DeformerLib.mirrorCluster(transform, deformerName, prefix, oppPrefix,
                              direction, axis, table)
예제 #20
0
def loadClusters():
    
    filePath = cmds.fileDialog2(dialogStyle =  4,okc = 'Open', cap = 'Open')
    clusterDict = DeformerLib.WeightListTool.readWeights(filePath[0])
    DeformerLib.loadClusters(clusterDict)
예제 #21
0
def mirrorDeformerWeights(deformerName, prefix, oppPrefix, direction, axis,
                          table):

    DeformerLib.mirrorDeformerWeights(deformerName, prefix, oppPrefix, axis,
                                      direction, table)
예제 #22
0
def loadClusters():

    filePath = cmds.fileDialog2(dialogStyle=4, okc='Open', cap='Open')
    clusterDict = DeformerLib.WeightListTool.readWeights(filePath[0])
    DeformerLib.loadClusters(clusterDict)
예제 #23
0
def softSelToCluster():

    try:
        DeformerLib.createClusterFromSoftSelection('SoftSelection_CL')
    except:
        pass
예제 #24
0
def extrapToExistingDeformer(deformer):
    
    sel = cmds.ls(sl = True)
    transform = sel[0]
    meshes = sel[1:]
    DeformerLib.extrapWeightsToExistingDeformer(transform,meshes,deformer)