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

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Friends

# MRenderOverride Class Reference

# OpenMayaRender - API module for rendering

This reference page is linked to from the following overview topics: Rendering Overrides, Transition Guide, Devkit Samples.

Search for all occurrences

## Detailed Description

Base class for defining a rendering override.

`#include <MViewport2Renderer.h>`

List of all members.

## Public Member Functions
| MRenderOverride (const MString &name)
| Constructor for a name render override.
virtual | ~MRenderOverride ()
| Default destructor for a render override.
virtual MHWRender::DrawAPI | supportedDrawAPIs () const
| Returns the draw API supported by this override.
virtual bool | startOperationIterator ()=0
| In order for an override to indicate the set of operations that are to be performed it must implement overrides for the iterator methods on the override: startOperationIterator() renderOperation() nextRenderOperation()
virtual MRenderOperation * | renderOperation ()=0
| Return the current operation being iterated over.
virtual bool | nextRenderOperation ()=0
| Iterate to the next operation.
const MString & | name () const
| Query the name of the override.
virtual MStatus | setup (const MString &destination)
| Perform any setup required before render operations are to be executed.
virtual MStatus | cleanup ()
| Perform any cleanup required following the execution of render operations.
## Friends
class | M3dView Search for all occurrences

## Constructor & Destructor Documentation

MRenderOverride | ( | const MString & | name | ) |

Constructor for a name render override.

Parameters:

  [in] | name | Name of render override

## Member Function Documentation

MHWRender::DrawAPI supportedDrawAPIs | ( |  | ) | const `[virtual]`

Search for all occurrences

Returns the draw API supported by this override.

The returned value may be formed as the bitwise 'or' of MRenderer::DrawAPI elements to indicate that the override supports multiple draw APIs. This method returns 'MHWRender::kOpenGL' by default.

Returns:
  The draw API supported by this override

bool startOperationIterator | ( |  | ) | `[pure virtual]`

Search for all occurrences

In order for an override to indicate the set of operations that are to be performed it must implement overrides for the iterator methods on the override:

- startOperationIterator()
- renderOperation()
- nextRenderOperation()

The order that the operations are returned via these methods determines the order that the operations are invoked.

If there is a user operation (MUserRenderOperation) the execute() method for that operation will be called when the operation is invoked.

Note that the ordering will not change during one invocation of an override which is delimited by the setup() and cleanup() calls.

This particular method is called to allow the override to start iterating over a list of operations to be performed by the override.

The operations that are returned can be thought of as representing a "command list". This command list will perform in order from start to end.

Pseudo-code for the internal Maya iteration logic would look something like this:

            MRenderOverride override;
            if (override.startOperationIterator())
            {
                    --> Get operation
                    MRenderOperation *op = override.renderOperation();
                    while (op)
                    {
                            if (op)
                                    --> Add to "list" of operations to perform

                            --> Iterate to next operation
                            op = override.nextRenderOperation();
                    }
            }

Returns:
  True if there are any operations to iterate over. Note that an override with no operations will basically mean that the override draws nothing. In this case the renderer will perform it's default rendering operations.

MRenderOperation * renderOperation | ( |  | ) | `[pure virtual]`

Search for all occurrences

Return the current operation being iterated over.

The call to currentOperation() will occur after a startIteratingOperations() call.

Returns:
  Reference to the current operation

bool nextRenderOperation | ( |  | ) | `[pure virtual]`

Search for all occurrences

Iterate to the next operation.

If there are no more operations then this method should return false.

Returns:
  True if there is a subsequent operation.

const MString & name | ( |  | ) | const

Search for all occurrences

Query the name of the override.

Returns:
  Name of the override

MStatus setup | ( | const MString & | destination | ) | `[virtual]`

Search for all occurrences

Perform any setup required before render operations are to be executed.

The default behaviour performs no actions.

An override is called once per render. The order of method calls when an override is called is as follows:

- setup()
- startOperationIterator()
  - renderOperation()
  - nextRenderOperation() until no more operations
- cleanup()

Parameters:

  [in] | destination | String identifier which gives an indication as to where this override is being applied. Presently this will return a viewport panel name for interactive rendering.

Returns:
  Status code. MStatus::kSuccess is returned by default.

Status Codes:
  - MStatus::kSuccess Method succeed.
  - MStatus::kFailure Method failed.

MStatus cleanup | ( |  | ) | `[virtual]`

Search for all occurrences

Perform any cleanup required following the execution of render operations.

The default behaviour performs no actions.

Returns:
  Status code. MStatus::kSuccess is returned by default.

Status Codes:
  - MStatus::kSuccess Method succeed.
  - MStatus::kFailure Method failed.

MRenderOverride MRenderOverride MRenderOverride MRenderOverride MRenderOverride MRenderOverride MRenderOverride MRenderOverride MRenderOverride MRenderOverride
MRenderOverride MRenderOverride MRenderOverride MRenderOverride MRenderOverride MRenderOverride MRenderOverride MRenderOverride MRenderOverride MRenderOverride