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

- Class List
- Class Hierarchy
- Class Members

Static Public Member Functions

# MRenderUtilities Class Reference
OpenMayaRender - API module for rendering

This reference page is linked to from the following overview topics: Extension for Autodesk Maya 2013.

Search for all occurrences

## Detailed Description

Utilities for Viewport 2.0.

This class is a utility class for rendering in Viewport 2.0

`#include <MRenderUtilities.h>`

List of all members.

## Static Public Member Functions
static MDrawContext * | acquireSwatchDrawContext ()
| Acquire a draw context fit for rendering a swatch.
static MDrawContext * | acquireUVTextureDrawContext ()
| Acquire a draw context fit for rendering a texture for the UV texture editor.
static void | swatchBackgroundColor (float &r, float &g, float &b, float &a)
| This method returns the default background color for the hardware rendered swatch.
static MStatus | blitTargetToImage (const MRenderTarget *target, MImage &image)
| Copy the data from a target to an image.
static MStatus | blitTargetToGL (const MRenderTarget *target, const float region[2][2], bool unfiltered)
| Blit the data from a target to current GL context.
static const char * | className ()
| Returns the name of this class.

## Member Function Documentation

MDrawContext * acquireSwatchDrawContext | ( |  | ) | `[static]`

Search for all occurrences

Acquire a draw context fit for rendering a swatch.

The user is responsible for releasing the draw context when it is no longer needed, by calling MRenderUtilities::releaseDrawContext().

Returns:
  The draw context, NULL on failure.

MDrawContext * acquireUVTextureDrawContext | ( |  | ) | `[static]`

Search for all occurrences

Acquire a draw context fit for rendering a texture for the UV texture editor.

The user is responsible for releasing the draw context when it is no longer needed, by calling MRenderUtilities::releaseDrawContext().

Returns:
  The draw context, NULL on failure.

void swatchBackgroundColor | ( | float & | r,
|  | float & | g,
|  | float & | b,
|  | float & | a
| ) |  | `[static]`

Search for all occurrences

This method returns the default background color for the hardware rendered swatch.

Parameters:

  [out] | r | The value for the red component.
  [out] | g | The value for the green component.
  [out] | b | The value for the blue component.
  [out] | a | The value for the alpha component.

MStatus blitTargetToImage | ( | const MRenderTarget * | target,
|  | MImage & | image
| ) |  | `[static]`

Search for all occurrences

Copy the data from a target to an image.

Only 2D targets and targets with the following formats are supported

- kR8G8B8A8_UNORM
- kB8G8R8A8
- kA8B8G8R8
- kR32_FLOAT
- kR32G32_FLOAT
- kR32G32B32_FLOAT
- kR32G32B32A32_FLOAT 8-bits formats only works with byte typed image. Float formats only works with float typed image and same number of channels.

Parameters:

  [in] | target | The source target to get the data from.
  [in] | image | The destination image to copy the data to.

Returns:
  Status code

Status Codes:
  - MStatus::kSuccess The operation executed successfully.
  - MStatus::kFailure The operation failed.

MStatus blitTargetToGL | ( | const MRenderTarget * | target,
|  | const float | region[2][2],
|  | bool | unfiltered
| ) |  | `[static]`

Search for all occurrences

Blit the data from a target to current GL context.

Only 2D targets and targets with the following formats are supported

- kR8G8B8A8_UNORM
- kB8G8R8A8
- kA8B8G8R8
- kR32_FLOAT
- kR32G32_FLOAT
- kR32G32B32_FLOAT

Parameters:

  [in] | target | The source target to get the data from.
  [in] | region | Rectangular region to be rendered.
  [in] | unfiltered | Render with hardware filtering or sharply defined pixels.

Returns:
  Status code

Status Codes:
  - MStatus::kSuccess The operation executed successfully.
  - MStatus::kFailure The operation failed.

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

Search for all occurrences

Returns the name of this class.

Returns:
  The name of this class.

MRenderUtilities MRenderUtilities MRenderUtilities MRenderUtilities MRenderUtilities MRenderUtilities MRenderUtilities MRenderUtilities MRenderUtilities MRenderUtilities
MRenderUtilities MRenderUtilities MRenderUtilities MRenderUtilities MRenderUtilities MRenderUtilities MRenderUtilities MRenderUtilities MRenderUtilities MRenderUtilities