pymel.core.general.nodeType

nodeType(node, **kwargs)

This command returns a string which identifies the given node’s type. When no flags are used, the unique type name is returned. This can be useful for seeing if two nodes are of the same type. When the apiflag is used, the MFn::Type of the node is returned. This can be useful for seeing if a plug-in node belongs to a given class. The apiflag cannot be used in conjunction with any other flags. When the derivedflag is used, the command returns a string array containing the names of all the currently known node types which derive from the node type of the given object. When the inheritedflag is used, the command returns a string array containing the names of all the base node types inherited by the the given node. If the isTypeNameflag is present then the argument provided to the command is taken to be the name of a node type rather than the name of a specific node. This makes it possible to query the hierarchy of node types without needing to have instances of each node type.

Note: this will return the dg node type for an object, like maya.cmds.nodeType,

NOT the pymel PyNode class. For objects like components or attributes, nodeType will return the dg type of the node to which the PyNode is attached.

rtype:unicode
Flags:
Long name (short name) Argument Types Properties
apiType (api) bool ../../../_images/create.gif
 

Return the MFn::Type value (as a string) corresponding to the given node. This is particularly useful when the given node is defined by a plug-in, since in this case, the MFn::Type value corresponds to the underlying proxy class. This flag cannot be used in combination with any of the other flags.

derived (d) bool ../../../_images/create.gif
 
Return a string array containing the names of all the currently known node types which derive from the type of the specified node.
inherited (i) bool ../../../_images/create.gif
 
Return a string array containing the names of all the base node types inherited by the specified node.
isTypeName (itn) bool ../../../_images/create.gif
 

If this flag is present, then the argument provided to the command is the name of a node type rather than the name of a specific node.Flag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list.

Derived from mel command maya.cmds.nodeType

Example:

import pymel.core as pm

import maya.cmds as cmds

pm.sphere( n='balloon' )
# Result: [nt.Transform(u'balloon'), nt.MakeNurbSphere(u'makeNurbSphere1')] #

# Find the type of node created by the sphere command
pm.nodeType( 'balloon' )
# Result: u'transform' #

# What is the API type of the balloon node?
pm.nodeType( 'balloon', api=True )
# Result: u'kTransform' #

# Which node types derive from camera?
pm.nodeType( 'camera', derived=True, isTypeName=True )
# Result: [u'stereoRigCamera', u'camera'] #

Previous topic

pymel.core.general.nodeCast

Next topic

pymel.core.general.objExists

Core

Core Modules

Other Modules

This Page