def addGroupBelow(*args):
############----------fix lots of stuff here, but basic idea works
sel = cmds.ls(sl=True)
for obj in sel:
pos = cmds.xform(obj, ws=True, q=True, rp=True)
rot = cmds.xform(obj, ws=True, q=True, ro=True)
children = cmds.listRelatives(obj, children=True)
grp = cmds.group(em=True, name=obj.replace("Auto", "Manual"))
cmds.xform(grp, ws=True, t=pos)
cmds.xform(grp, ws=True, ro=rot)
cmds.parent(grp, obj)
for child in children:
cmds.parent(child, grp)
评论列表
文章目录