zbw_rigTools.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:zTools 作者: zethwillie 项目源码 文件源码
def copySkinning(*args):
    """select the orig bound mesh, then the new unbound target mesh and run"""

    sel = cmds.ls(sl=True)
    orig = sel[0]
    target = sel[1]

    #get orig obj joints
    try:
        jnts = cmds.skinCluster(orig, q=True, influence = True)
    except:
        cmds.warning("couldn't get skin weights from {}".format(orig))

    #bind the target with the jnts
    try:
        targetClus = cmds.skinCluster(jnts, target, bindMethod=0, skinMethod=0, normalizeWeights=1, maximumInfluences = 3, obeyMaxInfluences=False, tsb=True)[0]
        print targetClus
    except:
        cmds.warning("couln't bind to {}".format(target))

    #get skin clusters
    origClus = mel.eval("findRelatedSkinCluster " + orig)

    #copy skin weights from orig to target
    try:
        cmds.copySkinWeights(ss=origClus, ds=targetClus, noMirror=True, sa="closestPoint", ia="closestJoint")
    except:
        cmds.warning("couldn't copy skin weights from {0} to {1}".format(orig, target))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号