Go to: Synopsis. Return value. Related. Flags. MEL examples.

Synopsis

namespaceInfo [-absoluteName] [-currentNamespace] [-dagPath] [-internal] [-isRootNamespace string] [-listNamespace] [-listOnlyDependencyNodes] [-listOnlyNamespaces] [-parent] [-recurse] [-shortName]

namespaceInfo is undoable, NOT queryable, and NOT editable.

This command displays information about the current namespace. A namespace is a simple grouping of objects under a given name. Each item in a namespace can then be identified by its own name, along with what namespace it belongs to. Namespaces can contain other namespaces like sets, with the restriction that all namespaces are disjoint. Namespaces are primarily used to resolve name-clash issues in Maya, where a new object has the same name as an existing object (from importing a file, for example). Using namespaces, you can have two objects with the same name, as long as they are contained in different namespaces. Note that namespaces are a simple grouping of names, so they do not effect selection, the DAG, the Dependency Graph, or any other aspect of Maya. All namespace names are colon-separated.

Return value

string

Related

namespace

Flags

absoluteName, currentNamespace, dagPath, internal, isRootNamespace, listNamespace, listOnlyDependencyNodes, listOnlyNamespaces, parent, recurse, shortName
Long name (short name) Argument types Properties
-listNamespace(-ls) create
List the contents of the current namespace.
-currentNamespace(-cur) create
Display the name of the current namespace.
-isRootNamespace(-ir) string create
Returns true if the current namespace is root(":"), false if not
-parent(-p) create
Display the parent of the current namespace. By default, the list returned will not include internal nodes (such as itemFilters). To include the internal nodes, use the -internal flag.
-listOnlyDependencyNodes( -lod) create
List all dependency nodes in the current namespace.
-listOnlyNamespaces(-lon) create
List all namespaces in the current namespace.
-recurse(-r) create
Can be specified with -listNamespace, -listOnlyNamespaces or -listOnlyDependencyNode to cause the listing to recursively include any child namespaces of the current namespaces.
-dagPath(-dp) create
This flag modifies the '-ls/-listNamespace' and '-lod\-listOnlyDependencyNodes flags to indicate that the names of any dag objects returned will include as much of the dag path as is necessary to make the names unique. If this flag is not present, the names returned will not include any dag paths.
-shortName(-sn) create
This flag modifies the '-p/-parent' and '-cur\-currentNamespace' flags to indicate that the name returned will be the base name of the namespace. If the flag is not present, the names returned are full path of the namespace, including its parent paths and base name It cannot be used together with -absoluteName.
-absoluteName(-an) create
This flag modifies queries so that the namespace name returned will be an absolute name. The absolute name is the full namespace path, starting from the root namespace ":" and including all parent namespaces. It cannot be used together with -shortName.
-internal(-int) create
This flag used together with listOnlyDependencyNodes. When this flag is set, the returned list will include internal nodes (for example itemFilters) that are not listed by default.

Flag can appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can be used more than once in a command.

MEL examples

// List the contents of the current namespace
//
namespaceInfo -listNamespace;

// List the parent of the current namespace
//
namespaceInfo -parent;

// List the parent of the current namespace with short name
//
namespaceInfo -parent -shortName;

// Determine if the current namespace is root
//
namespaceInfo -rootNamespace;

// List the parent of the current namespace with absolute name
//
namespaceInfo -parent -absoluteName;

// List dependency nodes including internal nodes
//
namespaceInfo -listOnlyDependencyNodes -internal;