OpenMayaRender.MRenderer Class Reference

Class Description

Main interface class to the Viewport 2.0 renderer
+ Inheritance diagram for OpenMayaRender.MRenderer:

Static Public Member Functions

GPUDeviceHandle ()
 
GPUmaximumPrimitiveCount ()
 
GPUmaximumVertexBufferSize ()
 
activeRenderOverride ()
 
copyTargetToScreen ()
 
deregisterOverride ()
 
disableChangeManagementUntilNextRefresh ()
 
drawAPI ()
 
drawAPIIsOpenGL ()
 
drawAPIVersion ()
 
findRenderOverride ()
 
getFragmentManager ()
 
getRenderTargetManager ()
 
getShaderManager ()
 
getTextureManager ()
 
needEvaluateAllLights ()
 
outputTargetSize ()
 
registerOverride ()
 
render ()
 
renderOverrideCount ()
 
renderOverrideName ()
 
setGeometryDrawDirty ()
 
setLightRequiresShadows ()
 
setLightsAndShadowsDirty ()
 
setRenderOverrideName ()
 

Static Public Attributes

int kA8 = 23
 
int kA8B8G8R8 = 58
 
int kAllDevices = 7
 
int kB5G5R5A1 = 39
 
int kB5G6R5 = 40
 
int kB8G8R8A8 = 55
 
int kB8G8R8X8 = 56
 
int kBC6H_SF16 = 18
 
int kBC6H_UF16 = 17
 
int kBC7_UNORM = 19
 
int kBC7_UNORM_SRGB = 20
 
int kD24S8 = 0
 
int kD24X8 = 1
 
int kD32_FLOAT = 2
 
int kDXT1_UNORM = 5
 
int kDXT1_UNORM_SRGB = 6
 
int kDXT2_UNORM = 7
 
int kDXT2_UNORM_PREALPHA = 9
 
int kDXT2_UNORM_SRGB = 8
 
int kDXT3_UNORM = 10
 
int kDXT3_UNORM_PREALPHA = 12
 
int kDXT3_UNORM_SRGB = 11
 
int kDXT4_SNORM = 14
 
int kDXT4_UNORM = 13
 
int kDXT5_SNORM = 16
 
int kDXT5_UNORM = 15
 
int kDirectX11 = 2
 
int kL16 = 34
 
int kL8 = 28
 
int kNone = 0
 
int kNumberOfRasterFormats = 73
 
int kOpenGL = 1
 
int kOpenGLCoreProfile = 4
 
int kR10G10B10A2_UINT = 54
 
int kR10G10B10A2_UNORM = 53
 
int kR16G16B16A16_FLOAT = 62
 
int kR16G16B16A16_SINT = 66
 
int kR16G16B16A16_SNORM = 64
 
int kR16G16B16A16_UINT = 65
 
int kR16G16B16A16_UNORM = 63
 
int kR16G16_FLOAT = 44
 
int kR16G16_SINT = 48
 
int kR16G16_SNORM = 46
 
int kR16G16_UINT = 47
 
int kR16G16_UNORM = 45
 
int kR16_FLOAT = 29
 
int kR16_SINT = 33
 
int kR16_SNORM = 31
 
int kR16_UINT = 32
 
int kR16_UNORM = 30
 
int kR1_UNORM = 22
 
int kR24G8 = 3
 
int kR24X8 = 4
 
int kR32G32B32A32_FLOAT = 70
 
int kR32G32B32A32_SINT = 72
 
int kR32G32B32A32_UINT = 71
 
int kR32G32B32_FLOAT = 67
 
int kR32G32B32_SINT = 69
 
int kR32G32B32_UINT = 68
 
int kR32G32_FLOAT = 59
 
int kR32G32_SINT = 61
 
int kR32G32_UINT = 60
 
int kR32_FLOAT = 41
 
int kR32_SINT = 43
 
int kR32_UINT = 42
 
int kR8G8B8A8_SINT = 52
 
int kR8G8B8A8_SNORM = 50
 
int kR8G8B8A8_UINT = 51
 
int kR8G8B8A8_UNORM = 49
 
int kR8G8B8X8 = 57
 
int kR8G8_SINT = 38
 
int kR8G8_SNORM = 36
 
int kR8G8_UINT = 37
 
int kR8G8_UNORM = 35
 
int kR8_SINT = 27
 
int kR8_SNORM = 25
 
int kR8_UINT = 26
 
int kR8_UNORM = 24
 
int kR9G9B9E5_FLOAT = 21
 

Member Function Documentation

OpenMayaRender.MRenderer.activeRenderOverride ( )
static
activeRenderOverride() -> string

Returns the name of the active override.
OpenMayaRender.MRenderer.copyTargetToScreen ( )
static
copyTargetToScreen(MRenderTarget) -> bool

Copy a render target to the screen.
If the target's dimensions are not the same as the active viewport it will be scaled up or down as necessary to fill the entire viewport.
OpenMayaRender.MRenderer.deregisterOverride ( )
static
deregisterOverride(MRenderOverride) -> None

Deregister an existing render override on the renderer.
The renderer will remove this override from it's list of registered overrides.
OpenMayaRender.MRenderer.disableChangeManagementUntilNextRefresh ( )
static
disableChangeManagementUntilNextRefresh() -> None

Calling this method will cause Viewport 2.0 to stop processing all changes to the Maya scene until the next viewport refresh.
OpenMayaRender.MRenderer.drawAPI ( )
static
drawAPI() -> int

Returns the current drawing API. Returns 'kNone' if the renderer is not initialized.

  MRenderer.kNone          Uninitialized device
  MRenderer.kOpenGL        OpenGL
  MRenderer.kDirectX11     Direct X 11
  MRenderer.kAllDevices    All : OpenGL and Direct X 11
OpenMayaRender.MRenderer.drawAPIIsOpenGL ( )
static
drawAPIIsOpenGL() -> bool

Returns whether the current drawing API is OpenGL or not
OpenMayaRender.MRenderer.drawAPIVersion ( )
static
drawAPIVersion() -> int

Returns the version of drawing API.
OpenMayaRender.MRenderer.findRenderOverride ( )
static
findRenderOverride(string) -> MRenderOverride

Returns a reference to an existing render override registered with the renderer.
OpenMayaRender.MRenderer.getFragmentManager ( )
static
getFragmentManager() -> MFragmentManager

Returns the fragment manager or None if the renderer is not initialized properly.
OpenMayaRender.MRenderer.getRenderTargetManager ( )
static
getRenderTargetManager() -> MRenderTargetManager

Returns the render target manager or None if the renderer is not initialized properly.
OpenMayaRender.MRenderer.getShaderManager ( )
static
getShaderManager() -> MShaderManager

Returns the shader manager or None if the renderer is not initialized properly.
OpenMayaRender.MRenderer.getTextureManager ( )
static
getTextureManager() -> MTextureManager

Returns the texture manager or None if the renderer is not initialized properly.
OpenMayaRender.MRenderer.GPUDeviceHandle ( )
static
GPUDeviceHandle() -> long

Returns a long containing a C++ 'void' pointer which points to the GPU "device".In the case that the drawing API is OpenGL then the "device" is a handle to an OpenGL context.
In the case that the drawing API is DirectX then the "device" is a pointer to a DirectX device.
OpenMayaRender.MRenderer.GPUmaximumPrimitiveCount ( )
static
GPUmaximumPrimitiveCount() -> int

Returns the maximum number of primitives that can be drawn per draw call by the GPU device.
0 if device has not been initialized.
OpenMayaRender.MRenderer.GPUmaximumVertexBufferSize ( )
static
GPUmaximumVertexBufferSize() -> int

Returns the maximum number of vertices allowed in a vertex buffer by the GPU device.
0 if device has not been initialized.
OpenMayaRender.MRenderer.needEvaluateAllLights ( )
static
needEvaluateAllLights() -> None

Notify the Viewport 2.0 renderer that it should evaluate all lights marked dirty, regardless of the light limit.For example, if there are 8 lights accessible because of the Viewport 2.0 light limit option, Only the first 8 non-ambient lights created will be evaluated.Call this method to instruct Viewport 2.0 to evaluate all dirty lights regardless of the light limit option.

Note that this method does NOT perform any DG evaluation when it is called.The actual evaluation does not occur until the next viewport refresh. This method is threadsafe. The viewport refresh will occur asynchronously.Multiple calls to this method will get merged.

Call this method may decrease performance in Viewport 2.0 during the next viewport refresh.Once this method is called, all unused lights that are marked dirty will be evaluated in the next viewport refresh.

An example application of this method is to obtain light information while ignoring the light limit.If this method is not called, information on unused lights cannot be obtained via MDrawContext, even if LightFilter is set to kFilteredToLightLimit.This is because unused lights are not evaluated automatically by Viewport 2.0 by default.
OpenMayaRender.MRenderer.outputTargetSize ( )
static
outputTargetSize() -> [int, int]

Get target size in format [width, height].
OpenMayaRender.MRenderer.registerOverride ( )
static
registerOverride(MRenderOverride) -> None

Register the override as being usable by the renderer.
If the override is already registered it will not be registered again.
OpenMayaRender.MRenderer.render ( )
static
render(sourceName, targetList) -> bool

Render images from a panel to render targets.
return True if render operation was successful.
* sourceName (string) - The name of the source view want to render. 
* targetList (PyListObject:MRenderTarget) - Render target list want to render into.
OpenMayaRender.MRenderer.renderOverrideCount ( )
static
renderOverrideCount() -> int

Returns the number of registered render overrides.
OpenMayaRender.MRenderer.renderOverrideName ( )
static
renderOverrideName() -> string

Get the current render override name used for batch rendering.
If there is no override then an empty string will be returned.
OpenMayaRender.MRenderer.setGeometryDrawDirty ( )
static
setGeometryDrawDirty(object, topologyChanged=True) -> None

Notify the Viewport 2.0 renderer that the geometry (size, shape, etc.) of object has changed, causing the object to be updated in the viewport.

* object (MObject) - DAG object which has been modified.
* topologyChanged (bool) - has the object topology changed
OpenMayaRender.MRenderer.setLightRequiresShadows ( )
static
setLightRequiresShadows(object, flag) -> bool

This method allows for plug-in writers to indicate that the shadow map contents for a given light are required, regardless of the light limit.
Returns True if the method added or removed the request successfully.

* object (MObject) - Light to request shadow update for
* flag (bool) - Indicate if an update is requested. When set to true a request is added, and when set false any existing request is removed.
OpenMayaRender.MRenderer.setLightsAndShadowsDirty ( )
static
setLightsAndShadowsDirty() -> None

Notify the Viewport 2.0 renderer that something has changed which requires re-evaluation of lighting and shadows.
OpenMayaRender.MRenderer.setRenderOverrideName ( )
static
setRenderOverrideName(string) -> bool

Set the name of a render override (MRenderOverride) for batch rendering.