zbw_shapeScale.py 文件源码

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

项目:zTools 作者: zethwillie 项目源码 文件源码
def scale_the_objects(scaleVal, *args):
    """
    does the scaling bits
    """
    sel = cmds.ls(sl=True, type="transform")
    if sel:
        for obj in sel:
            if (rig.isType(obj, "nurbsSurface")) or (rig.isType(obj, "nurbsCurve")):
                piv = cmds.xform(obj, q=True, ws=True, rp=True)
                cvs = cmds.select((obj + ".cv[*]"))
                cmds.scale(scaleVal, scaleVal, scaleVal, cvs, pivot=piv)
            elif rig.isType(obj, "mesh"):
                piv = cmds.xform(obj, q=True, ws=True, rp=True)
                vs = cmds.select((obj + ".vtx[*]"))
                cmds.scale(scaleVal, scaleVal, scaleVal, vs, pivot=piv)
            else:
                cmds.warning("{0} isn't a nurbs or poly object, so it was skipped".format(obj))
    # clear and reselect all
    if sel:
        cmds.select(cl=True)
        cmds.select(sel)
        return (True)

    return (False)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号