class MCommandMessage

Jump to documentation

: public MMessage Helper class to handle MEL output. (OpenMaya) (OpenMaya.py)

Inheritance:

MCommandMessage < MMessage

public members:

enum MessageType
kHistory
Command history
kDisplay
String to display unmodified
kInfo
General information
kWarning
Warning message
kError
Error message
kResult
Result from a command execution in the command window
kStackTrace
Stack trace
static MCallbackId addCommandCallback ( MMessage::MStringFunction func, void * clientData = NULL, MStatus * ReturnStatus = NULL )
static MCallbackId addCommandOutputCallback ( MCommandMessage::MMessageFunction func, void * clientData = NULL, MStatus * ReturnStatus = NULL )

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

Helper class to handle MEL output. (OpenMaya) (OpenMaya.py)
Description

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.

NOTE: Setting up a callback using the addCommandCallback() method will degrade the performance of Maya since the installed callback will be invoked repeatedly as MEL operations are processed.

Functions

MCallbackId MCommandMessage:: addCommandCallback ( MMessage::MStringFunction func, void * clientData, MStatus * ReturnStatus )
Description

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.

Arguments

  • func the callback function
    • const MString The command that was executed

    • clientData User defined data passed to the callback function

  • clientData User defined data that will be 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 MCommandMessage:: addCommandOutputCallback ( MCommandMessage::MMessageFunction func, void * clientData, MStatus * ReturnStatus )
Description

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.

Arguments

  • func the callback function
    • message The message from the current running MEL command
    • clientData User defined data passed to the callback function
  • clientData User defined data that will be 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