OpenMaya.MCommandMessage Class Reference

OpenMaya.MCommandMessage Class Reference

Class Description

Class used to register callbacks for command related messages.

The class also provides the following MessageType constants which
describe the different types of output messages:
  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

Method resolution order:
-   MCommandMessage
-   MMessage
-   __builtin__.object
+ Inheritance diagram for OpenMaya.MCommandMessage:

Static Public Member Functions

addCommandCallback ()
 
addCommandOutputCallback ()
 
addCommandOutputFilterCallback ()
 
addProcCallback ()
 
- Static Public Member Functions inherited from OpenMaya.MMessage
currentCallbackId ()
 
nodeCallbacks ()
 
removeCallback ()
 
removeCallbacks ()
 

Static Public Attributes

int kDisplay = 1
 
int kError = 4
 
int kHistory = 0
 
int kInfo = 2
 
int kMELCommand = 1
 
int kMELProc = 0
 
int kResult = 5
 
int kStackTrace = 6
 
int kWarning = 3
 
- Static Public Attributes inherited from OpenMaya.MMessage
int kDefaultAction = 0
 
int kDoAction = 2
 
int kDoNotDoAction = 1
 

Member Function Documentation

OpenMaya.MCommandMessage.addCommandCallback ( )
static
addCommandCallback(function, clientData=None) -> id

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.

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.

 * function - callable which will be passed a string containing the
   MEL command being executed, and the clientData object
 * clientData - User defined data passed to the callback function

 * return: Identifier used for removing the callback.
OpenMaya.MCommandMessage.addCommandOutputCallback ( )
static
addCommandOutputCallback(function, clientData=None) -> id

This method registers a callback for whenever MEL commands generate
output such as that which is printed into the command window.

 * function - callable which will be passed a string containing the
   MEL command being executed, a MessageType constant (see class docs
   for a list) indicating the message type and the clientData object
 * clientData - User defined data passed to the callback function

 * return: Identifier used for removing the callback.
OpenMaya.MCommandMessage.addCommandOutputFilterCallback ( )
static
addCommandOutputFilterCallback(function, clientData=None) -> id

This method registers a callback for whenever MEL commands generate
output such as that which is printed into the command window.

Returning True in the callback will filter the output from the
script editor and command line., returning False will keep the output.

 * function - callable which will be passed a string containing the
   MEL command being executed, a MessageType constant (see class docs
   for a list) indicating the message type and the clientData object
 * clientData - User defined data passed to the callback function

 * return: Identifier used for removing the callback.
OpenMaya.MCommandMessage.addProcCallback ( )
static
addProcCallback(function, clientData=None) -> id

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 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.

 * function - callable which will be passed a string containing the name
   of the procedure being invoked, an integer indicating the ID for the
   procedure's invocation, a bool set to True if the procedure is being entered,
   false otherwise, a ProcType constant (see below for a list) indicating the
   type of call this is (MEL proc or MEL command), and the clientData object
   ProcType constant can take the folowing values:
     kMELProc
     kMELCommand
 * clientData - User defined data passed to the callback function

 * return: Identifier used for removing the callback.