C++ API Reference
|
DAG messages. More...
#include <MDagMessage.h>
Public Types | |
enum | DagMessage { kInvalidMsg = -1, kParentAdded, kParentRemoved, kChildAdded, kChildRemoved, kChildReordered, kInstanceAdded, kInstanceRemoved, kLast } |
The type of DAG changed messages that have occurred. More... | |
enum | MatrixModifiedFlags { kScaleX = 1<<0, kScaleY = 1<<1, kScaleZ = 1<<2, kShearXY = 1<<3, kShearXZ = 1<<4, kShearYZ = 1<<5, kRotateX = 1<<6, kRotateY = 1<<7, kRotateZ = 1<<8, kTranslateX = 1<<9, kTranslateY = 1<<10, kTranslateZ = 1<<11, kScalePivotX = 1<<12, kScalePivotY = 1<<13, kScalePivotZ = 1<<14, kRotatePivotX = 1<<15, kRotatePivotY = 1<<16, kRotatePivotZ = 1<<17, kScaleTransX = 1<<18, kScaleTransY = 1<<19, kScaleTransZ = 1<<20, kRotateTransX = 1<<21, kRotateTransY = 1<<22, kRotateTransZ = 1<<23, kRotateOrientX = 1<<24, kRotateOrientY = 1<<25, kRotateOrientZ = 1<<26, kRotateOrder = 1<<27, kAll = (1<<28)-1, kScale = kScaleX | kScaleY | kScaleZ, kShear = kShearXY | kShearXZ | kShearYZ, kRotation = kRotateX | kRotateY | kRotateZ, kTranslation = kTranslateX | kTranslateY | kTranslateZ, kScalePivot = kScalePivotX | kScalePivotY | kScalePivotZ, kRotatePivot = kRotatePivotX | kRotatePivotY | kRotatePivotZ, kScalePivotTrans =kScaleTransX | kScaleTransY | kScaleTransZ, kRotatePivotTrans =kRotateTransX | kRotateTransY | kRotateTransZ, kRotateOrient = kRotateOrientX | kRotateOrientY | kRotateOrientZ } |
Indicates which parts of a matrix have been modified. More... | |
typedef void(* | MMessageParentChildFunction) (MDagMessage::DagMessage msgType, MDagPath &child, MDagPath &parent, void *clientData) |
Pointer to a callback function which takes an MDagMessage, two MDagPaths and a clientData pointer. More... | |
typedef void(* | MWorldMatrixModifiedFunction) (MObject &transformNode, MDagMessage::MatrixModifiedFlags &modified, void *clientData) |
Pointer to world matrix modified callback function. More... | |
Callback result action codes. More... |
Static Public Member Functions | |
static MCallbackId | addParentAddedCallback (MMessage::MParentChildFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL) |
This method registers a callback that is called whenever a parent is added in the DAG. More... | |
static MCallbackId | addParentAddedDagPathCallback (MDagPath &node, MMessage::MParentChildFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL) |
This method registers a callback that is called whenever a parent is added to the specified DAG node. More... | |
static MCallbackId | addParentRemovedCallback (MMessage::MParentChildFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL) |
This method registers a callback that is called whenever a parent is removed in the DAG. More... | |
static MCallbackId | addParentRemovedDagPathCallback (MDagPath &node, MMessage::MParentChildFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL) |
This method registers a callback that is called whenever a parent is removed from the specified DAG node. More... | |
static MCallbackId | addChildAddedCallback (MMessage::MParentChildFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL) |
This method registers a callback that is called whenever a child is added in the DAG. More... | |
static MCallbackId | addChildAddedDagPathCallback (MDagPath &node, MMessage::MParentChildFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL) |
This method registers a callback that is called whenever a child is added to the specified DAG node. More... | |
static MCallbackId | addChildRemovedCallback (MMessage::MParentChildFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL) |
This method registers a callback that is called whenever a child is removed in the DAG. More... | |
static MCallbackId | addChildRemovedDagPathCallback (MDagPath &node, MMessage::MParentChildFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL) |
This method registers a callback that is called whenever a child is removed from the specified DAG node. More... | |
static MCallbackId | addChildReorderedCallback (MMessage::MParentChildFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL) |
This method registers a callback that is called whenever a child is reordered in the DAG. More... | |
static MCallbackId | addChildReorderedDagPathCallback (MDagPath &node, MMessage::MParentChildFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL) |
This method registers a callback that is called whenever a child of the specified DAG node is reordered. More... | |
static MCallbackId | addDagCallback (DagMessage msgType, MDagMessage::MMessageParentChildFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL) |
This method registers a callback that is called for specified DAG changes on all nodes. More... | |
static MCallbackId | addDagDagPathCallback (MDagPath &node, DagMessage msgType, MDagMessage::MMessageParentChildFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL) |
This method registers a callback that is called for specified a DAG change is made to the specified DAG path. More... | |
static MCallbackId | addAllDagChangesCallback (MDagMessage::MMessageParentChildFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL) |
This method registers a callback that is called whenever any DAG change is made to any DAG node. More... | |
static MCallbackId | addAllDagChangesDagPathCallback (MDagPath &node, MDagMessage::MMessageParentChildFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL) |
This method registers a callback that is called whenever a DAG change is made to the specified DAG path. More... | |
static MCallbackId | addInstanceAddedCallback (MMessage::MParentChildFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL) |
This method registers a callback that is called whenever any node in the DAG is instanced. More... | |
static MCallbackId | addInstanceAddedDagPathCallback (MDagPath &node, MMessage::MParentChildFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL) |
This method registers a callback that is called whenever the specified node is instanced. More... | |
static MCallbackId | addInstanceRemovedCallback (MMessage::MParentChildFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL) |
This method registers a callback that is called whenever an instance of any DAG node is removed or deleted. More... | |
static MCallbackId | addInstanceRemovedDagPathCallback (MDagPath &node, MMessage::MParentChildFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL) |
This method registers a callback that is called whenever an instance of the specified node is removed. More... | |
static MCallbackId | addMatrixModifiedCallback (MDagPath &node, MDagMessage::MWorldMatrixModifiedFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL) |
This method registers a callback that is called when the local matrix on the specified DAG node changes. More... | |
static MCallbackId | addWorldMatrixModifiedCallback (MDagPath &node, MDagMessage::MWorldMatrixModifiedFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL) |
This method registers a callback that is called when a parent matrix of the specified DAG node changes. More... | |
static const char * | className () |
Returns the name of this class. More... | |
static MCallbackId | addParentAddedCallback (MDagPath &node, MMessage::MParentChildFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL) |
Deprecated in 2019.0 More... | |
static MCallbackId | addParentRemovedCallback (MDagPath &node, MMessage::MParentChildFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL) |
Deprecated in 2019.0 More... | |
static MCallbackId | addChildAddedCallback (MDagPath &node, MMessage::MParentChildFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL) |
Deprecated in 2019.0 More... | |
static MCallbackId | addChildRemovedCallback (MDagPath &node, MMessage::MParentChildFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL) |
Deprecated in 2019.0 More... | |
static MCallbackId | addChildReorderedCallback (MDagPath &node, MMessage::MParentChildFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL) |
Deprecated in 2019.0 More... | |
static MCallbackId | addInstanceAddedCallback (MDagPath &node, MMessage::MParentChildFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL) |
Deprecated in 2019.0 More... | |
static MCallbackId | addInstanceRemovedCallback (MDagPath &node, MMessage::MParentChildFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL) |
Deprecated in 2019.0 More... | |
static MCallbackId | addDagCallback (DagMessage msgType, MMessage::MParentChildFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL) |
Deprecated in 2015.0 More... | |
static MCallbackId | addDagCallback (MDagPath &node, DagMessage msgType, MMessage::MParentChildFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL) |
Deprecated in 2015.0 More... | |
static MCallbackId | addDagCallback (MDagPath &node, DagMessage msgType, MDagMessage::MMessageParentChildFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL) |
Deprecated in 2019.0 More... | |
static MCallbackId | addAllDagChangesCallback (MDagPath &node, MDagMessage::MMessageParentChildFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL) |
Deprecated in 2019.0 More... | |
DAG messages.
This class is used to register callbacks for DAG messages.
There are 6 types of add callback methods which will add callbacks for the following messages
Methods exist to register callbacks for every time any DAG node is affected as well as methods that work on specific 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.
NOTE: It is possible to get Parent Added and Child Added messages before the node name has been set. This can happen if the node is newly created. Additionally, the MDagPath string path names passed to the callback may not be set as yet if the node has not been added to the model. Accessing objects that are newly created or calling commands that access such objects from a callback may produce unknown results.
typedef void(* MMessageParentChildFunction) (MDagMessage::DagMessage msgType, MDagPath &child, MDagPath &parent, void *clientData) |
Pointer to a callback function which takes an MDagMessage, two MDagPaths and a clientData pointer.
[in] | msgType | Type of message which caused the function to be called. |
[in,out] | child | First DAG path, usually used to pass the child of a parent/child pair. |
[in,out] | parent | Second DAG path, usually use to pass the parent of a parent/child pair. |
[in,out] | clientData | User-defined data which was supplied when the callback was added. |
typedef void(* MWorldMatrixModifiedFunction) (MObject &transformNode, MDagMessage::MatrixModifiedFlags &modified, void *clientData) |
Pointer to world matrix modified callback function.
[in] | transformNode | The node whose transformation has changed. |
[in] | modified | The flag which shows what has changed. |
[in] | clientData | Pointer to user-defined data supplied when the callback was registered. |
enum DagMessage |
The type of DAG changed messages that have occurred.
enum MatrixModifiedFlags |
Indicates which parts of a matrix have been modified.
|
static |
This method registers a callback that is called whenever a parent is added in the DAG.
Please see the note in the Description section about this callback.
[in] | func | the callback function |
[in] | clientData | User defined data passed to the callback function |
[out] | ReturnStatus | status code |
|
static |
This method registers a callback that is called whenever a parent is added to the specified DAG node.
Please see the note in the Description section about this callback.
[in] | node | The DAG node to register the callback for |
[in] | func | the callback function |
[in] | clientData | User defined data passed to the callback function |
[out] | ReturnStatus | status code |
|
static |
This method registers a callback that is called whenever a parent is removed in the DAG.
[in] | func | the callback function |
[in] | clientData | User defined data passed to the callback function |
[out] | ReturnStatus | status code |
|
static |
This method registers a callback that is called whenever a parent is removed from the specified DAG node.
[in] | node | The DAG node to register the callback for |
[in] | func | the callback function |
[in] | clientData | User defined data passed to the callback function |
[out] | ReturnStatus | status code |
|
static |
This method registers a callback that is called whenever a child is added in the DAG.
Please see the note in the Description section about this callback.
[in] | func | the callback function |
[in] | clientData | User defined data passed to the callback function |
[out] | ReturnStatus | status code |
|
static |
This method registers a callback that is called whenever a child is added to the specified DAG node.
Please see the note in the Description section about this callback.
[in] | node | The DAG node to register the callback for |
[in] | func | the callback function |
[in] | clientData | User defined data passed to the callback function |
[out] | ReturnStatus | status code |
|
static |
This method registers a callback that is called whenever a child is removed in the DAG.
[in] | func | the callback function |
[in] | clientData | User defined data passed to the callback function |
[out] | ReturnStatus | status code |
|
static |
This method registers a callback that is called whenever a child is removed from the specified DAG node.
[in] | node | The DAG node to register the callback for |
[in] | func | the callback function |
[in] | clientData | User defined data passed to the callback function |
[out] | ReturnStatus | status code |
|
static |
This method registers a callback that is called whenever a child is reordered in the DAG.
[in] | func | the callback function |
[in] | clientData | User defined data passed to the callback function |
[out] | ReturnStatus | status code |
|
static |
This method registers a callback that is called whenever a child of the specified DAG node is reordered.
[in] | node | The DAG node to register the callback for |
[in] | func | the callback function |
[in] | clientData | User defined data passed to the callback function |
[out] | ReturnStatus | status code |
|
static |
This method registers a callback that is called for specified DAG changes on all nodes.
The callback will also receive the DagMessage.
Please see the note in the Description section about this callback if Parent Added or Child Added messages are being used.
[in] | msgType | The type of DAG change to trigger the callback |
[in] | func | the callback function |
[in] | clientData | User defined data passed to the callback function |
[out] | ReturnStatus | status code |
|
static |
This method registers a callback that is called for specified a DAG change is made to the specified DAG path.
The callback receives the DagMessage as well.
Please see the note in the Description section about this callback if Parent Added or Child Added messages are being used.
[in] | node | The DAG node to register the callback for. |
[in] | msgType | The type of DAG change to trigger the callback. |
[in] | func | The callback function. |
[in] | clientData | User defined data passed to the callback function. |
[out] | ReturnStatus | Status code. |
|
static |
This method registers a callback that is called whenever any DAG change is made to any DAG node.
Please see the note in the Description section about this callback if Parent Added or Child Added messages are being used.
[in] | func | the callback function |
[in] | clientData | User defined data passed to the callback function |
[out] | ReturnStatus | status code |
|
static |
This method registers a callback that is called whenever a DAG change is made to the specified DAG path.
[in] | node | The DAG node to register the callback for. |
[in] | func | The callback function. |
[in] | clientData | User defined data passed to the callback function. |
[out] | ReturnStatus | Status code. |
|
static |
This method registers a callback that is called whenever any node in the DAG is instanced.
[in] | func | the callback function |
[in] | clientData | User defined data passed to the callback function |
[out] | ReturnStatus | status code |
|
static |
This method registers a callback that is called whenever the specified node is instanced.
[in] | node | The DAG node to register the callback for. |
[in] | func | The callback function. |
[in] | clientData | User defined data passed to the callback function. |
[out] | ReturnStatus | Status code. |
|
static |
This method registers a callback that is called whenever an instance of any DAG node is removed or deleted.
[in] | func | the callback function |
[in] | clientData | User defined data passed to the callback function |
[out] | ReturnStatus | status code |
|
static |
This method registers a callback that is called whenever an instance of the specified node is removed.
[in] | node | The DAG node to register the callback for. |
[in] | func | The callback function. |
[in] | clientData | User defined data passed to the callback function. |
[out] | ReturnStatus | Status code. |
|
static |
This method registers a callback that is called when the local matrix on the specified DAG node changes.
If the node's transformation is already dirty (i.e. it has not been evaluated since it was last changed) then the callback will not be triggered. So if the node's transformation is modified multiple times between evaluations, only the first one will result in the callback being called.
[in] | affectedNode | The DAG node to register the callback for. |
[in] | func | The callback function.
|
[in] | clientData | User defined data passed to the callback function. |
[out] | ReturnStatus | Status code. |
|
static |
This method registers a callback that is called when a parent matrix of the specified DAG node changes.
Since a node's worldMatrix is affected by the transforms of its ancestors in the DAG, it's possible for there to be two different nodes involved: the "trigger" node, whose transform has changed, and the "affected" node, whose worldMatrix is affected by the change to the trigger.
The callback is placed on the affected node, but it is the trigger node which is passed to the callback.
If the trigger node's transformation is already dirty (i.e. it has not been evaluated since it was last changed) then the callback will not be triggered. So if the trigger node's transformation is modified multiple times between evaluations, only the first one will result in the callback being called.
[in] | affectedNode | The DAG node to register the callback for. |
[in] | func | The callback function.
|
[in] | clientData | User defined data passed to the callback function. |
[out] | ReturnStatus | Status code. |
|
static |
Returns the name of this class.
|
static |
Deprecated in 2019.0
Not available in Python.
This method registers a callback that is called whenever a parent is added to the specified DAG node.
[in] | node | The DAG node to register the callback for. |
[in] | func | The callback function. |
[in] | clientData | User defined data passed to the callback function |
[out] | ReturnStatus | Status code. |
|
static |
Deprecated in 2019.0
Not available in Python.
This method registers a callback that is called whenever a parent is removed from the specified DAG node.
[in] | node | The DAG node to register the callback for. |
[in] | func | The callback function. |
[in] | clientData | User defined data passed to the callback function |
[out] | ReturnStatus | Status code. |
|
static |
Deprecated in 2019.0
Not available in Python.
This method registers a callback that is called whenever a child is added to the specified DAG node.
Please see the note in the Description section about this callback.
[in] | node | The DAG node to register the callback for. |
[in] | func | The callback function. |
[in] | clientData | User defined data passed to the callback function. |
[out] | ReturnStatus | Status code. |
|
static |
Deprecated in 2019.0
Not available in Python.
This method registers a callback that is called whenever a child is removed from the specified DAG node.
[in] | node | The DAG node to register the callback for. |
[in] | func | The callback function. |
[in] | clientData | User defined data passed to the callback function. |
[out] | ReturnStatus | Status code. |
|
static |
Deprecated in 2019.0
Not available in Python.
This method registers a callback that is called whenever a child of the specified DAG node is reordered.
[in] | node | The DAG node to register the callback for. |
[in] | func | The callback function. |
[in] | clientData | User defined data passed to the callback function. |
[out] | ReturnStatus | Status code. |
|
static |
Deprecated in 2019.0
Not available in Python.
This method registers a callback that is called whenever the specified node is instanced
[in] | node | The DAG node to register the callback for. |
[in] | func | The callback function. |
[in] | clientData | User defined data passed to the callback function. |
[out] | ReturnStatus | Status code. |
|
static |
Deprecated in 2019.0
Not available in Python.
This method registers a callback that is called whenever an instance of the specified node is removed.
[in] | node | The DAG node to register the callback for. |
[in] | func | The callback function. |
[in] | clientData | User defined data passed to the callback function. |
[out] | ReturnStatus | Status code. |
|
static |
Deprecated in 2015.0
Not available in Python.
This method registers a callback that is called whenever a DAG change is made.
Please see the note in the Description section about this callback if Parent Added or Child Added messages are being used.
[in] | msgType | The type of DAG change to trigger the callback |
[in] | func | the callback function |
[in] | clientData | User defined data passed to the callback function |
[out] | ReturnStatus | status code |
|
static |
Deprecated in 2015.0
Not available in Python.
This method registers a callback that is called whenever a DAG change is made to a specified node.
Please see the note in the Description section about this callback if Parent Added or Child Added messages are being used.
[in] | node | The DAG node to register the callback for. |
[in] | msgType | The type of DAG change to trigger the callback. |
[in] | func | The callback function. |
[in] | clientData | User defined data passed to the callback function. |
[out] | ReturnStatus | Status code. |
|
static |
Deprecated in 2019.0
Not available in Python.
|
static |
Deprecated in 2019.0
Not available in Python.
This method registers a callback that is called whenever a DAG change is made to the specified DAG path.
[in] | node | The DAG node to register the callback for. |
[in] | func | the callback function. |
[in] | clientData | User defined data passed to the callback function. |
[out] | ReturnStatus | Status code. |