class MSceneMessage

Jump to documentation

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

Inheritance:

MSceneMessage < MMessage

public members:

enum Message
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
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
kAfterReference
called after a File > Reference operation
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
kLast
last value of the enum
static MCallbackId addCallback ( Message , MMessage::MBasicFunction func, void * clientData = NULL, MStatus * ReturnStatus = NULL )
static MCallbackId addCheckCallback ( Message , MMessage::MCheckFunction func, void * clientData = NULL, MStatus * ReturnStatus = NULL )
static MCallbackId addCheckFileCallback ( Message , MMessage::MCheckFileFunction func, void * clientData = NULL, MStatus * ReturnStatus = NULL )
static MCallbackId addCallback ( Message , void (*func)( bool* retCode, void* clientData ), void * clientData = NULL, MStatus * ReturnStatus = NULL )
OBSOLETE & NO SCRIPT SUPPORT
static MCallbackId addCallback ( Message , void (*func)( bool* retCode, MFileObject & file, void* clientData ), void * clientData = NULL, MStatus * ReturnStatus = NULL )
OBSOLETE & NO SCRIPT SUPPORT

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

Scene messages. (OpenMaya) (OpenMaya.py)
Description

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.

Functions

MCallbackId MSceneMessage:: addCallback ( MSceneMessage::Message msg, MMessage::MBasicFunction func, void * clientData, MStatus * ReturnStatus )

Description

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:

  • kSceneUpdate
  • kBeforeNew
  • kAfterNew
  • kBeforeImport
  • kAfterImport
  • kBeforeOpen
  • kAfterOpen
  • kBeforeExport
  • kAfterExport
  • kBeforeSave
  • kAfterSave
  • kBeforeReference
  • kAfterReference
  • kBeforeRemoveReference
  • kAfterRemoveReference
  • kBeforeImportReference
  • kAfterImportReference
  • kBeforeExportReference
  • kAfterExportReference
  • kBeforeUnloadReference
  • kAfterUnloadReference
  • kBeforeLoadReference
  • kAfterLoadReference
  • kBeforeSoftwareRender
  • kAfterSoftwareRender
  • kBeforeSoftwareFrameRender
  • kAfterSoftwareFrameRender
  • kSoftwareRenderInterrupted
  • kMayaInitialized
  • kMayaExiting

Arguments

  • msg the scene message that will trigger the callback
  • func the callback function
    • clientData User defined data passed to the callback function
  • clientData user 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::kInsufficientMemory No memory available
  • MS::kFailure Error adding callback

MCallbackId MSceneMessage:: addCheckCallback ( MSceneMessage::Message msg, MMessage::MCheckFunction func, void * clientData, MStatus * ReturnStatus )

Description

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:

  • kBeforeNewCheck
  • kBeforeImportCheck
  • kBeforeOpenCheck
  • kBeforeExportCheck
  • kBeforeSaveCheck
  • kBeforeReferenceCheck
  • kBeforeLoadReferenceCheck

Arguments

  • msg the scene message that will trigger the callback
  • func the callback function
    • retCode boolean passed in to the callback function. Incase of any error, this will be set to false in the callback function.
    • clientData User defined data passed to the callback function
  • clientData user 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::kInsufficientMemory No memory available
  • MS::kFailure Error adding callback

MCallbackId MSceneMessage:: addCheckFileCallback ( MSceneMessage::Message msg, MMessage::MCheckFileFunction func, void * clientData, MStatus * ReturnStatus )

Description

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:

  • kBeforeImportCheck
  • kBeforeOpenCheck
  • kBeforeExportCheck
  • kBeforeReferenceCheck
  • kBeforeLoadReferenceCheck

Arguments

  • msg the scene message that will trigger the callback
  • func the callback function
    • retCode boolean passed in to the callback function. Incase of any error, this will be set to false in the callback function.
    • file MFileObject passed in to the callback function. This is the MFileObject that will be acted on by the current file IO operation, any modifications to it will be passed back to Maya and change the file being acted on.
    • clientData User defined data passed to the callback function
  • clientData user 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::kInsufficientMemory No memory available
  • MS::kFailure Error adding callback

MCallbackId MSceneMessage:: addCallback ( MSceneMessage::Message msg, void (*func)( bool* retCode, void* clientData ), void * clientData, MStatus * ReturnStatus )

Description

This method is OBSOLETE. Please use the addCheckCallback() method instead.

MCallbackId MSceneMessage:: addCallback ( MSceneMessage::Message msg, void (*func)( bool* retCode, MFileObject & file, void* clientData ), void * clientData, MStatus * ReturnStatus )

Description

This method is OBSOLETE. Please use the addCheckFileCallback() method instead.

This class has no child classes.


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