class MDataBlock

Jump to documentation

Dependency node data block. (OpenMaya) (OpenMaya.py)

public members:

virtual ~MDataBlock ()
MDataHandle inputValue ( const MPlug & plug, MStatus * ReturnStatus = NULL )
MDataHandle inputValue ( const MObject & attribute, MStatus * ReturnStatus = NULL )
MDataHandle outputValue ( const MPlug & plug, MStatus * ReturnStatus = NULL )
MDataHandle outputValue ( const MObject & attribute, MStatus * ReturnStatus = NULL )
MArrayDataHandle inputArrayValue ( const MPlug & plug, MStatus * ReturnStatus = NULL )
MArrayDataHandle inputArrayValue ( const MObject & attribute, MStatus * ReturnStatus = NULL )
MArrayDataHandle outputArrayValue ( const MPlug & plug, MStatus * ReturnStatus = NULL )
MArrayDataHandle outputArrayValue ( const MObject & attribute, MStatus * ReturnStatus = NULL )
MStatus setClean ( const MPlug & plug )
MStatus setClean ( const MObject & attribute )
bool isClean ( const MPlug & plug )
bool isClean ( const MObject & attribute, MStatus * ReturnStatus=NULL )
MDGContext context ( MStatus * ReturnStatus = NULL )
MStatus setContext ( const MDGContext & ctx )

Documentation

The storage for the data of all of a node's plugs and attributes.
Description

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.

Functions

MDataBlock:: ~MDataBlock ()

Description

The class destructor.

MDataHandle MDataBlock:: inputValue ( const MPlug & plug, MStatus * ReturnStatus )

Description

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.

Arguments

  • plug the plug whose data you wish to access
  • ReturnStatus the return status

Return Value

  • data handle for the given plug's data

Status Codes

  • MS::kSuccess operation successful

MDataHandle MDataBlock:: inputValue ( const MObject & attribute, MStatus * ReturnStatus )

Description

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.

Arguments

  • attribute the attribute of the node that you want to access
  • ReturnStatus the return status

Return Value

  • data handle for the given attributes's data

Status Codes

  • MS::kSuccess operation successful
  • MS::kInvalidParameter object argument is invalid

MArrayDataHandle MDataBlock:: inputArrayValue ( const MPlug & plug, MStatus * ReturnStatus )

Description

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.

Arguments

  • plug the plug whose data you wish to access
  • ReturnStatus the return status

Return Value

  • array data handle for the given attributes's data

Status Codes

  • MS::kSuccess operation successful
  • MS::kInvalidParameter current element is not an array

MArrayDataHandle MDataBlock:: inputArrayValue ( const MObject & attribute, MStatus * ReturnStatus )

Description

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.

Arguments

  • attribute The attribute whose data you wish to access
  • ReturnStatus The return status

Return Value

  • array data handle for the given attributes's data

Status Codes

  • MS::kSuccess operation successful
  • MS::kInvalidParameter object argument is invalid

MDataHandle MDataBlock:: outputValue ( const MPlug & plug, MStatus * ReturnStatus )

Description

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.

Arguments

  • plug the plug whose data you wish to access
  • ReturnStatus the return status

Return Value

  • data handle for the given plug's data

Status Codes

  • MS::kSuccess operation successful

MDataHandle MDataBlock:: outputValue ( const MObject & attribute, MStatus * ReturnStatus )

Description

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.

Arguments

  • attribute the attribute of the node that you want to access
  • ReturnStatus the return status

Return Value

  • data handle for the given attribute's data

Status Codes

  • MS::kSuccess operation successful
  • MS::kInvalidParameter object argument is invalid

MArrayDataHandle MDataBlock:: outputArrayValue ( const MPlug & plug, MStatus * ReturnStatus )

Description

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.

Arguments

  • plug the plug whose data you wish to access
  • ReturnStatus the return status

Return Value

  • array data handle for the given plug's data

Status Codes

  • MS::kSuccess operation successful
  • MS::kInvalidParameter current element is not an array

MArrayDataHandle MDataBlock:: outputArrayValue ( const MObject & attribute, MStatus * ReturnStatus )

Description

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.

Arguments

  • attribute the attribute of the node that you want to access
  • ReturnStatus the return status

Return Value

  • array data handle for the given attribute's data

Status Codes

  • MS::kSuccess operation successful
  • MS::kInvalidParameter object argument is invalid

MStatus MDataBlock:: setClean ( const MPlug & plug )

Description

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.

Arguments

  • plug the plug that is to be marked clean

Return Value

  • result status code

Status Codes

  • MS::kSuccess operation successful
  • MS::kInvalidParameter object argument is invalid

bool MDataBlock:: isClean ( const MPlug & plug )

Description

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

Arguments

  • plug the plug that is to be query

Return Value

  • result boolean code, true if plug is clean, false otherwise.

bool MDataBlock:: isClean ( const MObject & attribute, MStatus * ReturnStatus )

Description

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

Arguments

  • attribute the attribute that is to be query

Return Value

  • result boolean code, true if the attribute is clean, false otherwise.

Status Codes

  • MS::kSuccess operation successful.
  • MS::kInvalidParameter The attribute is invalid.

MStatus MDataBlock:: setClean ( const MObject & attribute )

Description

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.

Arguments

  • attribute the attribute that we have updated the data for

Return Value

  • result status code

Status Codes

  • MS::kSuccess operation successful
  • MS::kInvalidParameter object argument is invalid

MDGContext MDataBlock:: context ( MStatus * ReturnStatus )

Description

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.

Arguments

  • ReturnStatus Status code

Return Value

  • the dependency graph context

Status Codes

  • MS::kSuccess operation successful
  • MS::kInvalidParameter object error

MStatus MDataBlock:: setContext ( const MDGContext & ctx )

Description

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.

Arguments

  • ctx the dependency graph context

Return Value

  • Status code

Status Codes

  • MS::kSuccess operation successful
  • MS::kInvalidParameter object error

This class has no child classes.


Autodesk® Maya® 2008 © 1997-2007 Autodesk, Inc. All rights reserved. doc++ Copyright