zbw_softDeformer.py 文件源码

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

项目:zTools 作者: zethwillie 项目源码 文件源码
def add_top_level_ctrl(origCtrl, type, geo, *args):
    """
    creates a new ctrl, orients it to the geo and parent constrains the orig ctrl rig under itself
    :param origCtrl: the control we're working from
    :param type: the ctrl type of shape see zbw_rig.createControl for options
    :param geo: the geo to orient to
    :param args:
    :return: topCtrl (the new ctrl), grp (the top ctrl grp freeze grp)
    """
    # THIS IS THE XTRA CTRL LAYER, THIS ORIENTS CTRL AND CONNECTS ORIG CTRL TO THE NEW CTRL
    origCtrlPos = cmds.xform(origCtrl, q=True, ws=True, rp=True)
    topCtrl = rig.createControl(name="{0}_moveCtrl".format(origCtrl.rpartition("_")[0]), type=type, axis="z",
                              color="yellow")
    grp = rig.groupFreeze(topCtrl)
    cmds.xform(grp, ws=True, t=origCtrlPos)
    nc = cmds.normalConstraint(geo, grp, worldUpType="vector", upVector=(0, 1, 0))
    cmds.delete(nc)
    pc = cmds.parentConstraint(topCtrl, origCtrl, mo=True)
    sc = cmds.scaleConstraint(topCtrl, origCtrl, mo=True)
    return(topCtrl, grp)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号