Public Types | Static Public Member Functions

MModelMessage Class Reference

Search for all occurrences

Detailed Description

Scene messages.

This class is used to register callbacks for model related messages.

The addCallback method registers a function that will be executed whenever the specified message occurs. An id is returned and 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.

#include <MModelMessage.h>

Inheritance diagram for MModelMessage:
Inheritance graph
[legend]

List of all members.

Public Types

enum  Message { kActiveListModified }
 

Message types supported by the addCallback method.

More...

Static Public Member Functions

static MCallbackId addCallback (Message, MMessage::MBasicFunction, void *clientData=NULL, MStatus *ReturnStatus=NULL)
 Adds a new callback for the specified model message.
static MCallbackId addBeforeDuplicateCallback (MMessage::MBasicFunction, void *clientData=NULL, MStatus *ReturnStatus=NULL)
 Before duplicate callback.
static MCallbackId addAfterDuplicateCallback (MMessage::MBasicFunction, void *clientData=NULL, MStatus *ReturnStatus=NULL)
 After duplicate callback.
static MCallbackId addNodeAddedToModelCallback (const MObject &dagNode, MMessage::MNodeFunction, void *clientData=NULL, MStatus *ReturnStatus=NULL)
 Node added to model message.
static MCallbackId addNodeRemovedFromModelCallback (const MObject &dagNode, MMessage::MNodeFunction, void *clientData=NULL, MStatus *ReturnStatus=NULL)
 Node removed from model message.
static const char * className ()
 Returns the name of this class.

Member Enumeration Documentation

enum Message

Message types supported by the addCallback method.

Enumerator:
kActiveListModified 

active selection changes


Member Function Documentation

MCallbackId addCallback ( MModelMessage::Message  msg,
MMessage::MBasicFunction  func,
void *  clientData = NULL,
MStatus ReturnStatus = NULL 
) [static]

Adds a new callback for the specified model message.

Parameters:
[in]msgthe model message that will trigger the callback
[in]functhe callback function
  • clientData User defined data passed to the callback function
Parameters:
[in]clientDatauser data that will be passed to the callback function
[out]ReturnStatusStatus code
Returns:
Identifier used for removing the callback.
Status Codes:
Examples:
componentScaleManip.cpp, customAttrManip.cpp, moveManip.cpp, rotateManip.cpp, and surfaceBumpManip.cpp.
MCallbackId addBeforeDuplicateCallback ( MMessage::MBasicFunction  func,
void *  clientData = NULL,
MStatus ReturnStatus = NULL 
) [static]

Before duplicate callback.

This method registers a callback that is called whenever a duplicate command is made.

The callback will be called before anything is duplicated.

Parameters:
[in]functhe callback function
  • clientData User defined data passed to the callback function
Parameters:
[in]clientDataUser defined data passed to the callback function
[out]ReturnStatusstatus code
Returns:
Identifier used for removing the callback.
Status Codes:
MCallbackId addAfterDuplicateCallback ( MMessage::MBasicFunction  func,
void *  clientData = NULL,
MStatus ReturnStatus = NULL 
) [static]

After duplicate callback.

This method registers a callback that is called after a duplicate command is made.

The callback will be called after everything is duplicated.

Parameters:
[in]functhe callback function
  • clientData User defined data passed to the callback function
Parameters:
[in]clientDataUser defined data passed to the callback function
[out]ReturnStatusstatus code
Returns:
Identifier used for removing the callback.
Status Codes:
MCallbackId addNodeAddedToModelCallback ( const MObject dagNode,
MMessage::MNodeFunction  func,
void *  clientData = NULL,
MStatus ReturnStatus = NULL 
) [static]

Node added to model message.

This method registers a callback that is called when a dag node is about to be added to the Maya model.

Parameters:
[in]dagNodeNode that should acquire the callback
[in]functhe callback function
  • dagNode Node that is being added to the model
  • clientData User defined data passed to the callback function
Parameters:
[in]clientDataUser defined data passed to the callback function
[out]ReturnStatusstatus code
Returns:
Identifier used for removing the callback.
Status Codes:
Examples:
dagMessageCmd.cpp.
MCallbackId addNodeRemovedFromModelCallback ( const MObject dagNode,
MMessage::MNodeFunction  func,
void *  clientData = NULL,
MStatus ReturnStatus = NULL 
) [static]

Node removed from model message.

This method registers a callback that is called when the specified dag node is being removed from the Maya model.

Parameters:
[in]dagNodeNode that should acquire the callback
[in]functhe callback function
  • dagNode Node that is being removed from the model
  • clientData User defined data passed to the callback function
Parameters:
[in]clientDataUser defined data passed to the callback function
[out]ReturnStatusstatus code
Returns:
Identifier used for removing the callback.
Status Codes:
Examples:
dagMessageCmd.cpp.
const char * className ( ) [static]

Returns the name of this class.

Returns:
The name of this class.

Reimplemented from MMessage.


MModelMessage MModelMessage MModelMessage MModelMessage MModelMessage MModelMessage MModelMessage MModelMessage MModelMessage MModelMessage
MModelMessage MModelMessage MModelMessage MModelMessage MModelMessage MModelMessage MModelMessage MModelMessage MModelMessage MModelMessage