class MDGMessage

Jump to documentation

: public MMessage Dependency graph messages. (OpenMaya) (OpenMaya.py)

Inheritance:

MDGMessage < MMessage

public members:

static MCallbackId addTimeChangeCallback ( MMessage::MTimeFunction func, void * clientData = NULL, MStatus * ReturnStatus = NULL )
TimeChange callback
static MCallbackId addForceUpdateCallback ( MMessage::MTimeFunction func, void * clientData = NULL, MStatus * ReturnStatus = NULL )
ForceUpdate callback
static MCallbackId addNodeAddedCallback ( MMessage::MNodeFunction func, const MString & nodeType = kDefaultNodeType, void * clientData = NULL, MStatus * ReturnStatus = NULL )
NodeAdded callback
static MCallbackId addNodeRemovedCallback ( MMessage::MNodeFunction func, const MString & nodeType = kDefaultNodeType, void * clientData = NULL, MStatus * ReturnStatus = NULL )
NodeRemoved callback
static MCallbackId addConnectionCallback ( MMessage::MPlugFunction func, void * clientData = NULL, MStatus * ReturnStatus = NULL )
Connection callback

Inherited from MMessage:

public members:

static MStatus removeCallback ( MCallbackId id )
static MStatus removeCallbacks ( MCallbackIdArray &ids )
static MCallbackId currentCallbackId ( MStatus * ReturnStatus = NULL )
static MStatus nodeCallbacks ( MObject & node, MCallbackIdArray & ids )
static void setRegisteringCallableScript ()
static bool registeringCallableScript ()
static MStatus removeCallbacks ( MIntArray &ids )
static MStatus nodeCallbacks ( MObject & node, MIntArray & ids )

Documentation

Dependency graph messages. (OpenMaya) (OpenMaya.py)
Description

This class is used to register callbacks for dependency graph messages.

There are 4 add callback methods which will add callbacks for the following messages

A filter can be specified for node added/removed messages. The default node type is "dependNode" which matches all nodes. Each method returns an id which is used to remove the callback.

To remove a callback use MMessage::removeCallback. All callbacks that are registered by a plug-in must be removed by that plug-in when it is unloaded. Failure to do so will result in a fatal error.

Functions

MCallbackId MDGMessage:: addTimeChangeCallback ( MMessage::MTimeFunction func, void * clientData, MStatus * ReturnStatus )

Description

This method registers a callback that is called whenever the time changes in the dependency graph.

Arguments

  • func the callback function
    • time the new time
    • clientData User defined data passed to the callback function
  • clientData User defined data passed to the callback function
  • ReturnStatus status code

Return Value

  • identifier used for removing the callback.

Status Codes

  • MS::kSuccess Operation succeeded
  • MS::kInsufficientMemory No memory available
  • MS::kFailure Error adding callback

MCallbackId MDGMessage:: addForceUpdateCallback ( MMessage::MTimeFunction func, void * clientData, MStatus * ReturnStatus )

Description

This method registers a callback that is called after the time changes and after all nodes have been evaluated in the dependency graph.

Arguments

  • func the callback function
    • time the new time
    • clientData User defined data passed to the callback function
  • clientData User defined data passed to the callback function
  • ReturnStatus status code

Return Value

  • identifier used for removing the callback.

Status Codes

  • MS::kSuccess Operation succeeded
  • MS::kInsufficientMemory No memory available
  • MS::kFailure Error adding callback

MCallbackId MDGMessage:: addNodeAddedCallback ( MMessage::MNodeFunction func, const MString & nodeType, void * clientData, MStatus * ReturnStatus )

Description

This method registers a callback that is called whenever a new node is added to the dependency graph. The nodeType argument allows you to specify the type of nodes that will trigger the callback. The default node type is "dependNode" which matches all nodes.

Arguments

  • func the callback function
    • node the new node
    • clientData User defined data passed to the callback function
  • nodeType Type of node that will trigger the callback
  • clientData User defined data passed to the callback function
  • ReturnStatus status code

Return Value

  • identifier used for removing the callback.

Status Codes

  • MS::kSuccess Operation succeeded
  • MS::kInvalidParameter An invalid nodeType was specified
  • MS::kInsufficientMemory No memory available
  • MS::kFailure Error adding callback

MCallbackId MDGMessage:: addNodeRemovedCallback ( MMessage::MNodeFunction func, const MString & nodeType, void * clientData, MStatus * ReturnStatus )

Description

This method registers a callback that is called whenever a new node is removed from the dependency graph. The nodeType argument allows you to specify the type of nodes that will trigger the callback. The default node type is "dependNode" which matches all nodes.

Arguments

  • func the callback function
    • node the node being removed
    • clientData User defined data passed to the callback function
  • nodeType Type of node that will trigger the callback
  • clientData User defined data passed to the callback function
  • ReturnStatus status code

Return Value

  • identifier used for removing the callback.

Status Codes

  • MS::kSuccess Operation succeeded
  • MS::kInsufficientMemory No memory available
  • MS::kFailure Error adding callback

MCallbackId MDGMessage:: addConnectionCallback ( MMessage::MPlugFunction func, void * clientData, MStatus * ReturnStatus )

Description

This method registers a callback that is called whenever a connection is made or broken in the dependency graph.

Arguments

  • func the callback function
    • srcPlug Source plug of the connection
    • destPlug Destination plug of the connection
    • made true if a new connection was made, false if broken.
    • clientData User defined data passed to the callback function
  • clientData User defined data passed to the callback function
  • ReturnStatus status code

Return Value

  • identifier used for removing the callback.

Status Codes

  • MS::kSuccess Operation succeeded
  • MS::kInsufficientMemory No memory available
  • MS::kFailure Error adding callback

This class has no child classes.


Autodesk® Maya® 8.0 © 1997-2006 Autodesk, Inc. All rights reserved. doc++ Copyright