C++ API Reference
|
Scene messages. More...
#include <MSceneMessage.h>
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. More... | |
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. More... | |
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. More... | |
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. More... | |
static MCallbackId | addReferenceCallback (Message msg, MMessage::MObjectFileFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL) |
This function adds a new callback for the specified scene message. More... | |
static MCallbackId | addCheckReferenceCallback (Message msg, MMessage::MCheckObjectFileFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL) |
This function adds a new callback for the specified scene message. More... | |
static MCallbackId | addConnectionFailedCallback (MMessage::MConnFailFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL) |
This method registers a callback that is called when a connection was unable to be made. More... | |
static MCallbackId | addNamespaceRenamedCallback (MMessage::MTwoStringFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL) |
This method registers a callback that is called when a namespace is renamed. More... | |
static const char * | className () |
Returns the name of this class. More... | |
static MCallbackId | addCallback (Message, void(*func)(bool *retCode, void *clientData), void *clientData=NULL, MStatus *ReturnStatus=NULL) |
This method is obsolete. More... | |
static MCallbackId | addCallback (Message, void(*func)(bool *retCode, MFileObject &file, void *clientData), void *clientData=NULL, MStatus *ReturnStatus=NULL) |
This method is obsolete. More... | |
static MCallbackId | addCallback (Message, void(*func)(const MStringArray &, void *), void *clientData, MStatus *ReturnStatus) |
This method is obsolete. More... | |
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.
enum Message |
Events to which messages can be attached.
Enumerator | |
---|---|
kSceneUpdate |
Called after any operation that changes which files are loaded. |
kBeforeNew |
Called before a File > New operation. |
kAfterNew |
Called after a File > New operation. |
kBeforeImport |
Called before a File > Import operation. |
kAfterImport |
Called after a File > Import operation. |
kBeforeOpen |
Called before a File > Open operation. |
kAfterOpen |
Called after a File > Open operation. |
kBeforeFileRead |
Called immediately before any file read operation (open, import or reference) and while reading state (MFileIO::isReadingFile) is true. |
kAfterFileRead |
Called immediately after any file read operation (open, import or reference) and while reading state (MFileIO::isReadingFile) is true. |
kAfterSceneReadAndRecordEdits |
Call once after any file operation (open, import or reference) with reference edits recorded during the execution of the callback Note, isReadingFile is false during this callback. |
kBeforeExport |
Called before a File > Export operation. |
kAfterExport |
Called after a File > Export operation. |
kBeforeSave |
Called before a File > Save (or SaveAs) operation. |
kAfterSave |
Called after a File > Save (or SaveAs) operation. |
kBeforeReference |
Called before a File > Reference operation. Deprecated. Use kBeforeCreateReference/kBeforeLoadReference. |
kAfterReference |
Called after a File > Reference operation. Deprecated. Use kAfterCreateReference/kAfterLoadReference. |
kBeforeRemoveReference |
Called before a File > RemoveReference operation. |
kAfterRemoveReference |
Called after a File > RemoveReference operation. |
kBeforeImportReference |
Called before a File > ImportReference operation. |
kAfterImportReference |
Called after a File > ImportReference operation. |
kBeforeExportReference |
Called before a File > ExportReference operation. |
kAfterExportReference |
Called after a File > ExportReference operation. |
kBeforeUnloadReference |
Called before a File > UnloadReference operation. |
kAfterUnloadReference |
Called after a File > UnloadReference operation. |
kBeforeSoftwareRender |
Called before a Software Render begins. |
kAfterSoftwareRender |
Called after a Software Render ends. |
kBeforeSoftwareFrameRender |
Called before each frame of a Software Render. |
kAfterSoftwareFrameRender |
Called after each frame of a Software Render. |
kSoftwareRenderInterrupted |
Called when an interactive render is interrupted by the user. |
kMayaInitialized |
Called on interactive or batch startup after initialization. |
kMayaExiting |
Called just before Maya exits. |
kBeforeNewCheck |
Called prior to File > New operation, allows user to cancel action. |
kBeforeOpenCheck |
Called prior to File > Open operation, allows user to cancel action. |
kBeforeSaveCheck |
Called prior to File > Save operation, allows user to cancel action. |
kBeforeImportCheck |
Called prior to File > Import operation, allows user to cancel action. |
kBeforeExportCheck |
Called prior to File > Export operation, allows user to cancel action. |
kBeforeLoadReference |
Called before a File > LoadReference operation. |
kAfterLoadReference |
Called after a File > LoadReference operation. |
kBeforeLoadReferenceCheck |
Called before a File > LoadReference operation, allows user to cancel action. |
kBeforeReferenceCheck |
Called prior to a File > CreateReference operation, allows user to cancel action. Deprecated. Use kBeforeCreateReferenceCheck. |
kBeforeCreateReferenceCheck |
Called prior to a File > CreateReference operation, allows user to cancel action. |
kBeforePluginLoad |
Called prior to a plugin being loaded. |
kAfterPluginLoad |
Called after a plugin is loaded. |
kBeforePluginUnload |
Called prior to a plugin being unloaded. |
kAfterPluginUnload |
Called after a plugin is unloaded. |
kBeforeCreateReference |
Called before a File > CreateReference operation. |
kAfterCreateReference |
Called after a File > CreateReference operation. |
kExportStarted |
Called at the start of a File > Export operation, after the export file has become the active file. |
kBeforeLoadReferenceAndRecordEdits |
Same as kBeforeLoadReference except reference edits are recorded during the execution of the callback. |
kAfterLoadReferenceAndRecordEdits |
Same as kAfterLoadReference except reference edits are recorded during the execution of the callback. |
kBeforeCreateReferenceAndRecordEdits |
Same as kBeforeCreateReference except reference edits are recorded during the execution of the callback. |
kAfterCreateReferenceAndRecordEdits |
Same as kAfterCreateReference except reference edits are recorded during the execution of the callback. |
kLast |
Last value of the enum. |
|
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,
By default, edits to referenced objects will not be recorded during the execution of file I/O callbacks. A specific set of callbacks are provided that will enable the recording of reference edits during their execution as follows,
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 |
|
static |
This function adds a new callback for the specified scene message.
The callback will have the ability to abort the current operation by returning false through its 'retCode' 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 |
|
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 |
|
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 |
|
static |
This function adds a new callback for the specified scene message.
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 |
|
static |
This function adds a new callback for the specified scene message.
The callback will have the ability to abort the current operation by returning false through its 'retCode' 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 |
|
static |
This method registers a callback that is called when a connection was unable to be made.
Currently, the callback is only triggered during the reading of files (.ma or .mb) or of edits files (.editMA or .editMB files created by Maya's offline file support). The most common reasons why a connection would fail are:
[in] | func | the callback function
|
[in] | clientData | User defined data passed to the callback function |
[out] | ReturnStatus | status code |
|
static |
This method registers a callback that is called when a namespace is renamed.
[in] | func | the callback function
|
[in] | clientData | User defined data passed to the callback function |
[out] | ReturnStatus | status code |
|
static |
Returns the name of this class.
|
static |
This method is obsolete.
This method is obsolete. This method is not available in Python.
[From Maya 2019]
[in] | msg | |
[in] | func | |
[in] | clientData | |
[out] | ReturnStatus |
|
static |
This method is obsolete.
This method is obsolete. This method is not available in Python.
[From Maya 2019]
[in] | msg | |
[in] | func | |
[in] | clientData | |
[out] | ReturnStatus |
|
static |
This method is obsolete.
This method is obsolete. This method is not available in Python.
[From Maya 2019]
[in] | msg | |
[in] | func | |
[in] | clientData | |
[out] | ReturnStatus |