Namespace annoyance in maya

Maybe i’m missing something, but is there a compelling reason why a namespace in maya CANNOT have the same name as any other node in maya?

I can’t think of any good reason for this behavior other than to irritate me on this otherwise pleasant friday.

example, in a new maya scene:

polySphere -name ugh;
namespace -add ugh;
// Result: ugh1 // 

This is straight out of the maya help docs. Doesn’t give any insight as to WHY you can’t, and my attempts to find a reason aren’t turning up much.

Nodes and namespaces cannot share the same name

If a node and a namespace have the same name, an error is generated. Maya will attempt to fix this error by adding a suffix to a node whose name is the same as the namespace.

Workaround

Rename either the node or the namespace to ensure they are unique.

I will continue to dig in and see what I can find.

Ahhh - well at least there’s some comfort in knowing it’s a documented “feature”, if nothing else :slight_smile: For the pipeline i’m working on it’s important that my namespaces aren’t effed with by maya since they map back to entity names. I’ll probably just work around it by appending _ns to the end of them all, even though it saddens me.

Thanks!

Sorry I couldn’t help more. I don’t work a whole lot with namespaces and when I do, the naming conventions of nodes in the scene generally prevent the namespace from lining up with anything. So a namespace would be something like a one word thing and all the nodes involve more elaborate naming conventions to prevent any kind of break down.

so if the namespace was a name like bharris and something in the scene had that in it’s name it would be like

bharris:bharris_multNode

Namespaces can be so buggy that they probably just arbitrarily added that rule to prevent any possibility of things breaking even more. :stuck_out_tongue:

Yeah - this is kind of a funny use of namespaces because i’m importing static geo into our maya based level editor. I want to keep it in a namespace so i can be sure to nuke everything when i’m done with it (all shaders, dg nodes, etc…), and for simplicity, i’d very much like the imported namespace to be the entity name so there a direct, no-brainer mapping between the two. I’m comfortable with a little naming hackery in this case, definitely the lesser of several evils. But i’ll report back if i find anything better.