Script that selects all of a selected type of object in a hierachy

Was on riggingdojo – credits to Chad Moore! Selects all of a certain type of object in a hierachy, all joints, curves or constraints – found it useful for resizing joints

import maya.cmds as cmds, ap=1, sl=1, type=”joint”))

or, ap=1, sl=1, type=”nurbsCurve”))

or, ap=1, sl=1, type=”constraint”))

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: