On Tue, Aug 30, 2016 at 12:56 PM likage <[email protected]> wrote:
> I am trying to grab only the group nodes within the hierarchy as shown in > the screenshot.. > Is a group node considered any transform that has a child? That is, would you expect to get pSphere1 or locator1 back in your results if they had child transforms under them? > > While I use this code: > > sel = cmds.listRelatives(cmds.ls(transforms=True), ap=True, ni=True) > print sel > > It is giving me the following results: > [u'Group_1', u'Group_2', u'Group_2', u'Group_2', u'Group_2', u'Group_2', u > 'Group_3', u'Group_4', u'Group_5'] > > Though it gives me duplicated result of certain groups, is this the best > way to approach this? > I am using Group_ as a generic naming and hence my reluctance to use > Group_*, in case you are wondering... > > > > <https://lh3.googleusercontent.com/-CzmSA56LEYo/V8TYu5y1iZI/AAAAAAAAAFY/RZFoiyDPCmAjM08aTpaTns3FwR9yQtz-ACLcB/s1600/grp_hie.jpg> > > -- > You received this message because you are subscribed to the Google Groups > "Python Programming for Autodesk Maya" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/python_inside_maya/a70ebb57-f68c-493f-b84a-ba5a52334697%40googlegroups.com > <https://groups.google.com/d/msgid/python_inside_maya/a70ebb57-f68c-493f-b84a-ba5a52334697%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA16FKRem4SLDXvruX-ZOTrY0fQ_Oqt2P%2BZTFozDmUPMAA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
