Hey! Sorry to revive this age-old thread, but I imported a scene from sketchup and it comes with a ton of groups with one object under them. How could this script be modified to do this too?
Run this in the python tab in your script editor. import maya.cmds as cmdstransforms = cmds.ls(type='transform')deleteList = []for tran in transforms: if cmds.nodeType(tran) == 'transform': children = cmds.listRelatives(tran, c=True) if children == None: print '%s, has no childred' %(tran) deleteList.append(tran)…