Python API 2.0 Reference
|
Static Public Member Functions | |
def | GPUDeviceHandle () |
def | GPUmaximumPrimitiveCount () |
def | GPUmaximumVertexBufferSize () |
def | activeRenderOverride () |
def | copyTargetToScreen () |
def | deregisterOverride () |
def | disableChangeManagementUntilNextRefresh () |
def | drawAPI () |
def | drawAPIIsOpenGL () |
def | drawAPIVersion () |
def | findRenderOverride () |
def | getFragmentManager () |
def | getRenderTargetManager () |
def | getShaderManager () |
def | getTextureManager () |
def | needEvaluateAllLights () |
def | outputTargetSize () |
def | registerOverride () |
def | render () |
def | renderOverrideCount () |
def | renderOverrideName () |
def | setGeometryDrawDirty () |
def | setLightRequiresShadows () |
def | setLightsAndShadowsDirty () |
def | setRenderOverrideName () |
Main interface class to the Viewport 2.0 renderer
|
static |
activeRenderOverride() -> string Returns the name of the active override.
|
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.
|
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.
|
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.
|
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
|
static |
drawAPIIsOpenGL() -> bool Returns whether the current drawing API is OpenGL or not
|
static |
drawAPIVersion() -> int Returns the version of drawing API.
|
static |
findRenderOverride(string) -> MRenderOverride Returns a reference to an existing render override registered with the renderer.
|
static |
getFragmentManager() -> MFragmentManager Returns the fragment manager or None if the renderer is not initialized properly.
|
static |
getRenderTargetManager() -> MRenderTargetManager Returns the render target manager or None if the renderer is not initialized properly.
|
static |
getShaderManager() -> MShaderManager Returns the shader manager or None if the renderer is not initialized properly.
|
static |
getTextureManager() -> MTextureManager Returns the texture manager or None if the renderer is not initialized properly.
|
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.
|
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.
|
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.
|
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.
|
static |
outputTargetSize() -> [int, int] Get target size in format [width, height].
|
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.
|
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.
|
static |
renderOverrideCount() -> int Returns the number of registered render overrides.
|
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.
|
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
|
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.
|
static |
setLightsAndShadowsDirty() -> None Notify the Viewport 2.0 renderer that something has changed which requires re-evaluation of lighting and shadows.
|
static |
setRenderOverrideName(string) -> bool Set the name of a render override (MRenderOverride) for batch rendering.