List children but ignore shape nodes (python)


I’m using the list command in python to try and return the children of a node. I want to ignore the shape node so I’ve tried shapes = False but it makes no difference, I keep getting the nodes shape node in the list.

Can someone give me an example of how to do this please?
Thanks for reading,


Hi Dan.
There are different ways to filter these. What type of nodes should your final list include and what is the goal of your script?


Hi, for getting children of a node, you can use cmds.listRelatives, by give it a flag type=“nodetype”, you could filter the children by node type.

for example: following code gets the children of “nodename” and only return transform node, so it will no include any shapes.

cmds.listRelatives("nodename", children=True, type="transform")


Thanks both for the reply, I’ll try your example. many thanks


I’ve got some blendshape geo under a group so was trying to collect the children of that group.