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

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions

# MSceneRender Class Reference
OpenMayaRender - API module for rendering

This reference page is linked to from the following overview topics: Autodesk Maya 2014, Extension for Autodesk Maya 2013, Rendering Overrides, 3.8 Render Loop Overrides, 3.9 UI draw manager, 4.2 Lighting Interfaces.

Search for all occurrences

## Detailed Description

Class which defines a scene render.

`#include <MViewport2Renderer.h>`

Inheritance diagram for MSceneRender:
[legend]

List of all members.

## Public Types
enum | MObjectTypeExclusions { kExcludeNone = 0, kExcludeNurbsCurves = 1<<(0), kExcludeNurbsSurfaces = 1<<(1), kExcludeMeshes = 1<<(2), kExcludePlanes = 1<<(3), kExcludeLights = 1<<(4), kExcludeCameras = 1<<(5), kExcludeJoints = 1<<(6), kExcludeIkHandles = 1<<(7), kExcludeDeformers = 1<<(8), kExcludeDynamics = 1<<(9), kExcludeLocators = 1<<(10), kExcludeDimensions = 1<<(11), kExcludeSelectHandles = 1<<(12), kExcludePivots = 1<<(13), kExcludeTextures = 1<<(14), kExcludeGrid = 1<<(15), kExcludeCVs = 1<<(16), kExcludeHulls = 1<<(17), kExcludeStrokes = 1<<(18), kExcludeSubdivSurfaces = 1<<(19), kExcludeFluids = 1<<(20), kExcludeFollicles = 1<<(21), kExcludeHairSystems = 1<<(22), kExcludeImagePlane = 1<<(23), kExcludeNCloths = 1<<(24), kExcludeNRigids = 1<<(25), kExcludeDynamicConstraints = 1<<(26), kExcludeManipulators = 1<<(27), kExcludeNParticles = 1<<(28), kExcludeMotionTrails = 1<<(29), kExcludeAll = ~0 }
| Object type exclusions. More...
enum | MSceneFilterOption { , kRenderPreSceneUIItems = 1 << (0), kRenderOpaqueShadedItems = 1 << (1), kRenderTransparentShadedItems = 1 << (2), kRenderShadedItems = (kRenderOpaqueShadedItems | kRenderTransparentShadedItems), kRenderPostSceneUIItems = 1 << (3) , kRenderAllItems = ~0 }
| Render filter options. More...
enum | MDisplayMode { kNoDisplayModeOverride = 0, kWireFrame = 1<<(0), kShaded = 1<<(1), kDefaultMaterial = 1<<(2), kShadedNonTextured = 1<<(3), kBoundingBox = 1<<(4) }
| Display modes. More...
enum | MLightingMode { kNoLightingModeOverride = 0, kAmbientLight, kLightDefault, kSelectedLights, kSceneLights }
| Lighting mode. More...
enum | MPostEffectsOverride { kPostEffectDisableNone = 0, kPostEffectDisableSSAO = 1 << (0), kPostEffectDisableMotionBlur = 1 << (1), kPostEffectDisableDOF = 1 << (2), kPostEffectDisableAll = ~0 }
| Post effect override. More...
enum | MCullingOption { kNoCullingOverride = 0, kCullNone, kCullBackFaces, kCullFrontFaces }
| Culling option. More...
## Public Member Functions
| MSceneRender (const MString &name)
| Constructor for a named scene render.
virtual | ~MSceneRender ()
| Default destructor for a scene render.
virtual void | preRender ()
| Method to allow for the operation to update itself before being executed.
virtual void | postRender ()
| Method to allow for the operation to clean up itself after being executed.
virtual void | preSceneRender (const MDrawContext &context)
| Method to allow for the operation to update itself before a scene rendering begins.
virtual void | postSceneRender (const MDrawContext &context)
| Method to allow for the operation to update itself after a scene rendering ends.
virtual MSceneFilterOption | renderFilterOverride ()
| This method allows for the programmer to provide feedback on determining which elements of a scene render will be drawn based on semantic meaning.
virtual const MCameraOverride * | cameraOverride ()
| Query for a camera override.
virtual const MSelectionList * | objectSetOverride ()
| Query for override for the set of objects to view.
virtual const MShaderInstance * | shaderOverride ()
| Query for a scene level shader override.
virtual MObjectTypeExclusions | objectTypeExclusions ()
| Query for any object type exclusions.
virtual MDisplayMode | displayModeOverride ()
| Query for any display mode override.
virtual MLightingMode | lightModeOverride ()
| Query for any lighting mode override.
virtual const bool * | shadowEnableOverride ()
| Query for shadow display override.
virtual MPostEffectsOverride | postEffectsOverride ()
| Query for post effects override.
virtual MCullingOption | cullingOverride ()
| Query for a face culling override.
virtual MClearOperation & | clearOperation ()
| Get the scene clear operation.
virtual bool | hasUIDrawables () const
| If you've overridden addPreUIDrawables() or addPostUIDrawables() then you must override this method to return true in order for them to have any effect.
virtual void | addPreUIDrawables (MUIDrawManager &drawManager, const MFrameContext &frameContext)
| Provides access to the MUIDrawManager, which can be used to queue up operations to draw simple UI shapes like lines, circles, text, etc.
virtual void | addPostUIDrawables (MUIDrawManager &drawManager, const MFrameContext &frameContext)
| Provides access to the MUIDrawManager, which can be used to queue up operations to draw simple UI shapes like lines, circles, text, etc.

## Member Enumeration Documentation

enum MObjectTypeExclusions

Search for all occurrences

Object type exclusions.

Enumerator:

  kExcludeNone | Exclude no object types. Search for all occurrences
  kExcludeNurbsCurves | Exclude NURBS curves. Search for all occurrences
  kExcludeNurbsSurfaces | Exclude NURBS surface. Search for all occurrences
  kExcludeMeshes | Exclude polygonal meshes. Search for all occurrences
  kExcludePlanes | Exclude planes. Search for all occurrences
  kExcludeLights | Exclude lights. Search for all occurrences
  kExcludeCameras | Exclude camera. Search for all occurrences
  kExcludeJoints | Exclude joints. Search for all occurrences
  kExcludeIkHandles | Exclude IK handles. Search for all occurrences
  kExcludeDeformers | Exclude all deformations. Search for all occurrences
  kExcludeDynamics | Exclude all dynamics objects (emiiters, cloth) Search for all occurrences
  kExcludeLocators | Exclude locators. Search for all occurrences
  kExcludeDimensions | Exclude all measurement objects. Search for all occurrences
  kExcludeSelectHandles | Exclude selection handles. Search for all occurrences
  kExcludePivots | Exclude pivots. Search for all occurrences
  kExcludeTextures | Exclude texure placement objects. Search for all occurrences
  kExcludeGrid | Exclude grid drawing. Search for all occurrences
  kExcludeCVs | Exclude NURBS control vertices. Search for all occurrences
  kExcludeHulls | Exclude NURBS hulls. Search for all occurrences
  kExcludeStrokes | Exclude PaintFX strokes. Search for all occurrences
  kExcludeSubdivSurfaces | Exclude subdivision surfaces. Search for all occurrences
  kExcludeFluids | Exclude fluid objects. Search for all occurrences
  kExcludeFollicles | Exclude hair follicles. Search for all occurrences
  kExcludeHairSystems | Exclude hair system. Search for all occurrences
  kExcludeImagePlane | Exclude image planes. Search for all occurrences
  kExcludeNCloths | Exclude N-cloth objects. Search for all occurrences
  kExcludeNRigids | Exclude rigid-body objects. Search for all occurrences
  kExcludeDynamicConstraints | Exclude rigid-body constraints. Search for all occurrences
  kExcludeManipulators | Exclude manipulators. Search for all occurrences
  kExcludeNParticles | Exclude N-particle objects. Search for all occurrences
  kExcludeMotionTrails | Exclude motion trails. Search for all occurrences
  kExcludeAll | Exclude all listed object types. Search for all occurrences

enum MSceneFilterOption

Search for all occurrences

Render filter options.

Refer to the renderFilterOverride() method for details on usage.

Enumerator:

  kRenderPreSceneUIItems | Render UI items before scene render like grid or user added pre-scene UI items. Search for all occurrences
  kRenderOpaqueShadedItems | Render only opaque shaded objects but not their wireframe or components. Search for all occurrences
  kRenderTransparentShadedItems | Render only transparent shaded objects but not their wireframe or components. Search for all occurrences
  kRenderShadedItems | Render only shaded (opaque and transparent) objects but not their wireframe or components. Search for all occurrences
  kRenderPostSceneUIItems | Render UI items after scene render like wireframe and components for surfaces as well as non-surface objects. Search for all occurrences
  kRenderAllItems | This flag has same meaning as kRenderUIItems and will be deprecated in the future. Render all items. Search for all occurrences

enum MDisplayMode

Search for all occurrences

Display modes.

Enumerator:

  kNoDisplayModeOverride | No display mode override. Search for all occurrences
  kWireFrame | Display wireframe. Search for all occurrences
  kShaded | Display shaded textured. Search for all occurrences
  kDefaultMaterial | Use default material. Only applicable if shaded mode enabled. Search for all occurrences
  kShadedNonTextured | Display shaded non-textured. Search for all occurrences
  kBoundingBox | Display bounding boxes. Search for all occurrences

enum MLightingMode

Search for all occurrences

Lighting mode.

Enumerator:

  kNoLightingModeOverride | No lighting mode override. Search for all occurrences
  kAmbientLight | Use global ambient light. Search for all occurrences
  kLightDefault | Use default light. Search for all occurrences
  kSelectedLights | Use lights which are selected. Search for all occurrences
  kSceneLights | Use all lights in the scene. Search for all occurrences

enum MPostEffectsOverride

Search for all occurrences

Post effect override.

Enumerator:

  kPostEffectDisableNone | Use current render settings options. Search for all occurrences
  kPostEffectDisableSSAO | Disable SSAO post effect. Search for all occurrences
  kPostEffectDisableMotionBlur | Disable motion blur post effect. Search for all occurrences
  kPostEffectDisableDOF | Disable depth-of-field post effect. Search for all occurrences
  kPostEffectDisableAll | Disable all post effects. Search for all occurrences

enum MCullingOption

Search for all occurrences

Culling option.

Enumerator:

  kNoCullingOverride | No culling override. Search for all occurrences
  kCullNone | Don't perform culling. Search for all occurrences
  kCullBackFaces | Cull back faces. Search for all occurrences
  kCullFrontFaces | Cull front faces. Search for all occurrences

## Constructor & Destructor Documentation

MSceneRender | ( | const MString & | name | ) |

Constructor for a named scene render.

A default clear operation is created which will be used for scene rendering. This is a convenience such that separate clear operations do not need to be added before each scene render.

Parameters:

  [in] | name | Name of scene render

## Member Function Documentation

void preRender | ( |  | ) | `[virtual]`

Search for all occurrences

Method to allow for the operation to update itself before being executed.

In general this would be used to update any operation parameters.

No context information is available at this point.

By default this method performs no action.

void postRender | ( |  | ) | `[virtual]`

Search for all occurrences

Method to allow for the operation to clean up itself after being executed.

By default this method performs no action.

void preSceneRender | ( | const MDrawContext & | context | ) | `[virtual]`

Search for all occurrences

Method to allow for the operation to update itself before a scene rendering begins.

This method will be called before computing shadow maps, and before a color pass.

Parameters:

  [in] | context | Draw context before rendering begins

By default this method performs no action.

void postSceneRender | ( | const MDrawContext & | context | ) | `[virtual]`

Search for all occurrences

Method to allow for the operation to update itself after a scene rendering ends.

This method will be called after computing shadow maps, and after a color pass.

Parameters:

  [in] | context | Draw context after rendering has completed

By default this method performs no action.

MSceneRender::MSceneFilterOption renderFilterOverride | ( |  | ) | `[virtual]`

Search for all occurrences

This method allows for the programmer to provide feedback on determining which elements of a scene render will be drawn based on semantic meaning.

For now the only meanings are:

1. To draw non-UI related scene elements
2. To draw UI related scene elements

Non-UI related elements currenty includes rendering surfaces which are shaded. Surfaces are defined as polygonal meshes, subdivision surfaces, and nurbs surfaces.

UI related elements includes drawing the wireframe and component "UI" for the above surface types as well as non-surface items.

A general way to think of the two options is that "non-UI" can be related to drawing a "beauty" pass, and "UI" are decorations on of the "beauty" pass.

We will call these semantic meanings "scene filters" which are enumerated by MSceneRender::MSceneFilterOption.

The default return value is kNoSceneFilterOverride. This indicates that the a scene render will render all scene elements.

Returns:
  A scene filter.

const MCameraOverride * cameraOverride | ( |  | ) | `[virtual]`

Search for all occurrences

Query for a camera override.

The default implementation returns that there is no override.

Returns:
  Reference to the camera override. NULL if there is no override.

const MSelectionList * objectSetOverride | ( |  | ) | `[virtual]`

Search for all occurrences

Query for override for the set of objects to view.

By default NULL is returned which indicates that no override is present.

Returns:
  Pointer to an MSelectionList

const MShaderInstance * shaderOverride | ( |  | ) | `[virtual]`

Search for all occurrences

Query for a scene level shader override.

By default a NULL value is returned which indicates that there is no shader override.

Returns:
  Pointer to an MShaderInstance.

MSceneRender::MObjectTypeExclusions objectTypeExclusions | ( |  | ) | `[virtual]`

Search for all occurrences

Query for any object type exclusions.

By default kExcludeNone is returned meaning to not exclude drawing of any types.

If there has already been an exclusion which is specified, for example via the viewport then those exclusions will still apply.

Returns:
  Object type exclusion

MSceneRender::MDisplayMode displayModeOverride | ( |  | ) | `[virtual]`

Search for all occurrences

Query for any display mode override.

By default kNoDisplayModeOverride is returned indicating that no override is specified.

Returns:
  Display mode override.

MSceneRender::MLightingMode lightModeOverride | ( |  | ) | `[virtual]`

Search for all occurrences

Query for any lighting mode override.

By default kNoLightingModeOverride is returned indicating that no override is specified.

Returns:
  Lighting mode override

const bool * shadowEnableOverride | ( |  | ) | `[virtual]`

Search for all occurrences

Query for shadow display override.

By default a NULL value is returned indicating that no override is specified. To force shadowing off or on, return a pointer to a false or true boolean (respectively).

Returns:
  Pointer to bool indicating the override.

MSceneRender::MPostEffectsOverride postEffectsOverride | ( |  | ) | `[virtual]`

Search for all occurrences

Query for post effects override.

By default MSceneRender::kPostEffectDisableNone is returned which indicates that there is no override.

Returns:
  Override value

MSceneRender::MCullingOption cullingOverride | ( |  | ) | `[virtual]`

Search for all occurrences

Query for a face culling override.

By default kNoCullingOverride is returned indicating that no override is specified.

Returns:
  Culling option override

MClearOperation & clearOperation | ( |  | ) | `[virtual]`

Search for all occurrences

Get the scene clear operation.

Returns:
  The clear operation

bool hasUIDrawables | ( |  | ) | const`[virtual]`

Search for all occurrences

If you've overridden addPreUIDrawables() or addPostUIDrawables() then you must override this method to return true in order for them to have any effect.

You also need to have kRenderPreSceneUIItems or kRenderPostSceneUIItems set in the mask returned by renderFilterOverride().

Returns:
  Whether addPreUIDrawables() or addPostUIDrawables() will be called or not.

void addPreUIDrawables | ( | MUIDrawManager & | drawManager,
|  | const MFrameContext & | frameContext
| ) |  | `[virtual]`

Search for all occurrences

Provides access to the MUIDrawManager, which can be used to queue up operations to draw simple UI shapes like lines, circles, text, etc.

This method will only be called when hasUIDrawables() is overridden to return true and kRenderPreSceneUIItems is set in the MSceneFilterOption mask returned by renderFilterOverride().

UI drawables added in this method will be rendered before the scene render.

Parameters:

  [in] | drawManager | The UI draw manager, it can be used to draw some simple geometry including text.
  [in] | frameContext | Frame level context information

void addPostUIDrawables | ( | MUIDrawManager & | drawManager,
|  | const MFrameContext & | frameContext
| ) |  | `[virtual]`

Search for all occurrences

Provides access to the MUIDrawManager, which can be used to queue up operations to draw simple UI shapes like lines, circles, text, etc.

This method will only be called when hasUIDrawables() is overridden to return true and kRenderPostSceneUIItems is set in the MSceneFilterOption mask returned by renderFilterOverride().

UI drawables added in this method will be rendered after the scene render.

Parameters:

  [in] | drawManager | The UI draw manager, it can be used to draw some simple geometry including text.
  [in] | frameContext | Frame level context information

MSceneRender MSceneRender MSceneRender MSceneRender MSceneRender MSceneRender MSceneRender MSceneRender MSceneRender MSceneRender
MSceneRender MSceneRender MSceneRender MSceneRender MSceneRender MSceneRender MSceneRender MSceneRender MSceneRender MSceneRender