zbw_rig.py 文件源码

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

项目:zTools 作者: zethwillie 项目源码 文件源码
def doubleProxyCtrlGrp(ctrl = "", *args):
    """
    creates a pair of groups parent constrained to selected ctrl (and it's group). 
    Basically is proxy to switch spaces (from rig part space to world space) for direct connections.
    ctrl should be located in place with a group above (group frozen)
    Args:
        ctrl (string): the name of the ctrl(transform) to create the proxy for. Assumes a group above (group freeze)
    Returns:
        string, string: returns the names of the created ctrl group and the created parent group
    """
    # grab the ctrl (must have group above)?
    ctrlParent = parentCheck(ctrl)
    if not ctrlParent:
        cmds.error("doubleProxyGrp: don't have a parent group on the ctrl!")
        return

    # create groups for the proxy
    ctrlGrp = cmds.group(empty=True, n="{0}_proxyCtrl".format(ctrl))
    parGrp = cmds.group(empty=True, n="{0}_proxyGrp".format(ctrlParent))
    # snap groups to the parent and child
    snapTo(ctrlParent, parGrp)
    snapTo(ctrl, ctrlGrp)
    cmds.parent(ctrlGrp, parGrp)
    # constrain groups 
    cmds.parentConstraint(ctrlParent, parGrp, mo=True)
    cmds.parentConstraint(ctrl, ctrlGrp, mo=True)
    # return groups
    return(ctrlGrp, parGrp)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号