MTypeId Class Reference
[OpenMaya - API module for common classes]

#include <MTypeId.h>

List of all members.


Detailed 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:

affectsNode.cpp, animCubeNode.cpp, anisotropicShader.cpp, apiMeshCreator.cpp, apiMeshCreator.h, apiMeshData.cpp, apiMeshData.h, apiMeshShape.cpp, apiMeshShape.h, apiSimpleShape.cpp, apiSimpleShape.h, arcLenNode.cpp, backfillShader.cpp, blindComplexDataCmd.cpp, blindDataMesh.cpp, blindDataMesh.h, blindDataShader.cpp, blindDataShader.h, blindDoubleDataCmd.cpp, brickShader.cpp, buildRotationNode.cpp, cellShader.cpp, cgfxShaderNode.cpp, cgfxShaderNode.h, cgfxVector.cpp, cgfxVector.h, checkerShader.cpp, circleNode.cpp, clearcoat.cpp, closestPointOnCurveNode.cpp, closestPointOnCurveNode.h, componentScaleManip.cpp, compositingShader.cpp, contrastShader.cpp, curvedArrowsNode.cpp, customAttrManip.cpp, customImagePlane.cpp, cvColorNode.cpp, cvColorShader.cpp, depthShader.cpp, displacementShader.cpp, dynExprField.cpp, dynExprField.h, exampleMRampAttribute.cpp, flameShader.cpp, footPrintManip.cpp, footPrintNode.cpp, fullLoftNode.cpp, gammaShader.cpp, genericAttributeNode.cpp, geometrySurfaceConstraint.cpp, geometrySurfaceConstraint.h, geomShader.cpp, GLSLShaderNode.cpp, GLSLShaderNode.h, hlslShader.cpp, hlslShader.h, hwAnisotropicShader_NV20.cpp, hwAnisotropicShader_NV20.h, hwColorPerVertexShader.cpp, hwDecalBumpShader_NV20.cpp, hwDecalBumpShader_NV20.h, hwManagedTextureShader.cpp, hwPhongShader.cpp, hwPhongShader.h, hwReflectBumpShader_NV20.cpp, hwReflectBumpShader_NV20.h, hwRefractReflectShader_NV20.cpp, hwRefractReflectShader_NV20.h, hwToonShader_NV20.cpp, hwToonShader_NV20.h, hwUnlitShader.cpp, hwUnlitShader.h, interpShader.cpp, jitterNode.cpp, lambertShader.cpp, latticeNoise.h, latticeNoiseNode.cpp, lavaShader.cpp, lightShader.cpp, lineManip.cpp, lineManip.h, lineManipContainer.cpp, lineManipContainer.h, meshOpNode.cpp, meshOpNode.h, mixtureShader.cpp, moveManip.cpp, multiCurveNode.cpp, noiseShader.cpp, offsetNode.cpp, ownerEmitter.cpp, ownerEmitter.h, particleAttrNode.cpp, particleAttrNode.h, phongShader.cpp, pnTrianglesNode.cpp, pnTrianglesNode.h, pointOnMeshInfoNode.cpp, pointOnMeshInfoNode.h, pointOnSubdNode.cpp, pointOnSubdNode.h, polyModifierCmd.h, polyTrgNode.cpp, quadricShape.cpp, renderAccessNode.cpp, rockingTransform.cpp, rockingTransform.h, rockingTransformCheck.cpp, rockingTransformCheck.h, rotateManip.cpp, shadowMatteShader.cpp, shellNode.cpp, shiftNode.cpp, simpleEmitter.cpp, simpleEmitter.h, simpleFluidEmitter.cpp, simpleFluidEmitter.h, simpleLoftNode.cpp, simpleSolverNode.cpp, simpleSpring.cpp, simpleSpring.h, sineNode.cpp, slopeShaderNode.cpp, slopeShaderNode.h, solidCheckerShader.cpp, splitUVNode.cpp, splitUVNode.h, squareScaleManip.cpp, squareScaleManip.h, squareScaleManipContext.cpp, squareScaleManipContext.h, stringFormatNode.cpp, surfaceBumpManip.cpp, sweptEmitter.cpp, sweptEmitter.h, swissArmyManip.cpp, testNobjectNode.cpp, testNobjectNode.h, testNucleusNode.cpp, testNucleusNode.h, torusField.cpp, torusField.h, transCircleNode.cpp, volumeShader.cpp, weightListNode.cpp, and yTwistNode.cpp.


Public Member Functions

 MTypeId ()
 ~MTypeId ()
 MTypeId (unsigned int id)
 MTypeId (unsigned int prefix, unsigned int id)
 MTypeId (const MTypeId &src)
MTypeIdoperator= (const MTypeId &rhs)
bool operator== (const MTypeId &rhs) const
bool operator!= (const MTypeId &rhs) const
unsigned int id (MStatus *ReturnStatus=NULL) const

Constructor & Destructor Documentation

MTypeId::MTypeId (  ) 

Default constructor. Creates an undefined type id.

MTypeId::~MTypeId (  ) 

Class destructor.

MTypeId::MTypeId ( unsigned int  id  ) 

Class constructor for ids used in internal plug-ins. The parameter to this constructor must be a number in the range 0 - 0x7ffff.

Parameters:
[in] id the numeric id tag

MTypeId::MTypeId ( unsigned int  prefix,
unsigned int  id 
)

Class constructor for ids used in plug-ins that are globally unique. 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 globally unique prefix provides a customer managed namespace of 256 ids.

This constructor masks off the low order 8 bits of the prefix parameter and and high order 24 bits of the id parameter so it is essential to ensure that the provided parameters are in their valid numeric ranges.

Parameters:
[in] prefix a 24 bit integer - the low order 8 bits are ignored
[in] id an 8 bit integer - the high order 24 bits are ignored

MTypeId::MTypeId ( const MTypeId src  ) 

Copy constructor.

Parameters:
[in] src the MTypeId to copy.


Member Function Documentation

MTypeId & 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 MTypeId::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 MTypeId::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 MTypeId::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.


Autodesk® Maya® 2009 © 1997-2008 Autodesk, Inc. All rights reserved. Generated with doxygen 1.5.6