Python API 2.0 Reference
|
Public Member Functions | |
def | __init__ () |
def | classificationExclusions () |
def | getBackgroundParameters () |
def | getCurrentCameraPath () |
def | getCurrentColorRenderTarget () |
def | getCurrentDepthRenderTarget () |
def | getDOFParameters () |
def | getDisplayStyle () |
def | getEnvironmentParameters () |
def | getGlobalLineWidth () |
def | getHwFogParameters () |
def | getLightLimit () |
def | getLightingMode () |
def | getMatrix () |
def | getPostEffectEnabled () |
def | getRenderOverrideInformation () |
def | getTransparencyAlgorithm () |
def | getTuple () |
def | getViewportDimensions () |
def | objectTypeExclusions () |
def | renderingDestination () |
Static Public Member Functions | |
def | __new__ () |
def | inUserInteraction () |
def | semanticToMatrixType () |
def | semanticToTupleType () |
def | shadeTemplates () |
def | userChangingViewContext () |
def | wireOnShadedMode () |
This class contains some global information for the current render frame.
def OpenMayaRender.MFrameContext.__init__ | ( | ) |
Initialize self. See help(type(self)) for accurate signature.
|
static |
Create and return a new object. See help(type) for accurate signature.
def OpenMayaRender.MFrameContext.classificationExclusions | ( | ) |
classificationExclusions() -> [classification strings] Get a list of drawdb strings for object which are excluded from display
def OpenMayaRender.MFrameContext.getBackgroundParameters | ( | ) |
getBackgroundParameters() -> [displayGradient, clearColorFlag, clearDepthFlag, clearStencilFlag, clearColor1, clearColor2, clearDepthValue, clearStencilValue] Get parameters related to how the background is cleared
def OpenMayaRender.MFrameContext.getCurrentCameraPath | ( | ) |
getCurrentCameraPath() -> MDagPath Get the path to the camera being used to render the current frame.
def OpenMayaRender.MFrameContext.getCurrentColorRenderTarget | ( | ) |
getCurrentColorRenderTarget() -> MRenderTarget Get current color render target. Calling code is responsible for invoking MRenderTargetManager::releaseRenderTarget() to release the reference to the target after use.
def OpenMayaRender.MFrameContext.getCurrentDepthRenderTarget | ( | ) |
getCurrentDepthRenderTarget() -> MRenderTarget Get current depth render target. Calling code is responsible for invoking MRenderTargetManager::releaseRenderTarget() to release the reference to the target after use.
def OpenMayaRender.MFrameContext.getDisplayStyle | ( | ) |
getDisplayStyle() -> int The DisplayStyle enums can be use to test the bit field for the enabling of any of the listed display modes. For example to test for wireframe on shaded the test would be test against the bit for kGourandShaded or kFlatShaded as well as testing against the bit for kWireframe. MFrameContext.kGouraudShaded Shaded display. MFrameContext.kWireFrame Wire frame display. MFrameContext.kBoundingBox Bounding box display. MFrameContext.kTextured Textured display. MFrameContext.kDefaultMaterial Default material display. MFrameContext.kXrayJoint X-ray joint display. MFrameContext.kXray X-ray display. MFrameContext.kTwoSidedLighting Two-sided lighting enabled. MFrameContext.kFlatShaded Flat shading display. MFrameContext.kShadeActiveOnly Shade active object only. MFrameContext.kXrayActiveComponents X-ray active components. MFrameContext.kBackfaceCulling Backface culling enabled. MFrameContext.kSmoothWireframe Smooth wireframe enabled.
def OpenMayaRender.MFrameContext.getDOFParameters | ( | ) |
getDOFParameters() -> [enabled, focalDistance, alpha] Get the parameters generated by Maya for the circle-of-confusion depth shader used for a pass used when computing depth of field. This pass is indicated by the pass semantic MPassContext::kDOFPassSemantic. The shader fragment used is called cocDepthSurface. The XML wrapper can be queried from MFragmentManager or using the 'ogs -xml maya_CocDepthSurface' command.
def OpenMayaRender.MFrameContext.getEnvironmentParameters | ( | ) |
getEnvironmentParameters() -> [bool, string] Get parameters for currently used environment. Note that this information is set per viewport and so might change between draw calls if multiple viewports are displayed at the same time. Return the destination (type and name) that the renderer is drawing to.
def OpenMayaRender.MFrameContext.getGlobalLineWidth | ( | ) |
getGlobalLineWidth() -> float Get global line width.
def OpenMayaRender.MFrameContext.getHwFogParameters | ( | ) |
getHwFogParameters() -> [enabled, mode, start, end, density, color] Get all the hardware fog parameters. Hardware fog parameters include: - hardware fog enabled - hardware fog mode: Linear, Exponential, Exponential squared. The possible values are: MFrameContext::kFogLinear : Linear fog MFrameContext::kFogExp : Exponential fog MFrameContext::kFogExp2 : Exponential squared fog - hardware fog start: The near distance used in the linear fog. - hardware fog end: The far distance used in the linear fog. - hardware fog density: The density of the exponential fog. - hardware fog color: (r, g, b, a).
def OpenMayaRender.MFrameContext.getLightingMode | ( | ) |
getLightingMode() -> int Get the current light mode. MFrameContext.kNoLighting Use no light MFrameContext.kAmbientLight Use global ambient light MFrameContext.kLightDefault Use default light MFrameContext.kSelectedLights Use lights which are selected MFrameContext.kSceneLights Use all lights in the scene MFrameContext.kCustomLights Use a custom set of lights which are not part of the scene. Currently this applies for use in the Hypershade Material Viewer panel
def OpenMayaRender.MFrameContext.getLightLimit | ( | ) |
getLightLimit() -> int Get the current light limit.
def OpenMayaRender.MFrameContext.getMatrix | ( | ) |
getMatrix(int) -> MMatrix Get a matrix value of a certain type. Note that not all types are available for querying in MFrameContext. Return None if matrix type not available from MFrameContext. For a list of matrix type, see MDrawContext.semanticToMatrixType() description.
def OpenMayaRender.MFrameContext.getPostEffectEnabled | ( | ) |
getPostEffectEnabled(int) -> bool Returns if a given post effect is currently enabled. MFrameContext.kAmbientOcclusion Screen-space ambient occlusion MFrameContext.kMotionBlur 2D Motion blur MFrameContext.kGammaCorrection Gamma correction MFrameContext.kDepthOfField Depth of field MFrameContext.kAntiAliasing Hardware multi-sampling
def OpenMayaRender.MFrameContext.getRenderOverrideInformation | ( | ) |
getRenderOverrideInformation() -> [overrideName] Get information about any render override
def OpenMayaRender.MFrameContext.getTransparencyAlgorithm | ( | ) |
getTransparencyAlgorithm() -> int Get the current transparency algoritm. MFrameContext.kUnsorted Unsorted transparent object drawing MFrameContext.kObjectSorting Object sorting of transparent objects MFrameContext.kWeightedAverage Weight average transparency MFrameContext.kDepthPeeling Depth-peel transparency
def OpenMayaRender.MFrameContext.getTuple | ( | ) |
getTuple(int) -> MDoubleArray Get a tuple (vector, position or single) value of a certain type. Note that not all types are available for querying in MFrameContext. Return None if unknown tuple type.
def OpenMayaRender.MFrameContext.getViewportDimensions | ( | ) |
getViewportDimensions() -> [originX, originY, width, height] Get the viewport dimensions. The origin is the upper left corner of the viewport.
|
static |
inUserInteraction() -> bool Returns True during any interactive refresh, as when user is interacting with the scene in any way including camera changes, object or component TRS changes, etc.
def OpenMayaRender.MFrameContext.objectTypeExclusions | ( | ) |
objectTypeExclusions() -> long Get the object type exclusions as a bitfield. The bitfield can be tested using the bits defined by class statics starting with kExclude.
def OpenMayaRender.MFrameContext.renderingDestination | ( | ) |
renderingDestination() -> [int, destinationName] Return the destination (type and name) that the renderer is drawing to. MFrameContext.k3dViewport Rendering to an interactive 3d viewport MFrameContext.k2dViewport Rendering to an interactive 2d viewport such as the render view MFrameContext.kImage Rendering to an image
|
static |
semanticToMatrixType(string) -> int Given a semantic name return the corresponding matrix enumeration that can be used to retrieve a matrix value via the getMatrix() method. MFrameContext.kWorldMtx Object to world matrix MFrameContext.kWorldTransposeMtx Object to world matrix transpose MFrameContext.kWorldInverseMtx Object to world matrix inverse MFrameContext.kWorldTranspInverseMtx Object to world matrix transpose inverse (adjoint) MFrameContext.kViewMtx World to view matrix MFrameContext.kViewTransposeMtx World to view matrix tranpose MFrameContext.kViewInverseMtx World to view matrix inverse MFrameContext.kViewTranspInverseMtx World to view matrix transpose inverse (adjoint) MFrameContext.kProjectionMtx Projection matrix MFrameContext.kProjectionTranposeMtx Projection matrix tranpose MFrameContext.kProjectionInverseMtx Projection matrix inverse MFrameContext.kProjectionTranspInverseMtx Projection matrix tranpose inverse (adjoint) MFrameContext.kViewProjMtx View * projection matrix MFrameContext.kViewProjTranposeMtx View * projection matrix tranpose MFrameContext.kViewProjInverseMtx View * projection matrix inverse MFrameContext.kViewProjTranspInverseMtx View * projection matrix tranpose inverse (adjoint) MFrameContext.kWorldViewMtx World * view matrix MFrameContext.kWorldViewTransposeMtx World * view matrix transpose MFrameContext.kWorldViewInverseMtx World * view matrix inverse MFrameContext.kWorldViewTranspInverseMtx World * view matrix transpose inverse (adjoint) MFrameContext.kWorldViewProjMtx World * view * projection matrix MFrameContext.kWorldViewProjTransposeMtx World * view * projection matrix transpose MFrameContext.kWorldViewProjInverseMtx World * view * projection matrix inverse MFrameContext.kWorldViewProjTranspInverseMtx World * view * projection matrix tranpose inverse (adjoint)
|
static |
semanticToTupleType(string) -> int Given a semantic name return the corresponding tuple enumeration that can be used to retrieve a value via the getTuple() method. MFrameContext.kViewPosition View position MFrameContext.kViewDirection View direction vector MFrameContext.kViewUp View up vector MFrameContext.kViewRight View right vector MFrameContext.kViewportPixelSize Viewport size in pixels (single value) MFrameContext.kViewNearClipValue Camera near clip value (single value) MFrameContext.kViewFarClipValue Camera far clip value (single value) MFrameContext.kViewUnnormlizedNearClipValue Unnormalized camera near clip value (single value) MFrameContext.kViewUnnormalizedFarClipValue Unnormalized camera far clip value (single value)
|
static |
shadeTemplates() -> bool Returns the display preference indicating whether templated objects should be drawn shaded.
|
static |
userChangingViewContext() -> bool Returns True during any interactive refresh, as when user is changing the view using view context tools such as tumble, dolly or track.
|
static |
wireOnShadedMode() -> int Returns the global user display preference which indicates how wireframe should be drawn on top of objects while in shaded mode. Please refer to documentation on the 'Wireframe-on-shaded' option under the 'Display->View' tab in the preferences window. Note that 'viewport in wireframe on shaded mode' is a different option which is per viewport. This can be tested by testing if a shaded mode is set as well as wireframe mode. Refer to the enumerations DisplayStyle and the method getDisplayStyle(). MFrameContext.kWireframeOnShadedFull Draw wireframe MFrameContext.kWireFrameOnShadedReduced Draw wireframe but with reduced quality MFrameContext.kWireFrameOnShadedNone Do not draw wireframe