Remove namespaces
 
 
 

There may be situations where you need to remove nodes from a particular namespace and subsequently remove the reserved namespace from the scene. These situations might be as follows:

You can remove namespaces using the Namespace Editor or by using a namespace MEL command.

Remove namespaces using the Namespace Editor

  1. Determine the namespace for a node by selecting any object/node that uses the namespace.

    The namespace for the object/node appears highlighted in the Channel Box and Outliner. For example, an object’s name with an assigned namespace can appear as follows:

    spaceJunk:pSphere1
    
  2. In the Namespace Editor, select the namespace you want to remove.
  3. Click Delete.

    If the namespace you want to remove contains nodes, the Confirm Namespace Deletion window appears.

  4. In the Confirm Namespace Deletion window, click one of the following:
    • Move contents to parent to delete the namespace and move the nodes contained by the deleted namespace to an immediate parent namespace.
    • Delete contents to delete the namespace and the nodes contained by the namespace.

Remove namespaces using MEL commands

The next two procedures show you how to remove nodes from an existing namespace in a scene, and then remove the reserved namespace from the scene using the namespace MEL command.

To remove a specified namespace for all nodes in a scene

  1. Determine the namespace for a node by selecting any object/node that uses the namespace.

    The namespace for the object/node appears in the Channel Box, Outliner, or other editor when it is selected. An object’s name with an assigned namespace would appear as follows:

    spaceJunk:pSphere1
    

    In this example, the namespace is called spaceJunk.

  2. In the Command Line, type the following text string to move any nodes that reside within the spaceJunk namespace so they reside in the default namespace.
    namespace -mv “spaceJunk” “:” -f
    

    Any nodes that had the spaceJunk namespace now have no namespace specified. That is, the : specifies the default namespace and the -f flag forces the command even if it produces naming conflicts. As a result, nodes with identical names will be assigned an incremental number.

To remove a reserved namespace, you must first ensure that no nodes in the scene currently reside within that namespace. For more information, see the above procedure.

To remove a reserved namespace from a file

  1. You should know the name of the reserved namespace prior to removing it. For more information on determining the namespaces in the scene, see namespaceInfo in the Maya Help. In this example, the namespace to be removed is called spaceJunk.
  2. In the Command Line, type the following text string to remove the reserved spaceJunk namespace from the scene.
    namespace -rm “spaceJunk”
    
    Note

    Namespaces cannot be named so they conflict with any existing namespaces currently in use within the scene.

Relatedtopics