This reference page is linked to from the following overview topics: Autodesk Maya 2014, 3.7 Sub-scene Overrides, 3.9 UI draw manager, 4.4 Effects interfaces.
This class contains some global information for the current render frame.
MFrameContext is designed to provide information which is available per frame render. This includes information such as render targets, viewport size and camera information.
In terms of relative scope, MFrameContext can be thought of as encompassing the time period for a "pass" (MPassContext) and the time period for actual drawing (MDrawContext).
MDrawContext is derived from MFrameContext and provides its own implementation for all virtual methods. The values returned from these methods may differ slightly between MFrameContext and MDrawContext as MFrameContext retrieves the values from Maya and MDrawContext retrieves the values from the GPU device state. Also, MFrameContext::getMatrix() is not able to return values for any matrix type requiring the object-to-world matrix as that information is only available at draw time.
#include <MFrameContext.h>

Public Types | |
| enum | MatrixType { kWorldMtx, kWorldTransposeMtx, kWorldInverseMtx, kWorldTranspInverseMtx, kViewMtx, kViewTransposeMtx, kViewInverseMtx, kViewTranspInverseMtx, kProjectionMtx, kProjectionTranposeMtx, kProjectionInverseMtx, kProjectionTranspInverseMtx, kViewProjMtx, kViewProjTranposeMtx, kViewProjInverseMtx, kViewProjTranspInverseMtx, kWorldViewMtx, kWorldViewTransposeMtx, kWorldViewInverseMtx, kWorldViewTranspInverseMtx, kWorldViewProjMtx, kWorldViewProjTransposeMtx, kWorldViewProjInverseMtx, kWorldViewProjTranspInverseMtx } |
Matrices that can be accessed. More... | |
| enum | TupleType { kViewPosition, kViewDirection, kViewUp, kViewRight, kViewportPixelSize } |
Vectors or positions that can be accessed. More... | |
| enum | DisplayStyle { kGouraudShaded = (0x1), kWireFrame = (0x1 << 1), kBoundingBox = (0x1 << 2), kTextured = (0x1 << 3), kDefaultMaterial = (0x1 << 4), kXrayJoint = (0x1 << 5), kXray = (0x1 << 6), kTwoSidedLighting = (0x1 << 7) } |
Display styles. More... | |
| enum | LightingMode { kAmbientLight, kLightDefault, kSelectedLights, kSceneLights } |
Lighting modes. More... | |
| enum | PostEffectType { kAmbientOcclusion, kMotionBlur, kGammaCorrection, kDepthOfField, kAntiAliasing } |
Types of post effects which may be enabled during rendering. More... | |
| enum | TransparencyAlgorithm { kUnsorted = 0, kObjectSorting, kWeightedAverage, kDepthPeeling } |
Options for transparency algorithm. More... | |
Public Member Functions | |
| virtual MMatrix | getMatrix (MFrameContext::MatrixType mtype, MStatus *ReturnStatus=NULL) const |
| Get a matrix value of a certain type. | |
| virtual MDoubleArray | getTuple (MFrameContext::TupleType ttype, MStatus *ReturnStatus=NULL) const |
| Get a tuple (vector or position) value of a certain type. | |
| virtual MStatus | getViewportDimensions (int &originX, int &originY, int &width, int &height) const |
| Get the viewport dimensions. | |
| virtual float | getGlobalLineWidth () const |
| Get global line width. | |
| const MRenderTarget * | getCurrentColorRenderTarget () const |
| Get current color render target. | |
| const MRenderTarget * | getCurrentDepthRenderTarget () const |
| Get current depth render target. | |
| unsigned int | getDisplayStyle () const |
| Get the current display style as a bit field. | |
| LightingMode | getLightingMode () const |
| Get the current light mode. | |
| unsigned int | getLightLimit () const |
| Get the current light limit. | |
| bool | getPostEffectEnabled (PostEffectType postEffectType) const |
| Returns if a given post effect is currently enabled. | |
| TransparencyAlgorithm | getTransparencyAlgorithm () const |
| Get the current transparency algoritm. | |
Static Public Member Functions | |
| static MFrameContext::MatrixType | semanticToMatrixType (const MString &value, MStatus *ReturnStatus=NULL) |
| Given a semantic name return the corresponding matrix enumeration that can be used to retrieve a matrix value via the getMatrix() method. | |
| static MFrameContext::TupleType | semanticToTupleType (const MString &value, MStatus *ReturnStatus=NULL) |
| Given a semantic name return the corresponding tuple enumeration that can be used to retrieve a value via the getTuple() method. | |
| static const char * | className () |
| Returns the name of this class. | |
| enum MatrixType |
Matrices that can be accessed.
| enum TupleType |
Vectors or positions that can be accessed.
| enum DisplayStyle |
Display styles.
| enum LightingMode |
Lighting modes.
| enum PostEffectType |
Types of post effects which may be enabled during rendering.
Options for transparency algorithm.
| MFrameContext::MatrixType semanticToMatrixType | ( | const MString & | value, |
| MStatus * | ReturnStatus = NULL |
||
| ) | [static] |
Given a semantic name return the corresponding matrix enumeration that can be used to retrieve a matrix value via the getMatrix() method.
Valid semantic names include:
| [in] | value | Semantic name |
| [out] | ReturnStatus | return status |
| MMatrix getMatrix | ( | MFrameContext::MatrixType | mtype, |
| MStatus * | ReturnStatus = NULL |
||
| ) | const [virtual] |
Get a matrix value of a certain type.
Note that not all types are available for querying in MFrameContext. Matrix types requiring the object-to-world matrix, are only available from MDrawContext.
| [in] | mtype | Type of matrix to return |
| [out] | ReturnStatus | Return status |
Reimplemented in MDrawContext.
| MFrameContext::TupleType semanticToTupleType | ( | const MString & | value, |
| MStatus * | ReturnStatus = NULL |
||
| ) | [static] |
Given a semantic name return the corresponding tuple enumeration that can be used to retrieve a value via the getTuple() method.
Valid semantic names include:
| [in] | value | Semantic name |
| [out] | ReturnStatus | Return status |
| MDoubleArray getTuple | ( | MFrameContext::TupleType | ttype, |
| MStatus * | ReturnStatus = NULL |
||
| ) | const [virtual] |
Get a tuple (vector or position) value of a certain type.
| [in] | ttype | Type of vector or position to return |
| [out] | ReturnStatus | Return status |
Reimplemented in MDrawContext.
| MStatus getViewportDimensions | ( | int & | originX, |
| int & | originY, | ||
| int & | width, | ||
| int & | height | ||
| ) | const [virtual] |
Get the viewport dimensions.
The origin is the upper left corner of the viewport.
| [out] | originX | X coordinate of the viewport origin |
| [out] | originY | Y coordinate of the viewport origin |
| [out] | width | Width of the viewport |
| [out] | height | Height of the viewport |
Reimplemented in MDrawContext.
| float getGlobalLineWidth | ( | ) | const [virtual] |
| const MRenderTarget * getCurrentColorRenderTarget | ( | ) | const |
Get current color render target.
Calling code is responsible for invoking MRenderTargetManager::releaseRenderTarget() to release the reference to the target after use.
| const MRenderTarget * getCurrentDepthRenderTarget | ( | ) | const |
Get current depth render target.
Calling code is responsible for invoking MRenderTargetManager::releaseRenderTarget() to release the reference to the target after use.
| unsigned int getDisplayStyle | ( | ) | const |
Get the current display style as a bit field.
| MFrameContext::LightingMode getLightingMode | ( | ) | const |
| unsigned int getLightLimit | ( | ) | const |
| bool getPostEffectEnabled | ( | PostEffectType | postEffectType | ) | const |
Returns if a given post effect is currently enabled.
| [in] | postEffectType | Type of post effect to query |
| MFrameContext::TransparencyAlgorithm getTransparencyAlgorithm | ( | ) | const |
Get the current transparency algoritm.
See the TransparencyAlgorithm enum for possible return values.
| const char * className | ( | ) | [static] |