Namespace

A namespace is a group of objects collected under a name. A namespace is also a unique path. Therefore, each item in a namespace is identified by its name along with the namespace to which it belongs. For example, objects in the Namespace “Galaxy” could be “Galaxy:Moon”, “Galaxy:Rocket”, or “Galaxy:Alien”.

Note: A colon (:) character is automatically added to separate the names of namespaces and nodes.

When namespaces are used, you can have two objects with the same name in a scene, as long as they have different namespaces. For example, “Mars:Alien” and “Moon:Alien” objects can be in the same scene as long as the namespace is unique to each object.

When you merge an object into a scene that contains another object with the same name, you can choose to prepend a namespace to the incoming object to resolve the naming conflict.

An asset can be in any namespace, regardless of how they are in a scene. You can give nodes from a Control rig hierarchy one or multiple namespaces, or give a parent object one namespace and a child object another.

Prepending namespaces to objects or objects’ branches can facilitate scene management optimization. This can be especially useful if you have very large scene files.

Note: Objects’ properties and property references also take into account namespaces.

You can add, replace, and remove namespaces as you build a scene file. You can also append namespaces to other namespaces in the scene. See Namespaces within namespaces.

Note: A namespace is limited to a length of 1024 characters.

To prepend a namespace to an object:

  1. Select the object via the Scene browser or Viewer window.
  2. From the MotionBuilder menu bar, select Edit > Add/Remove Namespace.
    Note: You can also right-click an object or node and choose Add/Remove Namespace from the context menu.

    The Add/Remove Namespace dialog box appears, displaying namespaces in the current scene.

    Add/Remove Namespace dialog box

  3. Click the “Add” tab.
  4. Click in the “New Namespace” field and enter characters.

    Namespace specified for selected object

    Enabling or disabling the option “Add after other namespace” option when there are no namespaces in the scene has no effect.

    Danger: Adding namespaces to objects may affect the merge-back of the animation as this process is based on the names of objects.
  5. Click OK.
    The specified namespace is added to the object, giving the object a unique name.
    Tip: If your namespace is not fully visible, resize the window.

    If you have two objects in a scene that carry the same name (for example “Cube”) but one of the objects has a namespace prepended (for example “Big:Cube”), prepending the same namespace (for example “Big”) to the object carrying the same name (for example “Cube”) gives the following warning message.

    Name Clash Warning dialog box

    If you choose to proceed with the action, a number is prepended to the object’s name to give the object a unique name (for example “Big:Cube1”).

To prepend a namespace to a branch:

  1. Select the top object in a branch via the Scene browser or Viewer window.
    Tip: To view the hierarchy of the objects in your scene and ensure you select the object at the top of the hierarchy via the Viewer window, switch to the Schematic view by pressing Ctrl-W, or by selecting Schematic from the View menu. To switch back to the camera view, press Ctrl-W.
  2. From the MotionBuilder menu bar, select Edit > Add/Remove Namespace.
    Note: You can also right-click an object or node and choose Add/Remove Namespace from the context menu.

    The Add/Remove Namespace dialog box appears, displaying namespaces in the current scene.

  3. Click the “Add” tab.
  4. Click in the “New Namespace” field and enter characters.

    Namespace specified for branch

    Enabling or disabling the option “Add after other namespace” option when there are no namespaces in the scene has no effect.

  5. Enable the “Apply to branch” option.
    Danger: Adding namespaces to objects or branches may affect the merge-back of the animation as this process is based on the names of objects and branches.
  6. Click OK.

    The specified namespace is added to the object’s branch.

    Note: If the name is not unique, you get a warning message enabling you to either proceed with the action or cancel the action. If you proceed with the action, a number is prepended to each object within the branch to provide unique names.

To replace a namespace prepended to an object:

  1. Select the object via the Scene browser or Viewer window.
  2. From the MotionBuilder menu bar, select Edit > Add/Remove Namespace.
    Note: You can also right-click an object or node and choose Add/Remove Namespace from the context menu.

    The Add/Remove Namespace dialog box appears displaying the namespaces in the current scene.

    Namespaces in current scene displayed

  3. Click the “Replace” tab.

    The selected object’s namespace is highlighted.

  4. Click in the “New” field and enter a name.
    Danger: Changing namespaces of objects may affect the merge-back of the animation as this process is based on the names of objects.
  5. Click OK.

    The object’s namespace is replaced by the specified name.

To replace a namespace prepended to an object’s branch:

    Tip: To view the hierarchy of the objects in your scene and ensure you select the object at the top of the hierarchy via the Viewer window, switch to the Schematic view by pressing Ctrl-W, or by selecting Schematic from the View menu. To switch back to the camera view, press Ctrl-W.
  1. Follow the preceding procedure (for replacing a namespace prepended to an object) up to step 5.
  2. Enable “Apply to branch” option.
    Danger: Changing namespaces of objects or branches may affect the merge-back of the animation as this process is based on the names of objects and branches.
  3. Click OK.

    The object’s branch namespace is replaced by the specified name.

To remove a namespace prepended to an object’s name:

  1. Select the object via the Scene browser or Viewer window.
  2. From the MotionBuilder menu bar, select Edit > Add/Remove Namespace.
    Note: You can also right-click an object or node and choose Add/Remove Namespace from the context menu.

    The Add/Remove Namespace dialog box appears displaying the namespaces in the current scene.

  3. Click the “Remove” tab.

    The selected object’s namespace is highlighted.

    Danger: Removing namespaces of objects may affect the merge-back of the animation as this process is based on the names of objects.
  4. Click OK.

    The namespace is removed from the selected object.

To remove a namespace prepended to an object’s branch:

  1. Select the object ‘s branch via the Scene browser or Viewer window.
    Tip: To view the hierarchy of the objects in your scene and ensure you select the object at the top of the hierarchy via the Viewer window, switch to the Schematic view by pressing Ctrl-W, or by selecting Schematic from the View menu. To switch back to the camera view, press Ctrl-W.
  2. From the MotionBuilder menu bar, select Edit > Add/Remove Namespace.
    Note: You can also right-click a branch or the top node of a branch and choose Add/Remove Namespace from the context menu.

    The Add/Remove Namespace dialog box appears displaying the namespaces in the current scene.

  3. Click the “Remove” tab.

    The selected branch’s namespace is highlighted.

  4. Enable “Apply to branch”.
    Danger: Removing namespaces prepended to branches may affect the merge-back of the animation as this process is based on the names of objects and branches.
  5. Click OK.

    The namespace is removed from the selected branch.

Namespaces within namespaces

A namespace acts like a directory in a file system. It is the unique ID of an object or branch. The assets assigned to a namespace are like files in a directory folder. You can store a namespace inside another namespace, just as you would store a directory inside another directory.

A namespace is a unique path. The whole path is considered a namespace. So, Moon:Alien is a path, but Galaxy:Moon:Alien is a separate path because it does not reference Moon:Alien in the Galaxy and therefore increments Moon. Moon:Alien and Galaxy:Moon:Alien are two separate and cooperative elements that do not require renaming.

For example, the spine bone of an Alien character, shown as “Alien:Spine”, could be placed in the “Moon” namespace, which would then be Moon:Alien:Spine. The Moon namespace and all its associated asset could then be stored in a “Galaxy” namespace, creating Galaxy:Moon:Alien:Spine, and so on.

Just as you cannot have two subdirectories with the same name inside a directory, you cannot have two objects with the same name in a namespace. For example, in the namespace “Galaxy”, there cannot be two “Galaxy:Moon” objects. Refer to the procedures in the following topic (Creating hierarchy namespaces).