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)
评论列表
文章目录