- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Examples

- Class List
- Class Hierarchy
- Class Members

Static Public Member Functions

# MUiMessage Class Reference
OpenMayaUI - API module for user interface

This reference page is linked to from the following overview topics: Autodesk Maya 2014, Example C++ plug-in descriptions.

Search for all occurrences

## Detailed Description

UI messages.

This class is used to register callbacks to track the deletion of UI objects.

The first parameter passed to the add callback method is the name of the UI that will trigger the callback.

The 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.

`#include <MUiMessage.h>`

Inheritance diagram for MUiMessage:
[legend]

List of all members.

## Static Public Member Functions
static MCallbackId | addUiDeletedCallback (const MString &uiName, MMessage::MBasicFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL)
| This method registers a callback for UI deleted messages.
static MCallbackId | addCameraChangedCallback (const MString &panelName, MMessage::MStringNode func, void *clientData=NULL, MStatus *ReturnStatus=NULL)
| This method registers a callback for cameras being changed in 3d views.
static MCallbackId | add3dViewDestroyMsgCallback (const MString &panelName, MMessage::MStringFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL)
| This method registers a callback for when a particular 3d view gets destroyed.
static MCallbackId | add3dViewPreRenderMsgCallback (const MString &panelName, MMessage::MStringFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL)
| This method registers a callback for when a particular 3d view is about to render it's contents.
static MCallbackId | add3dViewPostRenderMsgCallback (const MString &panelName, MMessage::MStringFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL)
| This method registers a callback for when the 3d view is about to display it's rendered contents to the viewport.
static MCallbackId | add3dViewPreMultipleDrawPassMsgCallback (const MString &panelName, MUiMessage::MStringIndexFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL)
| This method registers a callback for when a particular 3d view's specific pass is about to be drawn when multiple drawing is enabled.
static MCallbackId | add3dViewPostMultipleDrawPassMsgCallback (const MString &panelName, MUiMessage::MStringIndexFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL)
| This method registers a callback for when a particular 3d view's specified pass is finshed when multiple drawing is enabled.
static MCallbackId | add3dViewRendererChangedCallback (const MString &panelName, MMessage::MThreeStringFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL)
| This method registers a callback for when the renderer for a particular 3d view changes.
static MCallbackId | add3dViewRenderOverrideChangedCallback (const MString &panelName, MMessage::MThreeStringFunction func, void *clientData=NULL, MStatus *ReturnStatus=NULL)
| This method registers a callback for when the render override for a particular 3d view changes.
static const char * | className ()
| Returns the name of this class.

## Member Function Documentation

MCallbackId addUiDeletedCallback | ( | const MString & | uiName,
|  | MMessage::MBasicFunction | func,
|  | void * | clientData = `NULL`,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  | `[static]`

Search for all occurrences

This method registers a callback for UI deleted messages.

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

Parameters:

  [in] | uiName | the name of the UI object to register the callback for
  [in] | func | the callback function, which takes the following parameters: clientData User defined data passed to the callback function
  [in] | clientData | User defined data that will be passed to the callback function
  [out] | ReturnStatus | status code

Returns:
  Identifier used for removing the callback.

Status Codes:
  - MS::kSuccess Operation succeeded
  - MS::kUnknownParameter The named UI object could not be found
  - MS::kInsufficientMemory No memory available
  - MS::kFailure Error adding callback

MCallbackId addCameraChangedCallback | ( | const MString & | panelName,
|  | MMessage::MStringNode | func,
|  | void * | clientData = `NULL`,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  | `[static]`

Search for all occurrences

This method registers a callback for cameras being changed in 3d views.

The callback is called when the camera changes for the given panel, not when attributes on the panel's camera change.

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

Parameters:

  [in] | panelName | Name of panel to which to attach the callback.
  [in] | func | the callback function, which takes the following parameters: panelName The name of the panel that had the camera change. camera The current camera used by the panel. clientData User defined data passed to the callback function
  [in] | clientData | User defined data that will be passed to the callback function
  [out] | ReturnStatus | status code

Returns:
  Identifier used for removing the callback.

Status Codes:
  - MS::kSuccess Operation succeeded
  - MS::kUnknownParameter The named UI object could not be found
  - MS::kInsufficientMemory No memory available
  - MS::kFailure Error adding callback

MCallbackId add3dViewDestroyMsgCallback | ( | const MString & | panelName,
|  | MMessage::MStringFunction | func,
|  | void * | clientData = `NULL`,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  | `[static]`

Search for all occurrences

This method registers a callback for when a particular 3d view gets destroyed.

The callback is called before the destruction of the view.

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

Parameters:

  [in] | panelName | Name of panel to which to attach the callback.
  [in] | func | the callback function, which takes the following parameters: panelName The name of the panel that contains the 3d view. clientData User defined data passed to the callback function
  [in] | clientData | User defined data that will be passed to the callback function
  [out] | ReturnStatus | status code

Returns:
  Identifier used for removing the callback.

Status Codes:
  - MS::kSuccess Operation succeeded
  - MS::kUnknownParameter The named UI object could not be found
  - MS::kInsufficientMemory No memory available
  - MS::kFailure Error adding callback

Examples:
  viewCallbackTest.cpp.

MCallbackId add3dViewPreRenderMsgCallback | ( | const MString & | panelName,
|  | MMessage::MStringFunction | func,
|  | void * | clientData = `NULL`,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  | `[static]`

Search for all occurrences

This method registers a callback for when a particular 3d view is about to render it's contents.

It is called before the scene is drawn, but after the background has been drawn.

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

Parameters:

  [in] | panelName | Name of panel to which to attach the callback.
  [in] | func | the callback function, which takes the following parameters: panelName The name of the panel that contains the 3d view. clientData User defined data passed to the callback function
  [in] | clientData | User defined data that will be passed to the callback function
  [out] | ReturnStatus | status code

Returns:
  Identifier used for removing the callback.

Status Codes:
  - MS::kSuccess Operation succeeded
  - MS::kUnknownParameter The named UI object could not be found
  - MS::kInsufficientMemory No memory available
  - MS::kFailure Error adding callback

Examples:
  viewCallbackTest.cpp.

MCallbackId add3dViewPostRenderMsgCallback | ( | const MString & | panelName,
|  | MMessage::MStringFunction | func,
|  | void * | clientData = `NULL`,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  | `[static]`

Search for all occurrences

This method registers a callback for when the 3d view is about to display it's rendered contents to the viewport.

It is called for every refresh of the view, after the scene is drawn, but before any 2d adornments are drawn.

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

Parameters:

  [in] | panelName | Name of panel to which to attach the callback.
  [in] | func | the callback function, which takes the following parameters: panelName The name of the panel that contains the 3d view. clientData User defined data passed to the callback function
  [in] | clientData | User defined data that will be passed to the callback function
  [out] | ReturnStatus | status code

Returns:
  Identifier used for removing the callback.

Status Codes:
  - MS::kSuccess Operation succeeded
  - MS::kUnknownParameter The named UI object could not be found
  - MS::kInsufficientMemory No memory available
  - MS::kFailure Error adding callback

Examples:
  viewCallbackTest.cpp.

MCallbackId add3dViewPreMultipleDrawPassMsgCallback | ( | const MString & | panelName,
|  | MUiMessage::MStringIndexFunction | func,
|  | void * | clientData = `NULL`,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  | `[static]`

Search for all occurrences

This method registers a callback for when a particular 3d view's specific pass is about to be drawn when multiple drawing is enabled.

The 3D view callbacks are called in the following order:

    		PreRender() callback

    			PreMultipleDrawPass( 0 ) callback
    				MPx3dModelView::preMultipleDrawPass( 0 ) [If available]
    					Render()
    				MPx3dModelView::postMultipleDrawPass( 0 ) [If available]
    			PostMultipleDrawPass( 0 ) callback

    			PreMultipleDrawPass( 1 ) callback
    				MPx3dModelView::preMultipleDrawPass( 1 ) [If available]
    					Render()
    				MPx3dModelView::postMultipleDrawPass( 1 ) [If available]
    			PostMultipleDrawPass( 1 ) callback
    			...

    		PostRender callback

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

Parameters:

  [in] | panelName | Name of panel to which to attach the callback.
  [in] | func | the callback function, which takes the following parameters: panelName The name of the panel that contains the 3d view. clientData User defined data passed to the callback function
  [in] | clientData | User defined data that will be passed to the callback function
  [out] | ReturnStatus | status code

Returns:
  Identifier used for removing the callback.

Status Codes:
  - MS::kSuccess Operation succeeded
  - MS::kUnknownParameter The named panel could not be found
  - MS::kInsufficientMemory No memory available
  - MS::kFailure Error adding callback

MCallbackId add3dViewPostMultipleDrawPassMsgCallback | ( | const MString & | panelName,
|  | MUiMessage::MStringIndexFunction | func,
|  | void * | clientData = `NULL`,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  | `[static]`

Search for all occurrences

This method registers a callback for when a particular 3d view's specified pass is finshed when multiple drawing is enabled.

See add3dViewPreMultipleDrawPassMsgCallback for the order in which 3D view callbacks are called.

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

Parameters:

  [in] | panelName | Name of panel to which to attach the callback.
  [in] | func | the callback function, which takes the following parameters: panelName The name of the panel that contains the 3d view. clientData User defined data passed to the callback function
  [in] | clientData | User defined data that will be passed to the callback function
  [out] | ReturnStatus | status code

Returns:
  Identifier used for removing the callback.

Status Codes:
  - MS::kSuccess Operation succeeded
  - MS::kUnknownParameter The named panel could not be found
  - MS::kInsufficientMemory No memory available
  - MS::kFailure Error adding callback

MCallbackId add3dViewRendererChangedCallback | ( | const MString & | panelName,
|  | MMessage::MThreeStringFunction | func,
|  | void * | clientData = `NULL`,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  | `[static]`

Search for all occurrences

This method registers a callback for when the renderer for a particular 3d view changes.

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

Parameters:

  [in] | panelName | Name of panel to which to attach the callback.
  [in] | func | the callback function, which takes the following parameters: panelName The name of the panel that contains the 3d view oldRenderer The name of the old renderer used to draw the 3d view newRenderer The name of the new renderer used to draw the 3d view clientData User defined data passed to the callback function
  [in] | clientData | User defined data that will be passed to the callback function
  [out] | ReturnStatus | status code

Returns:
  Identifier used for removing the callback.

Status Codes:
  - MS::kSuccess Operation succeeded
  - MS::kUnknownParameter The named panel could not be found
  - MS::kInsufficientMemory No memory available
  - MS::kFailure Error adding callback

MCallbackId add3dViewRenderOverrideChangedCallback | ( | const MString & | panelName,
|  | MMessage::MThreeStringFunction | func,
|  | void * | clientData = `NULL`,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  | `[static]`

Search for all occurrences

This method registers a callback for when the render override for a particular 3d view changes.

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

Parameters:

  [in] | panelName | Name of panel to which to attach the callback.
  [in] | func | the callback function, which takes the following parameters: panelName The name of the panel that contains the 3d view oldOverride The name of the old override used to draw in the 3d view newOverride The name of the new override used to draw in the 3d view clientData User defined data passed to the callback function
  [in] | clientData | User defined data that will be passed to the callback function
  [out] | ReturnStatus | status code

Returns:
  Identifier used for removing the callback.

Status Codes:
  - MS::kSuccess Operation succeeded
  - MS::kUnknownParameter The named panel could not be found
  - MS::kInsufficientMemory No memory available
  - MS::kFailure Error adding callback

const char * className | ( |  | ) | `[static]`

Search for all occurrences

Returns the name of this class.

Returns:
  The name of this class.

Reimplemented from MMessage.

MUiMessage MUiMessage MUiMessage MUiMessage MUiMessage MUiMessage MUiMessage MUiMessage MUiMessage MUiMessage
MUiMessage MUiMessage MUiMessage MUiMessage MUiMessage MUiMessage MUiMessage MUiMessage MUiMessage MUiMessage