MSceneRender Class Reference

This reference page is linked to from the following overview topics: Extension for Autodesk Maya 2013, Rendering Overrides, 3.6 Render Loop Overrides, 4.2 Lighting Interfaces.



Detailed Description

Class which defines a scene render.

#include <MViewport2Renderer.h>

Inheritance diagram for MSceneRender:

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 { ,
  kRenderOpaqueShadedItems = 1 << (0), kRenderTransparentShadedItems = 1 << (1), kRenderShadedItems = (kRenderOpaqueShadedItems | kRenderTransparentShadedItems), kRenderNonShadedItems = 1 << (2),
  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  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 operation to update itself before being executed.
virtual void postRender ()
 Method to allow for operation to clean up itself after being executed.
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 MCameraOverridecameraOverride ()
 Query for a camera override.
virtual const MSelectionListobjectSetOverride ()
 Query for override for the set of objects to view.
virtual const MShaderInstanceshaderOverride ()
 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 MCullingOption cullingOverride ()
 Query for a face culling override.
virtual MClearOperationclearOperation ()
 Get the scene clear operation.

Member Enumeration Documentation

Object type exclusions.

Enumerator:
kExcludeNone 

Exclude no object types.

kExcludeNurbsCurves 

Exclude NURBS curves.

kExcludeNurbsSurfaces 

Exclude NURBS surface.

kExcludeMeshes 

Exclude polygonal meshes.

kExcludePlanes 

Exclude planes.

kExcludeLights 

Exclude lights.

kExcludeCameras 

Exclude camera.

kExcludeJoints 

Exclude joints.

kExcludeIkHandles 

Exclude IK handles.

kExcludeDeformers 

Exclude all deformations.

kExcludeDynamics 

Exclude all dynamics objects (emiiters, cloth)

kExcludeLocators 

Exclude locators.

kExcludeDimensions 

Exclude all measurement objects.

kExcludeSelectHandles 

Exclude selection handles.

kExcludePivots 

Exclude pivots.

kExcludeTextures 

Exclude texure placement objects.

kExcludeGrid 

Exclude grid drawing.

kExcludeCVs 

Exclude NURBS control vertices.

kExcludeHulls 

Exclude NURBS hulls.

kExcludeStrokes 

Exclude PaintFX strokes.

kExcludeSubdivSurfaces 

Exclude subdivision surfaces.

kExcludeFluids 

Exclude fluid objects.

kExcludeFollicles 

Exclude hair follicles.

kExcludeHairSystems 

Exclude hair system.

kExcludeImagePlane 

Exclude image planes.

kExcludeNCloths 

Exclude N-cloth objects.

kExcludeNRigids 

Exclude rigid-body objects.

kExcludeDynamicConstraints 

Exclude rigid-body constraints.

kExcludeManipulators 

Exclude manipulators.

kExcludeNParticles 

Exclude N-particle objects.

kExcludeMotionTrails 

Exclude motion trails.

kExcludeAll 

Exclude all listed object types.

Render filter options.

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

Enumerator:
kRenderOpaqueShadedItems 

Render only opaque shaded objects but not their wireframe or components.

kRenderTransparentShadedItems 

Render only transparent shaded objects but not their wireframe or components.

kRenderShadedItems 

Render only shaded (opaque and transparent) objects but not their wireframe or components.

kRenderNonShadedItems 

Render wireframe and components for surfaces as well as non-surface objects.

kRenderAllItems 

Render all items.

Display modes.

Enumerator:
kNoDisplayModeOverride 

No display mode override.

kWireFrame 

Display wireframe.

kShaded 

Display shaded textured.

kDefaultMaterial 

Use default material.

Only applicable if shaded mode enabled.

kShadedNonTextured 

Display shaded non-textured.

kBoundingBox 

Display bounding boxes.

Lighting mode.

Enumerator:
kNoLightingModeOverride 

No lighting mode override.

kAmbientLight 

Use global ambient light.

kLightDefault 

Use default light.

kSelectedLights 

Use lights which are selected.

kSceneLights 

Use all lights in the scene.

Culling option.

Enumerator:
kNoCullingOverride 

No culling override.

kCullNone 

Don't perform culling.

kCullBackFaces 

Cull back faces.

kCullFrontFaces 

Cull front faces.


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]nameName of scene render

Member Function Documentation

void preRender ( ) [virtual]

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

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

The default operation performs no action.

void postRender ( ) [virtual]

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

The default operation performs no action.

MSceneRender::MSceneFilterOption renderFilterOverride ( ) [virtual]

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]

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]

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]

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]

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]

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]

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]

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::MCullingOption cullingOverride ( ) [virtual]

Query for a face culling override.

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

Returns:
Culling option override
MClearOperation & clearOperation ( ) [virtual]

Get the scene clear operation.

Returns:
The clear operation

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