pymel.core.general.objectType

objectType(*args, **kwargs)

This command returns the type of elements. Warning: This command is incomplete and may not be supported by all object types.

Flags:

Long Name / Short Name Argument Types Properties
convertTag / ct unicode  
   
isAType / isa unicode ../../../_images/create.gif
  Returns true if the object is the specified type or derives from an object that is of the specified type. This flag will only work with dependency nodes.
isType / i unicode ../../../_images/create.gif
  Returns true if the object is exactly of the specified type. False otherwise.
tagFromType / tgt unicode ../../../_images/create.gif
  Returns the type tag given a type name.
typeFromTag / tpt int ../../../_images/create.gif
  Returns the type name given an integer type tag.
typeTag / tt bool ../../../_images/create.gif
  Returns an integer tag that is unique for that object type. Not all object types will have tags. This is the unique 4-byte value that is used to identify nodes of a given type in the binary file format. Flag can have multiple arguments, passed either as a tuple or a list.

Derived from mel command maya.cmds.objectType

Example:

import pymel.core as pm

# create an object to query type of
pm.sphere( n='sphere1' )
# Result: [nt.Transform(u'sphere1'), nt.MakeNurbSphere(u'makeNurbSphere1')] #

# To query the type of an object:
pm.objectType( 'sphere1Shape' )
# Result: u'nurbsSurface' #

# To confirm that sphere1Shape really is a nurbs surface:
pm.objectType( 'sphere1Shape', isType='nurbsSurface' )
# Result: True #