Scene messages.
This class is used to register callbacks for scene 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 <MSceneMessage.h>
Public Types |
|
enum | Message
{ kSceneUpdate, kBeforeNew, kAfterNew, kBeforeImport, kAfterImport, kBeforeOpen, kAfterOpen, kBeforeExport, kAfterExport, kBeforeSave, kAfterSave, kBeforeReference, kAfterReference, kBeforeRemoveReference, kAfterRemoveReference, kBeforeImportReference, kAfterImportReference, kBeforeExportReference, kAfterExportReference, kBeforeUnloadReference, kAfterUnloadReference, kBeforeSoftwareRender, kAfterSoftwareRender, kBeforeSoftwareFrameRender, kAfterSoftwareFrameRender, kSoftwareRenderInterrupted, kMayaInitialized, kMayaExiting, kBeforeNewCheck, kBeforeOpenCheck, kBeforeSaveCheck, kBeforeImportCheck, kBeforeExportCheck, kBeforeLoadReference, kAfterLoadReference, kBeforeLoadReferenceCheck, kBeforeReferenceCheck, kBeforeCreateReferenceCheck = kBeforeReferenceCheck, kBeforePluginLoad, kAfterPluginLoad, kBeforePluginUnload, kAfterPluginUnload, kBeforeCreateReference, kAfterCreateReference, kExportStarted, kLast } |
Events to which messages can be attached. More... |
|
Static Public Member Functions |
|
static MCallbackId | addCallback (Message msg, MMessage::MBasicFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL) |
Adds a new callback for the specified scene
message. |
|
static MCallbackId | addCheckCallback (Message msg, MMessage::MCheckFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL) |
This function adds a new callback for the
specified scene message and also has the option to abort the
current operation by return false through the return code
parameter. |
|
static MCallbackId | addCheckFileCallback (Message msg, MMessage::MCheckFileFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL) |
This function adds a new callback for the
specified scene message. |
|
static MCallbackId | addStringArrayCallback (Message msg, MMessage::MStringArrayFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL) |
Adds a new callback which takes a string
array argument, in addition to the usual clientData. |
|
static const char * | className () |
Returns the name of this class. |
|
static MCallbackId | addCallback (Message, void(*func)(bool *retCode, void *clientData), void *clientData=NULL, MStatus *ReturnStatus=NULL) |
This method is obsolete. This
method is not available in Python. |
|
static MCallbackId | addCallback (Message, void(*func)(bool *retCode, MFileObject &file, void *clientData), void *clientData=NULL, MStatus *ReturnStatus=NULL) |
This method is obsolete. This
method is not available in Python. |
|
static MCallbackId | addCallback (Message, void(*func)(const MStringArray &, void *), void *clientData, MStatus *ReturnStatus) |
This method is obsolete. This
method is not available in Python. |
enum Message |
Events to which messages can be attached.
MCallbackId addCallback | ( | MSceneMessage::Message | msg, |
MMessage::MBasicFunction | func, | ||
void * | clientData = NULL , |
||
MStatus * | ReturnStatus =
NULL |
||
) | [static] |
Adds a new callback for the specified scene message.
If a 'before' message is sent, the corresponding 'after' message will be as well.
Callbacks can be added to the following messages with this function:
Note that for referencing, the creation of the reference (i.e. creation of the reference node and associated structures) is separate from the loading of the reference itself (i.e. read the nodes from file).
The kBeforeCreateReference message will be sent when a reference is created. So it will happen for both loaded and unloaded references. But the kBeforeLoadReference message will only be sent when the file is read from disk.
When opening a file with a loaded reference, the callback order is as follows,
kBeforeCreateReference kAfterCreateReference
kBeforeLoadReference kAfterLoadReference
The kExportStarted callback is sent after the kBeforeExport callback, once Maya has actually started to process the exported data. One important difference between the two callbacks is that the fileInfo command affects the exported scene when used in the kExportStarted callback, but affects the current scene in memory when used in the kBeforeExport callback.
[in] | msg | the scene message that will trigger the callback |
[in] | func | the callback function
|
[in] | clientData | user data that will be passed to the callback function |
[out] | ReturnStatus | Status code |
MCallbackId addCheckCallback | ( | MSceneMessage::Message | msg, |
MMessage::MCheckFunction | func, | ||
void * | clientData = NULL , |
||
MStatus * | ReturnStatus =
NULL |
||
) | [static] |
This function adds a new callback for the specified scene message and also has the option to abort the current operation by return false through the return code parameter.
NOTE: The check message is sent out before the equivalent non-check type. As a result, if the check message aborts the operation, the equivalent non-check message type will not be sent.
Callbacks can be added to the following messages with this function:
[in] | msg | the scene message that will trigger the callback |
[in] | func | the callback function |
[in] | clientData | user data that will be passed to the callback function |
[out] | ReturnStatus | Status code |
MCallbackId addCheckFileCallback | ( | MSceneMessage::Message | msg, |
MMessage::MCheckFileFunction | func, | ||
void * | clientData = NULL , |
||
MStatus * | ReturnStatus =
NULL |
||
) | [static] |
This function adds a new callback for the specified scene message.
This callback has the option to abort the current operation by setting the retCode parameter to false. The file parameter stores the target file for the current file IO operation, by modifying this file parameter the target file will be changed as well.
NOTE: The check message is sent out before the equivalent non-check type. As a result, if the check message aborts the operation, the equivalent non-check message type will not be sent.
Callbacks can be added to the following messages with this function:
[in] | msg | the scene message that will trigger the callback |
[in] | func | the callback function |
[in] | clientData | user data that will be passed to the callback function |
[out] | ReturnStatus | Status code |
MCallbackId addStringArrayCallback | ( | MSceneMessage::Message | msg, |
MMessage::MStringArrayFunction | func, | ||
void * | clientData = NULL , |
||
MStatus * | ReturnStatus =
NULL |
||
) | [static] |
Adds a new callback which takes a string array argument, in addition to the usual clientData.
The messages which can be used with this method and the contents of the string array passed to their callbacks are as follows:
To allow for future expansion callbacks should not rely on the number of array elements being exactly as given above. While there will not be fewer elements than given above, there may in future be more.
[in] | msg | the scene message that will trigger the callback |
[in] | func | the callback function |
[in] | clientData | user data that will be passed to the callback function |
[out] | ReturnStatus | Status code |
const char * className | ( | ) | [static] |
MCallbackId addCallback | ( | MSceneMessage::Message | msg, |
void(*)(bool *retCode, void *clientData) | func, | ||
void * | clientData = NULL , |
||
MStatus * | ReturnStatus =
NULL |
||
) | [static] |
This method is obsolete. This method is not available in Python.
[in] | msg | |
[in] | func | |
[in] | clientData | |
[out] | ReturnStatus |
MCallbackId addCallback | ( | MSceneMessage::Message | msg, |
void(*)(bool *retCode, MFileObject &file, void *clientData) | func, | ||
void * | clientData = NULL , |
||
MStatus * | ReturnStatus =
NULL |
||
) | [static] |
This method is obsolete. This method is not available in Python.
[in] | msg | |
[in] | func | |
[in] | clientData | |
[out] | ReturnStatus |
MCallbackId addCallback | ( | MSceneMessage::Message | msg, |
void(*)(const MStringArray &, void *) | func, | ||
void * | clientData, | ||
MStatus * | ReturnStatus | ||
) | [static] |
This method is obsolete. This method is not available in Python.
[in] | msg | |
[in] | func | |
[in] | clientData | |
[out] | ReturnStatus |