def insertGroupAbove(obj, *args):
par = cmds.listRelatives(obj, p=True)
grp = cmds.group(em=True, n="{}_Grp".format(obj))
pos = cmds.xform(obj, q=True, ws=True, rp=True)
rot = cmds.xform(obj, q=True, ws=True, ro=True)
cmds.xform(grp, ws=True, t=pos)
cmds.xform(grp, ws=True, ro=rot)
cmds.parent(obj, grp)
if par:
cmds.parent(grp, par[0])
return (grp)
评论列表
文章目录