#include <MCommandMessage.h>
Helper class to handle MEL output.
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. More... | |
typedef void(* | MMessageFilterFunction) (const MString &message, MCommandMessage::MessageType messageType, bool &filterOutput, void *clientData) |
Pointer to a message filter function. More... | |
Callback result action codes. More... |
Static Public Member Functions | |
static MCallbackId | addCommandCallback (MMessage::MStringFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL) |
This method registers a callback for command messages that are issued every time a MEL command is executed. More... | |
static MCallbackId | addCommandOutputCallback (MCommandMessage::MMessageFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL) |
This method registers a callback for whenever commands generate output such as that which is printed into the command window. More... | |
static MCallbackId | addCommandOutputFilterCallback (MCommandMessage::MMessageFilterFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL) |
This method registers a callback for whenever commands generate output such as that which is printed into the command window. More... | |
static const char * | className () |
Returns the name of this class. More... | |
static MCallbackId | addProcCallback (MMessage::MStringIntBoolIntFunction func, void *clientData, MStatus *ReturnStatus) |
This method registers a callback that is executed every time a MEL procedure is run. More... | |
typedef void(* 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(* 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. |
enum MessageType |
|
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. |
|
static |
This method registers a callback for whenever 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. |
|
static |
This method registers a callback for whenever 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. |
|
static |
Returns the name of this class.
|
static |
This method registers a callback that is executed every time a MEL procedure is run.
The callback will be executed once when the procedure is about to be executed, and again when it has exited. If a non-existent procedure is called the callback will be called once for entry but there will be no call on exit.
The callback function should have the following parameters:
func(const MString& procName, unsigned int procID, bool isProcEntry, unsigned int type, void* clientData)
Where: procName will be the name of the procedure being invoked procID is the ID for the procedure's invocation isProcEntry is true if the procedure is being entered, false otherwise type is an MCommandMessage::ProcType value, and denotes the type of call this is, a MEL Proc, or MEL Command clientData is a pointer to an unsigned integer which is the invocation ID of the procedure
The callback cannot be registered multiple times. To register a new callback function for this, please de-register the original callback first.
NOTE: Setting up a callback using this method can potentially degrade the performance of Maya since the installed callback will be invoked repeatedly as MEL procedures are executed.
[in] | func | The callback function. |
[in] | clientData | User defined data that will be passed to the callback function. |
[out] | ReturnStatus | Status code. |