In Maya, the hierarchy is included in a node's path but gets discarded most of the time and instead the artist is trusted to keep his names unique. The reason this is the case is because in Maya, there is no "hierarchy". Maya is inherently node-based; Softimage on the other hand does have the notion of a hierarchy.
Thus, a full path of a pCube1 may be resolve into'|a_group|another_group|pCube1', the | being the separator. You can ask for full paths via cmds.ls(long=True), other commands have similar flags, such as cmds.listRelatives(fullPath=True) that ultimately do the same thing; concatenate the depth-first path of a node within a graph. Additionally, Maya has the notion of namespaces, which encapsulates nodes similar to how Models encapsulates nodes in Softimage, however I would suggest sticking with hungarian notation at first as namespaces are tricky to understand at first. Best, Marcus On 19 March 2014 15:00, Eric Thivierge <[email protected]> wrote: > Hah. Well, yeah... thanks. > > On Wednesday, March 19, 2014 10:59:10 AM, damon shelton wrote: > >> cmds.ls <http://cmds.ls> ('*pCube1', long=True) >> >> >> On Mar 19, 2014 7:54 AM, "Eric Thivierge" <[email protected] >> <mailto:[email protected]>> wrote: >> >> Hello all, >> >> This may seem like a simple question but my Googling didn't return >> any useful results. >> >> I have a name of an object 'pCube1'. I need to find it in the Maya >> scene. Problem is, I may have multiple objects in the scene that >> are named the same thing. Even in the same hierarchy (Crazy that >> Maya lets you do this btw). Is there a way to get a list of all >> objects that are named 'pCube1'? Once I get that list I need to >> find the top most parent in the scene. From there I can find the >> one I need. >> >> When I try to listRelatives, it throws an error saying there is >> more than one node int he scene that is name 'pCube1'. >> >> # PyMel >> print pm.objExists('pCube1') >> >> parents = pm.listRelatives('pCube1', allParents=True) >> for eachItem in parents: >> print eachItem.name() >> >> Thanks, >> Eric T. >> >> -- >> 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] >> <mailto:python_inside_maya%[email protected]>. >> >> To view this discussion on the web visit >> https://groups.google.com/d/__msgid/python_inside_maya/__ >> 5329AFAD.5080403%40hybride.com >> <https://groups.google.com/d/msgid/python_inside_maya/ >> 5329AFAD.5080403%40hybride.com>__. >> For more options, visit https://groups.google.com/d/__optout >> <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] >> <mailto:[email protected]>. >> >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/python_inside_maya/ >> CAM9RXoLb37cQR4QB8R6eshN1PmT95n3uGY9qJicLtHFoEhQjLw%40mail.gmail.com >> <https://groups.google.com/d/msgid/python_inside_maya/ >> CAM9RXoLb37cQR4QB8R6eshN1PmT95n3uGY9qJicLtHFoEhQjLw%40mail. >> gmail.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/5329B11D.4040200%40hybride.com. > > For more options, visit https://groups.google.com/d/optout. > -- *Marcus Ottosson* [email protected] -- 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/CAFRtmOCB%2BTeeUmXjjM2eBYbnFLDELt%2BZB-gBfH8L2L1QChnE-w%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
