File referencing and namespaces

Illegal character handling for namespaces

Previously, for Maya versions 2010 and below, the characters '<' and '>' would get converted to '_' if encountered in a node name or namespace name. Any leading invalid characters are removed, and all others are converted to underscore.

For example, in Maya 2009:

namespace -add "<foo>"
// Result: foo_
createNode transform -n "<bar>"
// Result: bar_
namespace -add "foo<bar>"
//Result: foo_bar_

For Maya 2011 and above, the characters '<' and '>' will still be removed and converted to '_' for node names. However, for namespace names, Maya will consider everything in between those characters as a placeholder namespace. Therefore, you should update your code if you are using these characters and relying on Maya to correct them. For example, in Maya 2013:

namespace -add "<foo>"
// Result: <foo>
createNode transform -n "<bar>"
// Result: bar_
namespace -add "foo<bar>"
//Result: foo_bar_

Deleting namespaces

After creating a reference with a namespace, never delete the namespace. All referenced objects that use this namespace are affected and will not work as expected. If you no longer want to associate a referenced object with a specific namespace, remove it using the Namespace Editor. See Remove namespaces.