MModelMessage Class Reference
[OpenMaya - API module for common classes]

#include <MModelMessage.h>
Inheritance diagram for MModelMessage:
Inheritance graph
[legend]
Collaboration diagram for MModelMessage:
Collaboration graph
[legend]

List of all members.


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.


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

Member Enumeration Documentation

Message types supported by the addCallback method.

Enumerator:
kActiveListModified  active selection changes

Member Function Documentation

MCallbackId MModelMessage::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]  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:
Examples:

MCallbackId MModelMessage::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]  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:

MCallbackId MModelMessage::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]  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:

MCallbackId MModelMessage::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]  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:
Examples:

MCallbackId MModelMessage::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]  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:
Examples:

Autodesk® Maya® 2011 © 1997-2010 Autodesk, Inc. All rights reserved. Generated with doxygen 1.5.6