#include
<MSceneMessage.h>
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.
Events to which messages can be attached.
MCallbackId MSceneMessage::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:
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
[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 MSceneMessage::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 MSceneMessage::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 MSceneMessage::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:
[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 MSceneMessage::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.
MCallbackId MSceneMessage::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.
MCallbackId MSceneMessage::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.
Autodesk® Maya® 2011 © 1997-2010 Autodesk, Inc. All rights reserved. | Generated with 1.5.6 |