class MEventMessage

Jump to documentation

: public MMessage Event messages. (OpenMaya) (OpenMaya.py)

Inheritance:

MEventMessage < MMessage

public members:

static MCallbackId addEventCallback ( const MString & event, MMessage::MBasicFunction func, void * clientData = NULL, MStatus * ReturnStatus = NULL )
static MStatus getEventNames ( MStringArray & names )

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

Event messages. (OpenMaya) (OpenMaya.py)
Description

This class is used to register callbacks for specific events.

The first parameter passed to the add callback method is the name of the event that will trigger the callback. The list of available event names can be retrieved by calling the getEventNames method or by using the -listEvents flag on the scriptJob command.

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.

Functions

MCallbackId MEventMessage:: addEventCallback ( const MString & eventName, MMessage::MBasicFunction func, void * clientData, MStatus * ReturnStatus )
Description

This method registers a callback for event occurred messages.

The callback function will be passed the any client data that was provided when the callback was registered.

Arguments

  • event the event to register the callback for
  • func the callback function
    • 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::kUnknownParameter The named event could not be found
  • MS::kInsufficientMemory No memory available
  • MS::kFailure Error adding callback

MStatus MEventMessage:: getEventNames ( MStringArray & names )
Description

This method returns the list of available event names.

Arguments

  • names set to the array of available event names.

Return Value

  • MS::kSuccess Operation succeeded
  • MS::kInsufficientMemory No memory available
  • MS::kFailure Error retrieving event names

This class has no child classes.


Autodesk® Maya® 8.0 © 1997-2006 Autodesk, Inc. All rights reserved. doc++ Copyright