MAnimMessage Class Reference
[OpenMayaAnim - API module for animation]

#include <MAnimMessage.h>

Inheritance diagram for MAnimMessage:

Inheritance graph
[legend]
Collaboration diagram for MAnimMessage:

Collaboration graph
[legend]

List of all members.


Detailed Description

Animation messages.

This class is used to register callbacks for animation messages.

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.

Static Public Member Functions

static MCallbackId addAnimCurveEditedCallback (MMessage::MObjArray func, void *clientData=NULL, MStatus *ReturnStatus=NULL)
 AnimCurve edited callback.
static MCallbackId addAnimKeyframeEditedCallback (MMessage::MObjArray func, void *clientData=NULL, MStatus *ReturnStatus=NULL)
 AnimCurve keyframe edited callback.
static MCallbackId addNodeAnimKeyframeEditedCallback (MObject &animNode, MMessage::MNodeObjArray func, void *clientData=NULL, MStatus *ReturnStatus=NULL)
 AnimCurve keyframe edited callback.
static MCallbackId addAnimKeyframeEditCheckCallback (MMessage::MCheckPlugFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL)
 AnimCurve keyframe edit check callback.
static MCallbackId addAnimKeyframeEditedCallback (MObject &animNode, MMessage::MNodeObjArray func, void *clientData=NULL, MStatus *ReturnStatus=NULL)
 This method is obsolete. This method is not available in Python.
static void flushAnimKeyframeEditedCallbacks ()
 AnimCurve keyframe edited callback flush.


Member Function Documentation

MCallbackId MAnimMessage::addAnimCurveEditedCallback ( MMessage::MObjArray  func,
void *  clientData = NULL,
MStatus ReturnStatus = NULL 
) [static]

AnimCurve edited callback.

This method registers a callback that is called whenever an AnimCurve is edited.

Parameters:
[in] func the callback function
  • editedCurves an array of AnimCurves which have been edited
  • clientData User defined data passed to the callback function
Parameters:
[in] clientData User defined data passed to the callback function
[in] ReturnStatus status code
Returns:
Identifier used for removing the callback.
Status Codes:

MCallbackId MAnimMessage::addAnimKeyframeEditedCallback ( MMessage::MObjArray  func,
void *  clientData = NULL,
MStatus ReturnStatus = NULL 
) [static]

AnimCurve keyframe edited callback.

This method registers a callback that is called whenever an a group of keys are modified. The callback is invoked once per atomic change to single or group of keyframes. For example, if a user selects a group 5 of keys and moves them 5 units in the value axis, then a single callback event will be invoked with a MObject for each of the 5 keyframes. The MObjects can then be used in the MFnKeyframeDelta function set. Refer to MFnKeyframeDelta function set documentation for more info.

Parameters:
[in] func the callback function
  • editedKeys an array of keyframes that were edited.
  • clientData User defined data passed to the callback function
Parameters:
[in] clientData User defined data.
[out] ReturnStatus status code
Returns:
Identifier used for removing the callback.
Status Codes:

MCallbackId MAnimMessage::addNodeAnimKeyframeEditedCallback ( MObject animNode,
MMessage::MNodeObjArray  func,
void *  clientData = NULL,
MStatus ReturnStatus = NULL 
) [static]

AnimCurve keyframe edited callback.

This method registers a callback that is called whenever an a group of keys are modified. The callback is invoked once per atomic change to single or group of keyframes on the specified animation curve node. For example, if a user selects a group 5 of keys and moves them 5 units in the value axis, then a single callback event will be invoked with a MObject for each of the 5 keyframes. The MObjects can then be used in the MFnKeyframeDelta function set. Refer to MFnKeyframeDelta function set documentation for more info.

Parameters:
[in] animNode the param curve node you want to watch.
[in] func the callback function
  • animNode The edited animation node.
  • editedKeys an array of keyframes that were edited.
  • clientData User defined data passed to the callback function
Parameters:
[in] clientData User defined data.
[out] ReturnStatus status code
Returns:
Identifier used for removing the callback.
Status Codes:

MCallbackId MAnimMessage::addAnimKeyframeEditCheckCallback ( MMessage::MCheckPlugFunction  func,
void *  clientData = NULL,
MStatus ReturnStatus = NULL 
) [static]

AnimCurve keyframe edit check callback.

This method registers a callback that is used by the setKeyframe command to allow a user to consider the set keyframe request and cancel it if needed. The callback method should return false to abort the keyframe setting.

Parameters:
[in] func the callback function
  • retCode return code from callback, setting this to false will abort the keyframe action
  • plug the plug being keyframed
  • clientData User defined data passed to the callback function
[in] clientData User defined data.
[out] ReturnStatus status code
Returns:
Identifier used for removing the callback.
Status Codes:
Example
This example callback will reject any changes to plugs including 'translate' in their name.

        MAnimMessage m;
        m.addAnimKeyframeEditCheckCallback( check_callback );

        void check_callback(bool *retcode, MPlug& plug, void* clientData )
        {
                // Don't allow any keys to be set on attributes with 'translate' in them
                *retcode = ( plug.name().indexW( "translate" ) == -1 );
        }

MCallbackId MAnimMessage::addAnimKeyframeEditedCallback ( MObject animNode,
MMessage::MNodeObjArray  func,
void *  clientData = NULL,
MStatus ReturnStatus = NULL 
) [static]

This method is obsolete. This method is not available in Python.

Deprecated:
Use MAnimMessage::addNodeAnimKeyframeEditedCallback instead.

void MAnimMessage::flushAnimKeyframeEditedCallbacks (  )  [static]

AnimCurve keyframe edited callback flush.

Animation keyframe edited callbacks are queued to only be issued on an idle event. There may be times when it is desired to issue the callback at a specific time. This method provides this functionality. It will flush all animation keyframe edited callbacks and force them to issue their callbacks with the data contained within.


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