|
static bool | doesRenderEditorExist () |
| Determines whether or not a Render View exists to receive image data. More...
|
|
static MStatus | setCurrentCamera (MDagPath &camera) |
| Informs the render client of the camera that will be performing the rendering. More...
|
|
static MStatus | getRenderRegion (unsigned int &left, unsigned int &right, unsigned int &bottom, unsigned int &top) |
| Retrieves the currently selected Render Region in Maya's Render View. More...
|
|
static MStatus | startRender (unsigned int width, unsigned int height, bool doNotClearBackground=false, bool immediateFeedback=false) |
| Informs the Render View that a full image render is about to begin. More...
|
|
static MStatus | startRegionRender (unsigned int imageWidth, unsigned int imageHeight, unsigned int regionLeft, unsigned int regionRight, unsigned int regionBottom, unsigned int regionTop, bool doNotClearBackground=false, bool immediateFeedback=false) |
| Informs the Render View that a region render is about to begin. More...
|
|
static MStatus | updatePixels (unsigned int left, unsigned int right, unsigned int bottom, unsigned int top, RV_PIXEL *pPixels, bool isHdr=false, const unsigned int numberOfAOVs=0, const RV_AOV *const pAOVs=NULL) |
| Sends a block of pixels to the Render View. More...
|
|
static MStatus | refresh (unsigned int left, unsigned int right, unsigned int bottom, unsigned int top) |
| Requests that the Render View refresh the display of a particular region of the displayed image. More...
|
|
static MStatus | endRender () |
| Informs the Render View that the current render has completed. More...
|
|
static const char * | className () |
| Returns the name of this class. More...
|
|
Static class providing Render View API functions.
This class provides access to the Maya Render View. The class allows plugins to send image data to the Render View in the same way that the Maya renderer does. Either a "full render" or a "region
render" can be performed. In a full render, the Render View expects to receive pixel data that fills the entire image, while a region render expects only updates to a specified image region.
Usage
To send an image to the Render View, use the following sequence of calls:
-
Call doesRenderEditorExist() to make sure that a Render View exists. If this returns false, then Maya is operating in batch mode.
-
Call setCurrentCamera() to specify the name of the camera that is being rendered.
-
Call startRender() or startRegionRender() to inform the Render View that you are about to start sending either a full image or a region update. When region rendering, the getRenderRegion() method can be used to retrieve the currently selected marquee region in the Render View.
-
The image or image region is sent to the Render View as a series of one or more tiles. For each tile, send the tile's image data using the updatePixels() method. Call the refresh() method to refresh the Render View after each tile has been sent.
-
Call endRender() to signal the Render View that all image data has been sent.
MStatus updatePixels |
( |
unsigned int |
left, |
|
|
unsigned int |
right, |
|
|
unsigned int |
bottom, |
|
|
unsigned int |
top, |
|
|
RV_PIXEL * |
pPixels, |
|
|
bool |
isHdr = false , |
|
|
const unsigned int |
numberOfAOVs = 0 , |
|
|
const RV_AOV *const |
pAOVs = NULL |
|
) |
| |
|
static |
Sends a block of pixels to the Render View.
Pixel colors are represented as 4-channel floating point values. For low dynamic range images, color values are in standard RGB (sRGB) colorspace, and in the range (0,255.0). For high dynamic range (HDR) images, the range is unbounded, and values are in linear CIE XYZ color space, with the X, Y, and Z values stored respectively in the R, G and B fields of the RV_PIXEL structure. Alpha values for HDR images are expected to be in the range (0,1). Out of range alpha values are not clamped, and may behave unexpectedly.
- Parameters
-
[in] | left | left extent of the update region. |
[in] | right | right extent of the update region. The column x=right is considered part of the region. |
[in] | bottom | bottom extent of the update region. |
[in] | top | top extent of the update region. The row y=regionTop is considered part of the region. |
[in] | pPixels | buffer containing the pixel data for the image. The buffer should contain (right-left+1)*(top-bottom+1) pixels. |
[in] | isHdr | indicates whether the image has high dynamic range |
[in] | numberOfAOVs | indicates the number of arbitrary output variable (AOV) buffers (not yet implemented). |
[in] | pAOVs | array of RV_AOV objects. The height and width of each AOV must match pPixels (not yet implemented). |
- Returns
- MS::kSuccess Operation was successful.
- MS::kInvalidParameter Operation failed, either because the specified update region was invalid, or because the specified pixel buffer was NULL.
- MS::kFailure Operation failed because no Render View existed.
- Examples:
- renderViewInteractiveRenderCmd/renderViewInteractiveRenderCmd.cpp, renderViewRenderCmd/renderViewRenderCmd.cpp, and renderViewRenderRegionCmd/renderViewRenderRegionCmd.cpp.