[PYMEL] NodeType group?

Hi!
I´m struggeling selecting all the groups in the scene with the ls command. I have no problems with joints and nurbsCurves, but I can´t with groups.


jnt_list = pm.ls('___*', type='joint')
crvs_list = pm.ls('___*', type='nurbsCurve')

That´s what I have so far and It works perfectly, but with groups I can´t find the noteType in the pymel docs.

Anyone could give me a hand to do something like this that works?



grp_list = pm.ls('___*', type='group')

Thanks!!

“Groups” are just transform nodes without shapes children. If all direct children of a transform node are themselves transforms, then it is displayed as “Group”. To see this more clearly, check “Display Shapes” in your outliner.

This behavior is perfectly logical, but since Maya “hides” it in some cases it can be quite confusing !

If you want ‘groups’ you can get a list of type transform and them filter out nodes with shape children:


import maya.cmds as cmds
groups = [p for p in cmds.ls(type='transform') or [] if not cmds.listRelatives(p, s=True)]

Thank you guys!
Now I know there are transfrom nodes, I have no problem to filter them! :p:
Thank you so much!!
:D: