hey
this locators based on your tree aren't children of locator2:
*[u'locator4', u'locator5', u'locator6']*

this code just give you everything you select, not their childrens

what exactly you want to print out?

On Tue, Nov 17, 2015 at 12:06 PM, likage <[email protected]> wrote:

> I have created some locators with hierarchy levels in them, for eg.
> locator1
>     |- locator2
>         |- locator3
>     |- locator4
>         |- locator5
>         |- locator6
>     |- locator7
>         |- locator8
>         |- locator9
>         |- locator10
>
> While I am inputting the following code:
> import maya.cmds as cmds
> sel = cmds.ls(sl=True)
> print sel
>
> When I tried running the code on locator2 (selection includes its children
> too), instead of getting* [u'locator4', u'locator5', u'locator6']* etc as
> my output, I am getting *[u'locator2', u'locator2|locator3']*, notice
> that the latter output seems to give the full path. I am seeing the same
> result within the list should I be selecting everything too
>
> Can someone tell me why this is so? FYI, I am trying to get each item
> individual name or is there a better way to deal this?
>
> --
> 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/9008456d-acf4-4c9f-80ab-229972aafb6a%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/9008456d-acf4-4c9f-80ab-229972aafb6a%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 


Bests,
madoodia

-- 
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/CADvbQwKVm_K%2B75E3_yFt-W%2Bu4V9Fd_Z2mHpxY3FzuPfPta8Q1w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to