MDataBlock Class Reference
 
 
 
MDataBlock Class Reference

#include <MDataBlock.h>


Class Description

Dependency node data block.

An MDataBlock provides storage for the data being received by or sent by the node. It is the data for the plugs and attributes of the node. The data block is only valid during the compute method of the depend node. Pointers to the data block should not be retained after the compute method.

Access to the data in an MDataBlock is done using an MDataHandle or an MArrayDataHandle.

Examples:

AbcImport/AlembicNode.cpp, AbcImport/AlembicNode.h, affectsNode/affectsNode.cpp, animCubeNode/animCubeNode.cpp, anisotropicShader/anisotropicShader.cpp, apiMeshShape/apiMeshCreator.cpp, apiMeshShape/apiMeshCreator.h, apiMeshShape/apiMeshShape.cpp, apiMeshShape/apiMeshShape.h, arcLenNode/arcLenNode.cpp, AshliShader/GLSLShaderNode.cpp, backfillShader/backfillShader.cpp, blindDataShader/blindDataMesh.cpp, blindDataShader/blindDataMesh.h, blindDataShader/blindDataShader.cpp, blindDataShader/blindDataShader.h, brickShader/brickShader.cpp, buildRotationNode/buildRotationNode.cpp, 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, compositingShader/compositingShader.cpp, contrastShader/contrastShader.cpp, curvedArrowsNode/curvedArrowsNode.cpp, cvColorNode/cvColorNode.cpp, cvColorShader/cvColorShader.cpp, depthShader/depthShader.cpp, displacementShader/displacementShader.cpp, dx11Shader/dx11ConeAngleToHotspotConverter.cpp, dx11Shader/dx11ConeAngleToHotspotConverter.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, geometrySurfaceConstraint/geometrySurfaceConstraint.cpp, geometrySurfaceConstraint/geometrySurfaceConstraint.h, geomShader/geomShader.cpp, GLSLShaderNode.h, hwColorPerVertexShader/hwColorPerVertexShader.cpp, hwDecalBumpShader_NV20/hwDecalBumpShader_NV20.cpp, hwDecalBumpShader_NV20/hwDecalBumpShader_NV20.h, 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, manipOverride/rockingTransform2.cpp, meshOpCmd/meshOpNode.cpp, meshOpCmd/meshOpNode.h, MetadataSample/tweakMetadataNode.cpp, MetadataSample/tweakMetadataNode.h, mixtureShader/mixtureShader.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, 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, rockingTransformCheck/rockingTransform.cpp, rockingTransformCheck/rockingTransformCheck.cpp, rockingTransformCheck/rockingTransformCheck.h, selectClosestPointLocator/selectClosestPointLocator.cpp, shadowMatteShader/shadowMatteShader.cpp, shellNode/shellNode.cpp, shiftNode/shiftNode.cpp, simpleEmitter/simpleEmitter.cpp, simpleEmitter/simpleEmitter.h, simpleFluidEmitter/simpleFluidEmitter.cpp, simpleFluidEmitter/simpleFluidEmitter.h, simpleLoftNode/simpleLoftNode.cpp, simpleSpring/simpleSpring.cpp, simpleSpring/simpleSpring.h, sineNode/sineNode.cpp, slopeShader/slopeShaderNode.cpp, slopeShader/slopeShaderNode.h, solidCheckerShader/solidCheckerShader.cpp, splatDeformer/splatDeformer.cpp, splitUVCmd/splitUVNode.cpp, splitUVCmd/splitUVNode.h, sseDeformer/sseDeformer.cpp, stringFormatNode/stringFormatNode.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, volumeShader/volumeShader.cpp, weightListNode/weightListNode.cpp, and yTwistNode/yTwistNode.cpp.

List of all members.

Public Member Functions

virtual  ~MDataBlock ()
  The class destructor.
MDataHandle  inputValue (const MPlug &plug, MStatus *ReturnStatus=NULL)
  Gets a handle to this data block for the given plug's data.
MDataHandle  inputValue (const MObject &attribute, MStatus *ReturnStatus=NULL)
  Gets a handle to this data block for the given plug's data.
MDataHandle  outputValue (const MPlug &plug, MStatus *ReturnStatus=NULL)
  Gets a handle to this data block for the given attributes's data.
MDataHandle  outputValue (const MObject &attribute, MStatus *ReturnStatus=NULL)
  Gets a handle to this data block for the given attributes's data.
MArrayDataHandle  inputArrayValue (const MPlug &plug, MStatus *ReturnStatus=NULL)
  Gets an array handle to this data block for the given plug's data.
MArrayDataHandle  inputArrayValue (const MObject &attribute, MStatus *ReturnStatus=NULL)
  Gets an array handle to this data block for the given plug's data.
MArrayDataHandle  outputArrayValue (const MPlug &plug, MStatus *ReturnStatus=NULL)
  Gets a handle to this data block for the given plug.
MArrayDataHandle  outputArrayValue (const MObject &attribute, MStatus *ReturnStatus=NULL)
  Gets a handle to this data block for the given attributes's data.
MStatus  setClean (const MPlug &plug)
  Tells the dependency graph that the given plug has been updated and is now clean.
MStatus  setClean (const MObject &attribute)
  Tells the dependency graph that the given attribute has been updated and is now clean.
bool  isClean (const MPlug &plug)
  Queries the dependency graph to see whether the given plug is clean.
bool  isClean (const MObject &attribute, MStatus *ReturnStatus=NULL)
  Queries the dependency graph to see whether the given attribute is clean.
MDGContext  context (MStatus *ReturnStatus=NULL)
  Returns a copy of the dependecy graph context for which this data block was created.
MStatus  setContext (const MDGContext &ctx)
  Set the dependency graph context for this data block.

Static Public Member Functions

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

Friends

class  MArrayDataBuilder
class  MPxNode
class  MPxAssembly
class  MPlug

Member Function Documentation

MDataHandle inputValue ( const MPlug plug,
MStatus ReturnStatus = NULL 
)

Gets a handle to this data block for the given plug's data.

The data represented by the handle is guaranteed to be valid for reading. If the data is from a dirty connection, then the connection will be evaluated. If no connection is present, then the value that the plug has been set to will be returned. If the plug has not been set to a particular value, then the default value will be returned.

Parameters:
[in] plug the plug whose data you wish to access
[out] ReturnStatus the return status
Returns:
Data handle for the given plug's data
Status Codes:
Examples:
AbcImport/AlembicNode.cpp, affectsNode/affectsNode.cpp, animCubeNode/animCubeNode.cpp, anisotropicShader/anisotropicShader.cpp, apiMeshShape/apiMeshCreator.cpp, apiMeshShape/apiMeshShape.cpp, arcLenNode/arcLenNode.cpp, backfillShader/backfillShader.cpp, blindDataShader/blindDataMesh.cpp, brickShader/brickShader.cpp, buildRotationNode/buildRotationNode.cpp, cellShader/cellShader.cpp, cgfxVector.cpp, checkerShader/checkerShader.cpp, circleNode/circleNode.cpp, clearcoat.cpp, closestPointOnCurve/closestPointOnCurveNode.cpp, compositingShader/compositingShader.cpp, contrastShader/contrastShader.cpp, cvColorNode/cvColorNode.cpp, cvColorShader/cvColorShader.cpp, depthShader/depthShader.cpp, displacementShader/displacementShader.cpp, dx11Shader/dx11ConeAngleToHotspotConverter.cpp, dynExprField/dynExprField.cpp, fileTexture/fileTexture.cpp, flameShader/flameShader.cpp, gameInputDevice/gameInputDevice.cpp, gammaShader/gammaShader.cpp, genericAttributeNode/genericAttributeNode.cpp, geometrySurfaceConstraint/geometrySurfaceConstraint.cpp, geomShader/geomShader.cpp, hwColorPerVertexShader/hwColorPerVertexShader.cpp, hwPhongShader/hwPhongShader.cpp, hwToonShader_NV20/hwToonShader_NV20.cpp, interpShader/interpShader.cpp, jitterNode/jitterNode.cpp, lambertShader/lambertShader.cpp, latticeNoise/latticeNoiseNode.cpp, lavaShader/lavaShader.cpp, lightShader/lightShader.cpp, meshOpCmd/meshOpNode.cpp, MetadataSample/tweakMetadataNode.cpp, mixtureShader/mixtureShader.cpp, multiCurveNode/multiCurveNode.cpp, noiseShader/noiseShader.cpp, offsetNode/offsetNode.cpp, ownerEmitter/ownerEmitter.cpp, ownerEmitter/ownerEmitter.h, particleAttrNode/particleAttrNode.cpp, phongShader/phongShader.cpp, pointOnMeshInfo/pointOnMeshInfoNode.cpp, pointOnSubdNode/pointOnSubdNode.cpp, rockingTransformCheck/rockingTransformCheck.cpp, selectClosestPointLocator/selectClosestPointLocator.cpp, shadowMatteShader/shadowMatteShader.cpp, shiftNode/shiftNode.cpp, simpleEmitter/simpleEmitter.cpp, simpleEmitter/simpleEmitter.h, simpleFluidEmitter/simpleFluidEmitter.cpp, simpleLoftNode/simpleLoftNode.cpp, simpleSpring/simpleSpring.h, sineNode/sineNode.cpp, slopeShader/slopeShaderNode.cpp, solidCheckerShader/solidCheckerShader.cpp, splatDeformer/splatDeformer.cpp, splitUVCmd/splitUVNode.cpp, sseDeformer/sseDeformer.cpp, stringFormatNode/stringFormatNode.cpp, sweptEmitter/sweptEmitter.cpp, sweptEmitter/sweptEmitter.h, testNobjectNode/testNobjectNode.cpp, testNpassiveNode/testNpassiveNode.cpp, testNsolverNode/testNsolverNode.cpp, testNucleusNode/testNucleusNode.cpp, torusField/torusField.cpp, torusField/torusField.h, transCircleNode/transCircleNode.cpp, volumeShader/volumeShader.cpp, and yTwistNode/yTwistNode.cpp.
MDataHandle inputValue ( const MObject attribute,
MStatus ReturnStatus = NULL 
)

Gets a handle to this data block for the given plug's data.

The data represented by the handle is guaranteed to be valid for reading. If the data is from a dirty connection, then the connection will be evaluated. If no connection is present, then the value that the plug has been set to will be returned. If the plug has not been set to a particular value, then the default value will be returned.

Parameters:
[in] attribute the attribute of the node that you want to access
[out] ReturnStatus the return status
Returns:
Data handle for the given attributes's data
Status Codes:
MDataHandle outputValue ( const MPlug plug,
MStatus ReturnStatus = NULL 
)

Gets a handle to this data block for the given attributes's data.

The data is not guaranteed to be valid. No dependency graph evaluations will be done. Therefore, this handle should be used only for writing.

Parameters:
[in] plug the plug whose data you wish to access
[out] ReturnStatus the return status
Returns:
Data handle for the given plug's data
Status Codes:
Examples:
AbcImport/AlembicNode.cpp, affectsNode/affectsNode.cpp, animCubeNode/animCubeNode.cpp, anisotropicShader/anisotropicShader.cpp, apiMeshShape/apiMeshShape.cpp, arcLenNode/arcLenNode.cpp, AshliShader/GLSLShaderNode.cpp, backfillShader/backfillShader.cpp, blindDataShader/blindDataMesh.cpp, blindDataShader/blindDataShader.cpp, brickShader/brickShader.cpp, buildRotationNode/buildRotationNode.cpp, cellShader/cellShader.cpp, cgfxShaderNode.cpp, cgfxVector.cpp, checkerShader/checkerShader.cpp, circleNode/circleNode.cpp, clearcoat.cpp, closestPointOnCurve/closestPointOnCurveNode.cpp, compositingShader/compositingShader.cpp, contrastShader/contrastShader.cpp, cvColorNode/cvColorNode.cpp, cvColorShader/cvColorShader.cpp, depthShader/depthShader.cpp, displacementShader/displacementShader.cpp, dx11Shader/dx11ConeAngleToHotspotConverter.cpp, fileTexture/fileTexture.cpp, flameShader/flameShader.cpp, fullLoftNode/fullLoftNode.cpp, gameInputDevice/gameInputDevice.cpp, gammaShader/gammaShader.cpp, genericAttributeNode/genericAttributeNode.cpp, geometrySurfaceConstraint/geometrySurfaceConstraint.cpp, geomShader/geomShader.cpp, hwColorPerVertexShader/hwColorPerVertexShader.cpp, hwDecalBumpShader_NV20/hwDecalBumpShader_NV20.cpp, hwPhongShader/hwPhongShader.cpp, hwReflectBumpShader_NV20/hwReflectBumpShader_NV20.cpp, hwRefractReflectShader_NV20/hwRefractReflectShader_NV20.cpp, hwToonShader_NV20/hwToonShader_NV20.cpp, hwUnlitShader/hwUnlitShader.cpp, interpShader/interpShader.cpp, jitterNode/jitterNode.cpp, lambertShader/lambertShader.cpp, latticeNoise/latticeNoiseNode.cpp, lavaShader/lavaShader.cpp, lightShader/lightShader.cpp, manipOverride/rockingTransform2.cpp, meshOpCmd/meshOpNode.cpp, MetadataSample/tweakMetadataNode.cpp, mixtureShader/mixtureShader.cpp, noiseShader/noiseShader.cpp, particleAttrNode/particleAttrNode.cpp, phongShader/phongShader.cpp, pointOnMeshInfo/pointOnMeshInfoNode.cpp, pointOnSubdNode/pointOnSubdNode.cpp, randomizerDevice/randomizerDevice.cpp, renderAccessNode/renderAccessNode.cpp, rockingTransform/rockingTransform.cpp, rockingTransformCheck/rockingTransform.cpp, rockingTransformCheck/rockingTransformCheck.cpp, shadowMatteShader/shadowMatteShader.cpp, shellNode/shellNode.cpp, shiftNode/shiftNode.cpp, simpleLoftNode/simpleLoftNode.cpp, sineNode/sineNode.cpp, slopeShader/slopeShaderNode.cpp, solidCheckerShader/solidCheckerShader.cpp, splatDeformer/splatDeformer.cpp, splitUVCmd/splitUVNode.cpp, sseDeformer/sseDeformer.cpp, stringFormatNode/stringFormatNode.cpp, testNobjectNode/testNobjectNode.cpp, testNpassiveNode/testNpassiveNode.cpp, transCircleNode/transCircleNode.cpp, udpDevice/udpDevice.cpp, and volumeShader/volumeShader.cpp.
MDataHandle outputValue ( const MObject attribute,
MStatus ReturnStatus = NULL 
)

Gets a handle to this data block for the given attributes's data.

The data is not guaranteed to be valid. No dependency graph evaluations will be done. Therefore, this handle should be used only for writing.

Parameters:
[in] attribute the attribute of the node that you want to access
[out] ReturnStatus the return status
Returns:
Data handle for the given attribute's data
Status Codes:
MArrayDataHandle inputArrayValue ( const MPlug plug,
MStatus ReturnStatus = NULL 
)

Gets an array handle to this data block for the given plug's data.

This is only valid if the given plug has array data. The data represented by the handle will be valid. If the data is from a dirty connection, then the connection will be evaluated. If no connection is present, then the value that the plug has been set to will be returned. If the plug has not been set to a particular value, then the default value will be returned.

Parameters:
[in] plug the plug whose data you wish to access
[out] ReturnStatus the return status
Returns:
Array data handle for the given attributes's data
Status Codes:
Examples:
anisotropicShader/anisotropicShader.cpp, backfillShader/backfillShader.cpp, dynExprField/dynExprField.cpp, fullLoftNode/fullLoftNode.cpp, geometrySurfaceConstraint/geometrySurfaceConstraint.cpp, lambertShader/lambertShader.cpp, ownerEmitter/ownerEmitter.h, phongShader/phongShader.cpp, shadowMatteShader/shadowMatteShader.cpp, simpleEmitter/simpleEmitter.h, sweptEmitter/sweptEmitter.h, testNsolverNode/testNsolverNode.cpp, testNucleusNode/testNucleusNode.cpp, and weightListNode/weightListNode.cpp.
MArrayDataHandle inputArrayValue ( const MObject attribute,
MStatus ReturnStatus = NULL 
)

Gets an array handle to this data block for the given plug's data.

This is only valid if the given plug has array data. The data represented by the handle will be valid. If the data is from a dirty connection, then the connection will be evaluated. If no connection is present, then the value that the plug has been set to will be returned. If the plug has not been set to a particular value, then the default value will be returned.

Parameters:
[in] attribute The attribute whose data you wish to access
[out] ReturnStatus The return status
Returns:
Array data handle for the given attributes's data
Status Codes:
MArrayDataHandle outputArrayValue ( const MPlug plug,
MStatus ReturnStatus = NULL 
)

Gets a handle to this data block for the given plug.

No dependency graph evaluations will be done, and therefore the data is not guaranteed to be valid (i.e. it may be dirty). Typically, this method is used to get the handle during compute in order to write output data to it.

Another usage of this method is to access an input array attribute without evaluating any of its array elements. One can then use MArrayDataHandle::jumpToElement to get to the particular element of interest, and evaluate its value using MArrayDataHandle::inputValue.

Parameters:
[in] plug the plug whose data you wish to access
[out] ReturnStatus the return status
Returns:
Array data handle for the given plug's data
Status Codes:
Examples:
apiMeshShape/apiMeshShape.cpp, dynExprField/dynExprField.cpp, multiCurveNode/multiCurveNode.cpp, ownerEmitter/ownerEmitter.cpp, simpleEmitter/simpleEmitter.cpp, stringFormatNode/stringFormatNode.cpp, sweptEmitter/sweptEmitter.cpp, and torusField/torusField.cpp.
MArrayDataHandle outputArrayValue ( const MObject attribute,
MStatus ReturnStatus = NULL 
)

Gets a handle to this data block for the given attributes's data.

The data is not guaranteed to be valid. No dependency graph evaluations will be done. Therefore, this handle should be used only for writing.

Parameters:
[in] attribute the attribute of the node that you want to access
[out] ReturnStatus the return status
Returns:
Array data handle for the given attribute's data
Status Codes:
MStatus setClean ( const MPlug plug )

Tells the dependency graph that the given plug has been updated and is now clean.

This should be called after the data in the plug has been recalculated from the inputs of the node.

Parameters:
[in] plug the plug that is to be marked clean
Returns:
Result status code
Status Codes:
Examples:
AbcImport/AlembicNode.cpp, affectsNode/affectsNode.cpp, animCubeNode/animCubeNode.cpp, anisotropicShader/anisotropicShader.cpp, apiMeshShape/apiMeshCreator.cpp, arcLenNode/arcLenNode.cpp, blindDataShader/blindDataMesh.cpp, cgfxVector.cpp, circleNode/circleNode.cpp, closestPointOnCurve/closestPointOnCurveNode.cpp, cvColorNode/cvColorNode.cpp, dynExprField/dynExprField.cpp, fullLoftNode/fullLoftNode.cpp, gameInputDevice/gameInputDevice.cpp, genericAttributeNode/genericAttributeNode.cpp, geometrySurfaceConstraint/geometrySurfaceConstraint.cpp, hwColorPerVertexShader/hwColorPerVertexShader.cpp, jitterNode/jitterNode.cpp, latticeNoise/latticeNoiseNode.cpp, ownerEmitter/ownerEmitter.cpp, pointOnMeshInfo/pointOnMeshInfoNode.cpp, pointOnSubdNode/pointOnSubdNode.cpp, randomizerDevice/randomizerDevice.cpp, shellNode/shellNode.cpp, simpleEmitter/simpleEmitter.cpp, simpleLoftNode/simpleLoftNode.cpp, sineNode/sineNode.cpp, sweptEmitter/sweptEmitter.cpp, testNobjectNode/testNobjectNode.cpp, testNsolverNode/testNsolverNode.cpp, testNucleusNode/testNucleusNode.cpp, torusField/torusField.cpp, transCircleNode/transCircleNode.cpp, and udpDevice/udpDevice.cpp.
MStatus setClean ( const MObject attribute )

Tells the dependency graph that the given attribute has been updated and is now clean.

This should be called after the data in the plug has been recalculated from the inputs of the node.

Parameters:
[in] attribute the attribute that we have updated the data for
Returns:
Result status code
Status Codes:
bool isClean ( const MPlug plug )

Queries the dependency graph to see whether the given plug is clean.

Parameters:
[in] plug the plug that is to be query
Returns:
Result boolean code, true if plug is clean, false otherwise.
bool isClean ( const MObject attribute,
MStatus ReturnStatus = NULL 
)

Queries the dependency graph to see whether the given attribute is clean.

Parameters:
[in] attribute The attribute to query.
[out] ReturnStatus Status code.
Returns:
true if the attribute is clean, false otherwise.
Status Codes:
MDGContext context ( MStatus ReturnStatus = NULL )

Returns a copy of the dependecy graph context for which this data block was created.

The context is used to specify how a dependency node is going to be evaluated.

Parameters:
[out] ReturnStatus Status code
Returns:
The dependency graph context
Status Codes:
Examples:
rockingTransformCheck/rockingTransformCheck.cpp.
MStatus setContext ( const MDGContext ctx )

Set the dependency graph context for this data block.

The context is used to specify how a dependency node is going to be evaluated, thus replacing the context for the given datablock. This does not modify the dirty state of the datablock so that they apply to the new context.

This function should not be used for timed evaluation.

Parameters:
[in] ctx the dependency graph context
Returns:
Status code
Status Codes:
const char * className ( ) [static]

Returns the name of this class.

Returns:
Name of this class.

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