If what you're looking for is to get the objects listed in the namespace,
try the following:

cmds.namespaceInfo(":ANIMAL1APE01", listNamespace=True)

This will return a list of objects in the ANIMAL1APE01 namespace.

For a listing of the namespaces that maya knows about, try this:

cmds.namespaceInfo(":", listOnlyNamespaces=True)

Other than that, we really need to know exactly what you're trying to
do--namespaces have lots of tricky options, and due to Maya's
less-than-pythonic string-based implementation, very few of them are
pretty.  The few things I can point out, without knowing exactly what
you're trying to do, is that you have to specify namespaces
explicitly--that is, you must preface the name of the namespace with ":" to
indicate that it is relative to the root namespace.  You should also ensure
that you're currently in the root namespace--Maya keeps track of the
"current" namespace, and if you don't use absolute addressing, it will
search relative to the current.  So, if you didn't use the colon (":") at
the beginning of the namespace, and ANIMAL1APE01 was the current namespace,
then it would be looking for a child namespace of ANIMAL1APE01, which would
actually be a child of ANIMAL1APE01.  The absolute addressing would solve
this issue.

Hope that helps, if you can clarify your needs, I can probably help get
something more useful together.

Joe

On Thu, Mar 12, 2015 at 10:55 AM, Paul Molodowitch <[email protected]>
wrote:

> What do you mean by "get" the namespace?
>
> Do you mean you want to query what is currently selected in that namespace
> editor window?
>
> On Thu, Mar 12, 2015 at 3:32 AM, yann19 <[email protected]> wrote:
>
>>
>> <https://lh4.googleusercontent.com/-ImSp96d3-hI/VQFrNxnjpKI/AAAAAAAABhw/RvIvx8EyU5I/s1600/namespace.jpg>
>> Here's the image
>>
>>
>> On Thursday, March 12, 2015 at 6:21:45 PM UTC+8, yann19 wrote:
>>>
>>> I am trying to get this particular namespace - ANIMAL1APE01 under "root"
>>> (see attached screenshot) but I am unable to.
>>> I tried this maya command - cmds.namespaceInfo but I am getting a whole
>>> big chunk of list as the result.
>>>
>>> The reason I had wanted to grab it from NamespaceEditor is so that it is
>>> grabbing the correct "information" as compared to selecting the item in the
>>> scene, in the event where you can easily change the naming without knowing.
>>>
>>> Are there perhaps better way in doing so, the pythonic way if possible?
>>>
>>  --
>> 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/b367c63e-dfb1-4728-921b-1e041173051b%40googlegroups.com
>> <https://groups.google.com/d/msgid/python_inside_maya/b367c63e-dfb1-4728-921b-1e041173051b%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/CAAssL7bLi79i7DoZ3HRSEAKOQqOvOKQJsQpuVp7RKi3XXPcZhw%40mail.gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/CAAssL7bLi79i7DoZ3HRSEAKOQqOvOKQJsQpuVp7RKi3XXPcZhw%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/CAM33%3Da4BKu28kZ82TxttstMHR_L-vQtQbg-oLh4VgUcyV41QDQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to