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

Synopsis

objectType( object , [isAType=string], [isType=string], [tagFromType=string], [typeFromTag=int], [typeTag=boolean])

Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.

objectType is undoable, NOT queryable, and NOT editable.

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

Return value

stringThe type of the specified object
booleanFor "isType": was the object of the specified type?

Related

addAttr, aliasAttr, attributeInfo, deleteAttr, getClassification, nodeType, objExists, renameAttr

Flags

isAType, isType, tagFromType, typeFromTag, typeTag
Long name (short name) Argument types Properties
isAType(isa) string create
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) string create
Returns true if the object is exactly of the specified type. False otherwise.
tagFromType(tgt) string create
Returns the type tag given a type name.
typeFromTag(tpt) int create
Returns the type name given an integer type tag.
typeTag(tt) boolean create
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 appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can have multiple arguments, passed either as a tuple or a list.

Python examples

import maya.cmds as cmds

# create an object to query type of
cmds.sphere( n='sphere1' )

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

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