You can create namespaces in the Namespace Editor as well as when you reference or import a file into your scene. When you create a namespace during file referencing or importing, the file name is used as the namespace by default.
You can also create namespaces from the command line using the -namespace -add "newNs" MEL command.
After you create a namespace you can edit it using the Namespace Editor. See Edit namespaces.
To create a namespace using the Namespace Editor
The Namespace Editor appears.
Maya creates a new namespace.
The Rename Namespace window appears.
When you are creating a file reference or importing a file, you can create the namespace used by the referenced and imported objects.
To create a namespace during file referencing or importing
The Reference Options window appears.
In the case where duplicate namespaces occur, the namespaces are merged and duplicate object names are incrementally suffixed with a number. Use this option to avoid an accumulation of new namespaces each time your referenced or imported objects have the same namespace.
A File Browser appears.
You can edit namespaces using the Namespace Editor, Reference Editor or by using MEL commands. For more information see Namespace Editor overview, Reference Editor, and Work with file references.
You can use the following MEL commands to create namespaces in the command line. -add "newNS"flag with -namespace command to create a namespaces in the command line:
You can also create namespaces when renaming nodes by specifying the namespace name of the new node.
For example:
rename "ns1:obj1" ":newNs2:obj1" creates a new newNs2, namespace if it doesn't already exist.