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.
For more options, visit https://groups.google.com/d/optout.