#include
<MCommandMessage.h>
This class is used to register for a callback for when certain MEL command related messages are generated.
The add callback 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.
Public Types |
|
enum | MessageType
{ kHistory, kDisplay, kInfo, kWarning, kError, kResult, kStackTrace } |
Types of output messages. More... |
|
typedef void(* | MMessageFunction )(const MString &message, MCommandMessage::MessageType messageType, void *clientData) |
Pointer to a message function. |
|
typedef void(* | MMessageFilterFunction )(const MString &message, MCommandMessage::MessageType messageType, bool &filterOutput, void *clientData) |
Pointer to a message filter function.
|
|
Static Public Member Functions |
|
static MCallbackId | addCommandCallback (MMessage::MStringFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL) |
static MCallbackId | addCommandOutputCallback (MCommandMessage::MMessageFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL) |
static MCallbackId | addCommandOutputFilterCallback (MCommandMessage::MMessageFilterFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL) |
typedef void(* MCommandMessage::MMessageFunction)(const MString &message, MCommandMessage::MessageType messageType, void *clientData) |
Pointer to a message function.
[in] | message | The command that was executed. |
[in] | messageType | The type of message. |
[in,out] | clientData | User defined data passed to the callback function. |
typedef void(* MCommandMessage::MMessageFilterFunction)(const MString &message, MCommandMessage::MessageType messageType, bool &filterOutput, void *clientData) |
Pointer to a message filter function.
[in] | message | The command that was executed. |
[in] | messageType | The type of message. |
[out] | filter | Bool that causes Maya to filter this message if set to true. |
[in,out] | clientData | User defined data passed to the callback function. |
MCallbackId MCommandMessage::addCommandCallback | ( | MMessage::MStringFunction | func, | |
void * | clientData = NULL , |
|||
MStatus * | ReturnStatus =
NULL |
|||
) | [static] |
This method registers a callback for command messages that are issued every time a MEL command is executed. It is only called when actual commands are executed and not when scripts are executed.
The callback function will be passed the any client data that was provided when the callback was registered.
NOTE: Setting up a callback using this method will degrade the performance of Maya since the installed callback will be invoked repeatedly as MEL operations are processed.
[in] | func | The callback function. |
[in] | clientData | User defined data that will be passed to the callback function. |
[out] | ReturnStatus | Status code. |
MCallbackId MCommandMessage::addCommandOutputCallback | ( | MCommandMessage::MMessageFunction | func, | |
void * | clientData = NULL , |
|||
MStatus * | ReturnStatus =
NULL |
|||
) | [static] |
This method registers a callback for whenever MEL commands generate output such as that which is printed into the command window.
The callback function will be passed the any client data that was provided when the callback was registered.
[in] | func | The callback function. |
[in] | clientData | User defined data that will be passed to the callback function. |
[out] | ReturnStatus | Status code. |
MCallbackId MCommandMessage::addCommandOutputFilterCallback | ( | MCommandMessage::MMessageFilterFunction | func, | |
void * | clientData = NULL , |
|||
MStatus * | ReturnStatus =
NULL |
|||
) | [static] |
This method registers a callback for whenever MEL commands generate output such as that which is printed into the command window.
This callback includes a boolean filter option which allows the callback to prevent the output of the message to the script editor and command line output. Setting the 'filterOutput' parameter to true, inside your callback will filter the output from the script editor and command line output.
The callback function will be passed the any client data that was provided when the callback was registered.
[in] | func | The callback function. |
[in] | clientData | User defined data that will be passed to the callback function. |
[out] | ReturnStatus | Status code. |
Autodesk® Maya® 2011 © 1997-2010 Autodesk, Inc. All rights reserved. | Generated with 1.5.6 |