- Main Page
- Related Pages
- Modules
- Classes
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Types | Static Public Member Functions

# MModelMessage Class Reference
OpenMaya - API module for common classes

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:
[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

Search for all occurrences

Message types supported by the addCallback method.

Enumerator:

  kActiveListModified | active selection changes Search for all occurrences

## Member Function Documentation

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

Search for all occurrences

Adds a new callback for the specified model message.

Parameters:

  [in] | msg | the model message that will trigger the callback
  [in] | func | the callback function

- clientData User defined data passed to the callback function

Parameters:

  [in] | clientData | user data that will be passed to the callback function
  [out] | ReturnStatus | Status code

Returns:
  Identifier used for removing the callback.

Status Codes:
  - MS::kSuccess Operation succeeded
  - MS::kInsufficientMemory No memory available
  - MS::kFailure Error adding callback

Examples:
  componentScaleManip.cpp, customAttrManip.cpp, moveManip.cpp, rotateManip.cpp, and surfaceBumpManip.cpp.

MCallbackId addBeforeDuplicateCallback | ( | MMessage::MBasicFunction | func,
|  | void * | clientData = `NULL`,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  | `[static]`

Search for all occurrences

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] | func | the callback function

- clientData User defined data passed to the callback function

Parameters:

  [in] | clientData | User defined data passed to the callback function
  [out] | ReturnStatus | status code

Returns:
  Identifier used for removing the callback.

Status Codes:
  - MS::kSuccess Operation succeeded
  - MS::kInsufficientMemory No memory available
  - MS::kFailure Error adding callback

MCallbackId addAfterDuplicateCallback | ( | MMessage::MBasicFunction | func,
|  | void * | clientData = `NULL`,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  | `[static]`

Search for all occurrences

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] | func | the callback function

- clientData User defined data passed to the callback function

Parameters:

  [in] | clientData | User defined data passed to the callback function
  [out] | ReturnStatus | status code

Returns:
  Identifier used for removing the callback.

Status Codes:
  - MS::kSuccess Operation succeeded
  - MS::kInsufficientMemory No memory available
  - MS::kFailure Error adding callback

MCallbackId addNodeAddedToModelCallback | ( | const MObject & | dagNode,
|  | MMessage::MNodeFunction | func,
|  | void * | clientData = `NULL`,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  | `[static]`

Search for all occurrences

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] | dagNode | Node that should acquire the callback
  [in] | func | the callback function

- dagNode Node that is being added to the model
- clientData User defined data passed to the callback function

Parameters:

  [in] | clientData | User defined data passed to the callback function
  [out] | ReturnStatus | status code

Returns:
  Identifier used for removing the callback.

Status Codes:
  - MS::kSuccess Operation succeeded
  - MS::kInsufficientMemory No memory available
  - MS::kFailure Error adding callback

Examples:
  dagMessageCmd.cpp.

MCallbackId addNodeRemovedFromModelCallback | ( | const MObject & | dagNode,
|  | MMessage::MNodeFunction | func,
|  | void * | clientData = `NULL`,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  | `[static]`

Search for all occurrences

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] | dagNode | Node that should acquire the callback
  [in] | func | the callback function

- dagNode Node that is being removed from the model
- clientData User defined data passed to the callback function

Parameters:

  [in] | clientData | User defined data passed to the callback function
  [out] | ReturnStatus | status code

Returns:
  Identifier used for removing the callback.

Status Codes:
  - MS::kSuccess Operation succeeded
  - MS::kInsufficientMemory No memory available
  - MS::kFailure Error adding callback

Examples:
  dagMessageCmd.cpp.

const char * className | ( |  | ) | `[static]`

Search for all occurrences

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