Render Items (MRenderItem)

The formal interface presented for a render item is the class MRenderItem.

Figure 15

MRenderItem has various properties. Depending on whether a render item is involved in the update phase or the rendering phase, the interfaces to these properties may or may not be writeable.

The main properties are as follows:

Figure 16

With these proprieties this class can represent any or all of the following Maya options:

As a single render item does not represent all possibilities a collection of render items (MRenderItemList) is main­tained per renderable object. However, depending on what needs to be rendered, it is possible that zero or more of these items are “enabled” (passed down the pipeline) for drawing.

Figure 17

As an example a renderable object may have 4 items: 2 for shaded sub-regions, 1 for wireframe and 1 for vertex dis­play. Pruning may occur at update time leaving only the wireframe and vertex display items. Further pruning may remove the “wireframe” render item leaving only the vertex display item. Pruning generally reflects internal requirements such as viewport display modes.

MRenderItem objects are assumed to be transient, and as such plug-ins should not hold on to references to instances of this class. Instances of MRenderItem cannot be created or deleted directly. Plug-ins must use static Create() and Destroy() methods on MRenderItem. This provides for stability when memory is allocated/deallocated from different DLLs.