pymel.core.system.namespaceInfo

namespaceInfo(*args, **kwargs)

“This command displays information about a namespace. The target namespace can optionally be specified on the command line. If no namespace is specified, the command will display 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.

Modifications:
  • returns an empty list when the result is None
  • returns wrapped classes for listOnlyDependencyNodes
Flags:
Long name (short name) Argument Types Properties
absoluteName (an) bool ../../../_images/create.gif
 

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.

currentNamespace (cur) bool ../../../_images/create.gif
 
Display the name of the current namespace; this flag can not be used with specific namespace together.
dagPath (dp) bool ../../../_images/create.gif
 

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.

internal (int) bool ../../../_images/create.gif
 

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 commandFlag can have multiple arguments, passed either as a tuple or a list.

isRootNamespace (ir) unicode ../../../_images/create.gif
 
Returns true if the namespace is root(”:”), false if not.
listNamespace (ls) bool ../../../_images/create.gif
 
List the contents of the namespace.
| .. |
lod)** | bool | .. image:: /images/create.gif |
 
List all dependency nodes in the namespace.
listOnlyNamespaces (lon) bool ../../../_images/create.gif
 
List all namespaces in the namespace.
parent (p) bool ../../../_images/create.gif
 

Display the parent of the namespace. By default, the list returned will not include internal nodes (such as itemFilters). To include the internal nodes, use the -internal flag.

recurse (r) bool ../../../_images/create.gif
 

Can be specified with -listNamespace, -listOnlyNamespaces or -listOnlyDependencyNode to cause the listing to recursively include any child namespaces of the namespaces;

shortName (sn) bool ../../../_images/create.gif
 

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.

Derived from mel command maya.cmds.namespaceInfo

Example:

import pymel.core as pm

import maya.cmds as cmds

# List the contents of the current namespace
#
pm.namespaceInfo( listNamespace=True )
# Result: [u'CubeCompass', u'DefaultAllLightsFilter', u'DefaultAllLightsFilter1', u'DefaultAllLightsFilter2', u'DefaultAllLightsFilter6', u'DefaultAllRenderClassificationsFilter', u'DefaultAllRenderClassificationsFilter1', u'DefaultAllRenderNodesFilter', u'DefaultAllShadingNodesFilter', u'DefaultBakeSetsFilter', u'DefaultBakeSetsFilter2', u'DefaultBasicRenderNodesFilter', u'DefaultCameraShapesFilter', u'DefaultCameraShapesFilter1', u'DefaultCameraShapesFilter4', u'DefaultCameraShapesImagePlanesFilter', u'DefaultCameraShapesImagePlanesFilter3', u'DefaultContainerFilter', u'DefaultContainerNodeFilter', u'DefaultExclLightShapesFilter', u'DefaultGeometryFilter', u'DefaultHiddenAttributesFilter', u'DefaultIkHandlesFilter', u'DefaultImagePlanesFilter', u'DefaultImagePlanesFilter1', u'DefaultImagePlanesFilter4', u'DefaultJointsFilter', u'DefaultLightLinkingLightFilter', u'DefaultLightShapesFilter', u'DefaultLightShapesPostProcsFilter', u'DefaultLightShapesPostProcsFilter1', u'DefaultLightShapesPostProcsFilter2', u'DefaultLightShapesTexturesFilter', u'DefaultLightShapesTexturesFilter1', u'DefaultLightsAndOpticalFXFilter', u'DefaultLightsAndOpticalFXFilter4', u'DefaultMaterialsAndShaderGlowFilter', u'DefaultMaterialsAndShaderGlowFilter6', u'DefaultMaterialsFilter', u'DefaultMaterialsFilter1', u'DefaultMaterialsFilter2', u'DefaultMaterialsFilter8', u'DefaultMaterialsTexturesLightShapesFilter', u'DefaultMaterialsTexturesLightShapesFilter1', u'DefaultMrContourContrastFilter', u'DefaultMrContourOutputFilter', u'DefaultMrContourShaderFilter', u'DefaultMrContourStoreFilter', u'DefaultMrDataConversionFilter', u'DefaultMrDisplacementFilter', u'DefaultMrEmitterFilter', u'DefaultMrEnvironmentFilter', u'DefaultMrGeometryFilter', u'DefaultMrLensFilter', u'DefaultMrLightFilter', u'DefaultMrLightmapFilter', u'DefaultMrMaterialFilter', u'DefaultMrMiscFilter', u'DefaultMrNodesFilter', u'DefaultMrOutputFilter', u'DefaultMrPhotonFilter', u'DefaultMrPhotonVolumeFilter', u'DefaultMrSampleCompositingFilter', u'DefaultMrShadowFilter', u'DefaultMrStateFilter', u'DefaultMrTextureFilter', u'DefaultMrVolumeFilter', u'DefaultNURBSObjectsFilter', u'DefaultNoShaderGlowFilter', u'DefaultNonExclLightShapesFilter', u'DefaultOpticalFXFilter', u'DefaultOpticalFXFilter1', u'DefaultOpticalFXFilter5', u'DefaultPolygonObjectsFilter', u'DefaultPostProcFilter', u'DefaultRenderUtilitiesFilter', u'DefaultRenderUtilitiesFilter5', u'DefaultRenderingFilter', u'DefaultSGLightShapesFilter', u'DefaultSGLightShapesTexturesFilter', u'DefaultSetsFilter', u'DefaultShaderGlowFilter', u'DefaultShaderGlowFilter1', u'DefaultShaderGlowFilter2', u'DefaultShaderGlowFilter8', u'DefaultShadingGroupsAndMaterialsFilter', u'DefaultShadingGroupsFilter', u'DefaultShadingGroupsFilter1', u'DefaultShadingGroupsFilter2', u'DefaultShadingGroupsFilter3', u'DefaultShadingGroupsFilter4', u'DefaultShadingGroupsFilter5', u'DefaultShadingGroupsFilter6', u'DefaultShadingGroupsFilter7', u'DefaultShadingGroupsFilter8', u'DefaultSubdivObjectsFilter', u'DefaultTextures2dFilter', u'DefaultTextures3dFilter', u'DefaultTexturesFilter', u'DefaultTexturesFilter1', u'DefaultTexturesFilter7', u'DefaultTexturesSGFilter', u'DefaultUsesImageFileFilter', u'Manipulator1', u'UI', u'UniversalManip', u'animCurveFilter', u'animLayersFilter', u'characterPartition', u'characterSetsFilter', u'clipsFilter', u'clusterSetsFilter', u'defaultCreaseDataSet', u'defaultHardwareRenderGlobals', u'defaultLayer', u'defaultLightList1', u'defaultLightSet', u'defaultObjectSet', u'defaultRenderGlobals', u'defaultRenderLayer', u'defaultRenderLayerFilter', u'defaultRenderQuality', u'defaultRenderUtilityList1', u'defaultRenderingList1', u'defaultResolution', u'defaultSetFilter', u'defaultShaderList1', u'defaultTextureList1', u'defaultViewColorManager', u'deformerSetsFilter', u'dof1', u'drivenKeyFilter', u'dynController1', u'dynamicFilter', u'expressionFilter', u'front', u'frontShape', u'globalCacheControl', u'groundPlane', u'groundPlane_transform', u'hardwareRenderGlobals', u'hardwareRenderingGlobals', u'hyperGraphInfo', u'hyperGraphLayout', u'ikSystem', u'initialMaterialInfo', u'initialParticleSE', u'initialShadingGroup', u'jointClusterSetsFilter', u'keyableFilter', u'lambert1', u'latticeSetsFilter', u'layerManager', u'layersFilter', u'lightLinker1', u'lightLinkingObjectFilter', u'lightList1', u'lightSetFilter', u'lightSetFilter1', u'nonLinearSetsFilter', u'notAnimLayersFilter', u'objectAttrFilter1', u'objectAttrFilter2', u'objectAttrFilter3', u'objectAttrFilter4', u'objectAttrFilter5', u'objectAttrFilter6', u'objectAttrFilter7', u'objectAttrFilter8', u'objectFilter17', u'objectFilter18', u'objectFilter19', u'objectFilter20', u'objectFilter21', u'objectNameFilter1', u'objectNameFilter2', u'objectNameFilter3', u'objectNameFilter4', u'objectScriptFilter1', u'objectScriptFilter2', u'objectScriptFilter3', u'objectScriptFilter4', u'objectScriptFilter5', u'objectScriptFilter6', u'objectScriptFilter7', u'objectScriptFilter8', u'objectScriptFilter9', u'objectScriptFilter10', u'objectTypeFilter1', u'objectTypeFilter2', u'objectTypeFilter3', u'objectTypeFilter4', u'objectTypeFilter5', u'objectTypeFilter6', u'objectTypeFilter7', u'objectTypeFilter8', u'objectTypeFilter9', u'objectTypeFilter10', u'objectTypeFilter11', u'objectTypeFilter12', u'objectTypeFilter13', u'objectTypeFilter14', u'objectTypeFilter15', u'objectTypeFilter16', u'objectTypeFilter17', u'objectTypeFilter18', u'objectTypeFilter19', u'objectTypeFilter20', u'objectTypeFilter21', u'objectTypeFilter22', u'objectTypeFilter23', u'objectTypeFilter24', u'objectTypeFilter25', u'objectTypeFilter26', u'objectTypeFilter27', u'objectTypeFilter28', u'objectTypeFilter29', u'objectTypeFilter30', u'objectTypeFilter31', u'objectTypeFilter32', u'objectTypeFilter33', u'objectTypeFilter34', u'objectTypeFilter35', u'objectTypeFilter36', u'objectTypeFilter37', u'objectTypeFilter38', u'objectTypeFilter39', u'objectTypeFilter40', u'objectTypeFilter41', u'objectTypeFilter42', u'objectTypeFilter43', u'objectTypeFilter44', u'objectTypeFilter45', u'objectTypeFilter46', u'objectTypeFilter47', u'objectTypeFilter48', u'objectTypeFilter49', u'objectTypeFilter50', u'objectTypeFilter51', u'objectTypeFilter52', u'objectTypeFilter67', u'objectTypeFilter68', u'objectTypeFilter69', u'objectTypeFilter70', u'objectTypeFilter71', u'objectTypeFilter72', u'objectTypeFilter73', u'objectTypeFilter74', u'objectTypeFilter75', u'objectTypeFilter76', u'objectTypeFilter77', u'objectTypeFilter78', u'otherDeformerSetsFilter', u'particleCloud1', u'partitionFilter', u'persp', u'perspShape', u'polyMergeEdgeToolDefaults', u'polyMergeFaceToolDefaults', u'postProcessList1', u'publishedFilter', u'relationshipPanel1LeftAttrFilter', u'relationshipPanel1RightAttrFilter', u'renderGlobalsList1', u'renderLayerFilter', u'renderLayerManager', u'renderPartition', u'renderPassSetsFilter', u'renderPassesFilter', u'renderableObjectSetFilter', u'renderableObjectSetFilter1', u'renderableObjectSetFilter2', u'renderableObjectShapeFilter', u'renderableObjectShapeFilter1', u'renderableObjectShapeFilter2', u'renderableObjectsAndSetsFilter', u'renderableObjectsAndSetsFilter1', u'renderingSetsFilter', u'rotateFilter', u'scaleFilter', u'scaleRotateTranslateFilter', u'selectionListOperator1', u'selectionListOperator2', u'selectionListOperator3', u'selectionListOperator4', u'selectionListOperator5', u'selectionListOperator6', u'selectionListOperator7', u'selectionListOperator8', u'selectionListOperator9', u'selectionListOperator10', u'selectionListOperator11', u'selectionListOperator12', u'selectionListOperator13', u'selectionListOperator14', u'selectionListOperator15', u'selectionListOperator16', u'selectionListOperator17', u'selectionListOperator18', u'selectionListOperator19', u'selectionListOperator20', u'selectionListOperator21', u'selectionListOperator22', u'selectionListOperator23', u'selectionListOperator24', u'selectionListOperator25', u'selectionListOperator26', u'selectionListOperator27', u'selectionListOperator28', u'selectionListOperator29', u'selectionListOperator30', u'selectionListOperator57', u'selectionListOperator58', u'selectionListOperator59', u'selectionListOperator60', u'selectionListOperator61', u'selectionListOperator62', u'selectionListOperator63', u'selectionListOperator64', u'selectionListOperator65', u'selectionListOperator66', u'sequenceManager1', u'shaderGlow1', u'shared', u'side', u'sideShape', u'skinClusterSetsFilter', u'strokeGlobals', u'time1', u'top', u'topShape', u'translateFilter', u'world'] #

# List the parent of the current namespace
#
pm.namespaceInfo( parent=True )
# Result: u'' #

# List the parent of the current namespace with short name
#
pm.namespaceInfo( parent=True, shortName=True )
# Result: u'' #

# Determine if the current namespace is root
#
pm.namespaceInfo( rootNamespace=True )

# List the parent of the current namespace with absolute name
#
pm.namespaceInfo( parent=True, absoluteName=True )

# List dependency nodes including internal nodes
#
pm.namespaceInfo(listOnlyDependencyNodes = True,  internal = True);

# samples of query info of specified namespace
pm.namespace( set =":" )
pm.namespace( add ="sample" )
pm.namespace( set =":sample" )
pm.namespace( add ="sun" )

# List the contents of the specified namespace
#
pm.namespaceInfo( ":sample", listNamespace=True )
# Result: sample:sun

# List the parent of the specified namespace
#
pm.namespaceInfo( ":sample:sun", parent=True )
# result: sample

# List the parent of the specified namespace with short name
#
pm.namespaceInfo( ":sample:sun", parent=True, shortName=True )
# result: sample

# Determine if the specified namespace is root
#
pm.namespaceInfo( ":", isRootNamespace=True )
# result: True

# List the parent of the specified namespace with absolute name
#
pm.namespaceInfo( ":sample:sun", parent=True, absoluteName=True )
# result: :sample

# List dependency nodes including internal nodes
#
pm.namespaceInfo(  ":sample", listOnlyNamespaces = True )
# result: sample:sun

Previous topic

pymel.core.system.namespace

Next topic

pymel.core.system.newFile

Core

Core Modules

Other Modules

This Page