MTypeId Class Reference
 
 
 

#include <MTypeId.h>


Class Description

Manage Maya Object type identifiers.

In Maya, both intrinsic and user-defined Maya Objects are registered and recognized by their type identifier or type id. The basis of the type id system is a tag which is used at run-time to determine how to create and destroy Maya Objects, and how they are to be input/output from/to files. These tag-based identifiers are implemented by the class MTypeId.

Use the MTypeId class to create, copy and query Maya Object type identifiers.

It is very important to note that these ids are written into the Maya binary file format. So, once an id is assigned to a node or data type it can never be changed while any existing Maya file contains an instance of that node or data type. If a change is made, such files will become unreadable.

Thus, even though we provide a range of reserved ids that you can use for internal plug-ins, Autodesk highly recommends that you obtain a globally unique id range (see below) and use ids from this range for all your plug-ins, even internal ones. This can prevent significant headaches later if the plans for your plug-ins change.

There are 2 forms of the constructor for this class that can be used depending on whether the plug-in id is internal or globally unique.

For plug-ins that will forever be internal to your site use the constructor that takes a single unsigned int parameter. The numeric range 0 - 0x7ffff (524288 ids) has been reserved for such plug-ins.

The example plug-ins provided with Maya in the plug-in development kit will use ids in the range 0x80000 - 0xfffff (524288 ids). If you customize one of these example plug-ins, you should change the id to avoid future conflicts.

Plug-ins that are intended to be shared between sites will need to have a globally unique id. The Autodesk Developer Network (ADN) will provide such id's in blocks of 256. You will be assigned one or more 24-bit prefixes. Once this has been obtained, used the MTypeId constructor that takes 2 unsigned int parameters. The prefix goes in the first parameter, and you are responsible for managing the allocation of the 256 ids that go into the second parameter.

Examples:

AbcImport/AlembicNode.h, AbcImport/main.cpp, affectsNode/affectsNode.cpp, animCubeNode/animCubeNode.cpp, anisotropicShader/anisotropicShader.cpp, apiMeshShape/apiMeshCreator.cpp, apiMeshShape/apiMeshCreator.h, apiMeshShape/apiMeshData.cpp, apiMeshShape/apiMeshData.h, apiMeshShape/apiMeshShape.cpp, apiMeshShape/apiMeshShape.h, apiSimpleShape/apiSimpleShape.cpp, apiSimpleShape/apiSimpleShape.h, arcLenNode/arcLenNode.cpp, AshliShader/GLSLShaderNode.cpp, backfillShader/backfillShader.cpp, blindComplexDataCmd/blindComplexDataCmd.cpp, blindDataShader/blindDataMesh.cpp, blindDataShader/blindDataMesh.h, blindDataShader/blindDataShader.cpp, blindDataShader/blindDataShader.h, blindDoubleDataCmd/blindDoubleDataCmd.cpp, brickShader/brickShader.cpp, buildRotationNode/buildRotationNode.cpp, cameraSetSubclass/exCameraSet.cpp, cameraSetSubclass/exCameraSet.h, cellShader/cellShader.cpp, cgfxShaderNode.cpp, cgfxShaderNode.h, cgfxVector.cpp, cgfxVector.h, checkerShader/checkerShader.cpp, circleNode/circleNode.cpp, clearcoat.cpp, closestPointOnCurve/closestPointOnCurveNode.cpp, closestPointOnCurve/closestPointOnCurveNode.h, componentScaleManip/componentScaleManip.cpp, compositingShader/compositingShader.cpp, contrastShader/contrastShader.cpp, curvedArrowsNode/curvedArrowsNode.cpp, customAttrManip/customAttrManip.cpp, customImagePlane/customImagePlane.cpp, customTextureShader/customTextureShader.cpp, customTextureShader/customTextureShader.h, cvColorNode/cvColorNode.cpp, cvColorShader/cvColorShader.cpp, depthShader/depthShader.cpp, displacementShader/displacementShader.cpp, dx11Shader/dx11ConeAngleToHotspotConverter.cpp, dx11Shader/dx11ConeAngleToHotspotConverter.h, dx11Shader/dx11Shader.cpp, dx11Shader/dx11Shader.h, dynExprField/dynExprField.cpp, dynExprField/dynExprField.h, exampleRampAttribute/exampleMRampAttribute.cpp, fileTexture/fileTexture.cpp, flameShader/flameShader.cpp, footPrintManip/footPrintManip.cpp, footPrintNode/footPrintNode.cpp, fullLoftNode/fullLoftNode.cpp, gameInputDevice/gameInputDevice.cpp, gammaShader/gammaShader.cpp, genericAttributeNode/genericAttributeNode.cpp, geometryReplicator/geometryReplicator.cpp, geometrySurfaceConstraint/geometrySurfaceConstraint.cpp, geometrySurfaceConstraint/geometrySurfaceConstraint.h, geomShader/geomShader.cpp, GLSLShaderNode.h, gpuCache/gpuCacheShapeNode.cpp, gpuCache/gpuCacheShapeNode.h, hlslShader/hlslShader.cpp, hlslShader/hlslShader.h, hwAnisotropicShader_NV20/hwAnisotropicShader_NV20.cpp, hwAnisotropicShader_NV20/hwAnisotropicShader_NV20.h, hwColorPerVertexShader/hwColorPerVertexShader.cpp, hwDecalBumpShader_NV20/hwDecalBumpShader_NV20.cpp, hwDecalBumpShader_NV20/hwDecalBumpShader_NV20.h, hwManagedTextureShader/hwManagedTextureShader.cpp, hwPhongShader/hwPhongShader.cpp, hwPhongShader/hwPhongShader.h, hwReflectBumpShader_NV20/hwReflectBumpShader_NV20.cpp, hwReflectBumpShader_NV20/hwReflectBumpShader_NV20.h, hwRefractReflectShader_NV20/hwRefractReflectShader_NV20.cpp, hwRefractReflectShader_NV20/hwRefractReflectShader_NV20.h, hwToonShader_NV20/hwToonShader_NV20.cpp, hwToonShader_NV20/hwToonShader_NV20.h, hwUnlitShader/hwUnlitShader.cpp, hwUnlitShader/hwUnlitShader.h, interpShader/interpShader.cpp, jitterNode/jitterNode.cpp, lambertShader/lambertShader.cpp, latticeNoise/latticeNoise.h, latticeNoise/latticeNoiseNode.cpp, lavaShader/lavaShader.cpp, lightShader/lightShader.cpp, lineManip/lineManip.cpp, lineManip/lineManip.h, lineManipContainer/lineManipContainer.cpp, lineManipContainer/lineManipContainer.h, manipOverride/customTriadManip.cpp, manipOverride/customTriadManip.h, manipOverride/manipOverride.cpp, manipOverride/rockingTransform2.cpp, manipOverride/rockingTransform2.h, meshOpCmd/meshOpNode.cpp, meshOpCmd/meshOpNode.h, meshOpCmd/polyModifierCmd.h, MetadataSample/tweakMetadataNode.cpp, MetadataSample/tweakMetadataNode.h, mixtureShader/mixtureShader.cpp, moveManip/moveManip.cpp, multiCurveNode/multiCurveNode.cpp, noiseShader/noiseShader.cpp, offsetNode/offsetNode.cpp, ownerEmitter/ownerEmitter.cpp, ownerEmitter/ownerEmitter.h, particleAttrNode/particleAttrNode.cpp, particleAttrNode/particleAttrNode.h, phongShader/phongShader.cpp, pnTriangles/pnTrianglesNode.cpp, pnTriangles/pnTrianglesNode.h, pointOnMeshInfo/pointOnMeshInfoNode.cpp, pointOnMeshInfo/pointOnMeshInfoNode.h, pointOnSubdNode/pointOnSubdNode.cpp, pointOnSubdNode/pointOnSubdNode.h, polyTrgNode/polyTrgNode.cpp, quadricShape/quadricShape.cpp, randomizerDevice/randomizerDevice.cpp, renderAccessNode/renderAccessNode.cpp, rockingTransform/rockingTransform.cpp, rockingTransform/rockingTransform.h, rockingTransformCheck/rockingTransform.cpp, rockingTransformCheck/rockingTransform.h, rockingTransformCheck/rockingTransformCheck.cpp, rockingTransformCheck/rockingTransformCheck.h, rotateManip/rotateManip.cpp, sceneAssembly/adskPrepareRenderGlobals.cpp, sceneAssembly/adskPrepareRenderGlobals.h, sceneAssembly/assemblyDefinition.cpp, sceneAssembly/assemblyDefinition.h, sceneAssembly/assemblyReference.cpp, sceneAssembly/assemblyReference.h, selectClosestPointLocator/selectClosestPointLocator.cpp, selectClosestPointLocator/selectClosestPointLocator.h, shadowMatteShader/shadowMatteShader.cpp, shellNode/shellNode.cpp, shiftNode/shiftNode.cpp, simpleEmitter/simpleEmitter.cpp, simpleEmitter/simpleEmitter.h, simpleFluidEmitter/simpleFluidEmitter.cpp, simpleFluidEmitter/simpleFluidEmitter.h, simpleLoftNode/simpleLoftNode.cpp, simpleSolverNode/simpleSolverNode.cpp, simpleSpring/simpleSpring.cpp, simpleSpring/simpleSpring.h, sineNode/sineNode.cpp, slopeShader/slopeShaderNode.cpp, slopeShader/slopeShaderNode.h, solidCheckerShader/solidCheckerShader.cpp, splatDeformer/splatDeformer.cpp, splitUVCmd/polyModifierCmd.h, splitUVCmd/splitUVNode.cpp, splitUVCmd/splitUVNode.h, squareScaleManip/squareScaleManip.cpp, squareScaleManip/squareScaleManip.h, squareScaleManipContext/squareScaleManipContext.cpp, squareScaleManipContext/squareScaleManipContext.h, sseDeformer/sseDeformer.cpp, stringFormatNode/stringFormatNode.cpp, surfaceBumpManip/surfaceBumpManip.cpp, sweptEmitter/sweptEmitter.cpp, sweptEmitter/sweptEmitter.h, swissArmyManip/swissArmyManip.cpp, testNobjectNode/testNobjectNode.cpp, testNobjectNode/testNobjectNode.h, testNpassiveNode/testNpassiveNode.cpp, testNpassiveNode/testNpassiveNode.h, testNsolverNode/testNsolverNode.cpp, testNsolverNode/testNsolverNode.h, testNucleusNode/testNucleusNode.cpp, testNucleusNode/testNucleusNode.h, torusField/torusField.cpp, torusField/torusField.h, transCircleNode/transCircleNode.cpp, udpDevice/udpDevice.cpp, uiDrawManager/uiDrawManager.cpp, volumeShader/volumeShader.cpp, weightListNode/weightListNode.cpp, xmlAssembly/XMLAssembly.cpp, xmlAssembly/XMLAssembly.h, and yTwistNode/yTwistNode.cpp.

List of all members.

Public Member Functions

  MTypeId ()
  Default constructor.
  ~MTypeId ()
  Class destructor.
  MTypeId (unsigned int id)
  Constructor which takes a 32 bit id.
  MTypeId (unsigned int prefix, unsigned int id)
  Constructor which takes a prefix for a block of 256 ids, and an id within that block.
  MTypeId (const MTypeId &src)
  Copy constructor.
MTypeId operator= (const MTypeId &rhs)
  Assignment operator.
bool  operator== (const MTypeId &rhs) const
  Equivalence operator.
bool  operator!= (const MTypeId &rhs) const
  Inequality operator.
unsigned int  id (MStatus *ReturnStatus=NULL) const
  Return the 32 bit id tag contained in the MTypeId instance.

Static Public Member Functions

static const char *  className ()
  Returns the name of this class.

Constructor & Destructor Documentation

MTypeId ( )

Default constructor.

Creates an undefined type id.

MTypeId ( unsigned int  id )

Constructor which takes a 32 bit id.

Parameters:
[in] id the numeric id
MTypeId ( unsigned int  prefix,
unsigned int  id 
)

Constructor which takes a prefix for a block of 256 ids, and an id within that block.

The prefix parameter will be obtained from Autodesk and is guaranteed to be globally unique. The id parameter can have a valid range of 0 - 255. Thus each prefix provides a customer managed namespace of 256 globally unique ids.

This constructor masks off high order bits to clamp prefix to 24 bits and id to 8 bits. id is then appended to prefix to form the final 32 bit id.

Parameters:
[in] prefix a 24 bit integer - higher order bits are ignored
[in] id an 8 bit integer - higher order bits are ignored
MTypeId ( const MTypeId src )

Copy constructor.

Parameters:
[in] src the MTypeId to copy.

Member Function Documentation

MTypeId & operator= ( const MTypeId rhs )

Assignment operator.

Allows assignment between MTypeIds.

Parameters:
[in] rhs MTypeId to copy from.
Returns:
A reference to the newly assigned object.
bool operator== ( const MTypeId rhs ) const

Equivalence operator.

Parameters:
[in] rhs MTypeId to compare with.
Returns:
True of the two MTypeId hold the same 32-bit binary tag.
bool operator!= ( const MTypeId rhs ) const

Inequality operator.

Parameters:
[in] rhs MTypeId to compare with.
Returns:
True of the two MTypeId hold different 32-bit binary tags.
unsigned int id ( MStatus ReturnStatus = NULL ) const

Return the 32 bit id tag contained in the MTypeId instance.

Parameters:
[out] ReturnStatus MS::kSuccess if success, otherwise MS::kFailure
Returns:
The 32-bit id tag contained in this MTypeId instance.
const char * className ( ) [static]

Returns the name of this class.

Returns:
The name of this class.

The documentation for this class was generated from the following files: