Script to delete empty group nodes from scene

Found a script on polycount forums (credits to Shawner) which deletes empty group nodes from your scene. Watch out when there are empty group nodes used (such as stretchy IK) though they will be fine if there are constraints attached to them.

import maya.cmds as cmds

transforms =’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)


if len(deleteList) > 0:


Leave a Reply

Your email address will not be published. Required fields are marked *