Simple Python coding question... listRelatives

I am trying to get children that are nurbsCurves to delete.

I’m using:

myCurveShapes = cmds.listRelatives(ad=True, type=“nurbsCurve”) to get the shapes, then getting parents.

However I also pick up joints (which I believe are HIK joints). Is there a simple way to indicate not to grab these HIK joints, which obviously show up as curves in the outliner?

Try filtering twice instead:


hierarchy = cmds.listRelatives(ad=True)
curves = cmds.ls(*hierarchy, exactType= 'nurbsCurve') 

See if you get different results

Thanks so much, I wound up using a nodeType after figuring it out… I think both work. :slight_smile:

nodeType has to be called on each item and is going to be a more expensive method of doing what Theodox’s example does. Use commands that operate on multiple items at once whenever possible.