Hi there, I using *[u'locator4', u'locator5', u'locator6'], *using that as an example.. Pardon me if I did not state that clearly.
I am trying to get the same/similar output when you select locator2 but instead, *[u'locator2', u'locator2|locator3'] *is the result of it On Tuesday, November 17, 2015 at 4:45:18 PM UTC+8, Mahmoodreza Aarabi wrote: > > 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] > <javascript:>> 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] <javascript:>. >> 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/5898840d-82ee-458f-8b17-e9b0839288e2%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
