MRenderUtilities Class Reference

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



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 MDrawContextacquireSwatchDrawContext ()
 Acquire a draw context fit for rendering a swatch.
static MDrawContextacquireUVTextureDrawContext ()
 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]

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]

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]

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

Parameters:
[out]rThe value for the red component.
[out]gThe value for the green component.
[out]bThe value for the blue component.
[out]aThe value for the alpha component.
MStatus blitTargetToImage ( const MRenderTarget target,
MImage image 
) [static]

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]targetThe source target to get the data from.
[in]imageThe destination image to copy the data to.
Returns:
Status code
Status Codes:
MStatus blitTargetToGL ( const MRenderTarget target,
const float  region[2][2],
bool  unfiltered 
) [static]

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]targetThe source target to get the data from.
[in]regionRectangular region to be rendered.
[in]unfilteredRender with hardware filtering or sharply defined pixels.
Returns:
Status code
Status Codes:
const char * className ( ) [static]

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