- Main Page
- Related Pages
- Modules
- Classes
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Static Public Member Functions

# MPx3dModelView Class Reference
OpenMayaUI - API module for user interface | Proxy classes

This reference page is linked to from the following overview topics: レンダリング オーバーライド(Rendering Overrides), 移行ガイド, サンプル スクリプト プラグイン.

Search for all occurrences

## Detailed Description

3d Model View

MPx3dModelView is the class for user defined model views. The MPx3dModelView class works with the MPxModelEditorCommand class to create a user defined model editor that may be used in a window or in a scripted panel. When registering the model editor with the MFnPlugin::registerModelEditorCommand() method, an appropriate MPx3dModelView::creator() method is required. This class works for interactive Maya views and is not designed for rendering.

One of the interesting uses of a MPx3dModelView is that it allows multiple cameras to be drawn into the same window. Like a normal model view, this view has a main camera associated with it. This camera is obtained with the getCamera() method and is the camera used for manipulations and selection.

To setup a multiple camera draw, first the number of passes must be set by an overloaded multipleDrawPassCount() method. The preMultipleDraw() method allows any setup to be performed. The preMultipleDrawPass(unsigned int) is called for each pass, with the argument indicating which pass is currently being used. The camera for the specific pass may be set with the setCameraInDraw() method. The postMultipleDrawPass(unsigned int) method is called after the drawing for the indicated pass is complete. Finally any cleanup may be done with the postMultipleDraw() method.

During the drawing, a filter exists to determine which items should be drawn. The okForMultipleDraw(MdagPath &) allows filtering of what should be drawn. Another approach which is faster is to tuen on the view selected mode (setViewSelected()) and use the setObjectsToView() or viewSelectedSet() to specify which items should be drawn. These values may be set per pass so that each camera has control over what gets drawn.

Examples:

  narrowPolyViewer.cpp, narrowPolyViewer.h, narrowPolyViewerCmd.cpp, and narrowPolyViewerCmd.h.

`#include <MPx3dModelView.h>`

List of all members.

## Public Types
enum | LightingMode { kLightAll, kLightSelected, kLightActive, kLightDefault, kLightNone, kLightQuality }
| Lighting mode used in this view. More...
enum | FogSource { kFogFragment, kFogCoordinate }
| Fog computation modes. More...
enum | FogMode { kFogLinear, kFogExponential, kFogExponentialSquared }
| Drop-off modes for fog. More...
## Public Member Functions
| MPx3dModelView ()
| class constructor
virtual | ~MPx3dModelView ()
| class destructor
MString | name (MStatus *ReturnStatus=NULL) const
| Returns the name of the view.
virtual MString | viewType () const
| Returns a string specifying the view type.
virtual void | preMultipleDraw ()
| This method is called before any drawing is performed in the model view.
virtual void | postMultipleDraw ()
| This method is called after the drawing is finished.
virtual void | preMultipleDrawPass (unsigned int index)
| This method is called immediately before a specific pass is about to be drawn.
virtual void | postMultipleDrawPass (unsigned int index)
| This method is called when a specified pass is finshed.
virtual bool | okForMultipleDraw (const MDagPath &)
| This method provides some filter capabilities as to what is drawn.
virtual unsigned int | multipleDrawPassCount ()
| This method returns the number of multiple draw passes that are going to be made.
bool | multipleDrawEnabled () const
| This method returns the multiple draw enable state for this view.
void | setMultipleDrawEnable (bool enable)
| This method turns enables/disables multiple camera drawing for this view.
bool | destroyOnPanelDestruction () const
| This method queries the destruction setting for this MPx3dModelView which is employed when the panel associated with this view is destroyed.
void | setDestroyOnPanelDestruction (bool how)
| This method enables/disables destruction of the MPx3dModelView object when the panel is destroyed.
MStatus | updateViewingParameters ()
| This method tells the camera to set the view's transformation matrix.
virtual void | removingCamera (MDagPath &cameraPath)
| This method should be overloaded in MPx3dModelView derived classes.
MStatus | setDoUpdateOnMove (bool value)
| Some viewports require a refresh when the user has moved the top level window.
bool | doUpdateOnMove (MStatus *ReturnStatus=NULL) const
| Returns the state of the doUpdateOnMove flag.
MStatus | refresh (bool all=false, bool force=false)
| Refresh the this view.
MStatus | drawText (const MString &text, const MPoint position, M3dView::TextPosition textPosition=M3dView::kLeft)
| Draws the given text at the given spot in the default font.
MStatus | beginGL ()
| Setup port for native OpenGL drawing calls.
MStatus | endGL ()
| End OpenGL drawing.
MStatus | setCameraInDraw (MDagPath &camera)
| Sets the camera during a draw.
MStatus | setDrawCameraOverride (const MMatrix &worldMatrix, const MMatrix &projectionMatrix, double left, double right, double bottom, double top, double nearpt, double farpt, bool isOrtho=false)
| Sets the camera during a draw.
MStatus | setDrawCameraOverride (const MMatrix &worldMatrix, const MMatrix &projectionMatrix, const MPointArray &frustum)
| Sets the camera during a draw.
MStatus | setCamera (MDagPath &camera)
| Set the camera for this view.
MStatus | getCamera (MDagPath &camera)
| Get the camera for this view.
MStatus | setCameraSet (MObject &cameraSet)
| Set the cameraSet for this view.
MStatus | getCameraSet (MObject &cameraSet)
| Get the cameraSet for this view.
MStatus | setCurrentCameraSetCamera (const MString &cameraName)
| Set a camera used by the currently specified cameraSet as the controlled camera for this view.
MStatus | getCurrentCameraSetCamera (MString &cameraName)
| Get the cameraSet for this view.
virtual MString | getCameraHUDName ()
| Return the name to use for the camera in the heads up display.
MStatus | setDisplayHUD (bool display)
| Enables or disables the drawing the heads up display in this view.
bool | displayHUD (MStatus *ReturnStatus=NULL) const
| Returns the heads up display state for this view.
MStatus | drawHUDNow ()
| Forces the HUD viewport elements to be drawn immediately.
MStatus | setDrawAdornments (bool display)
| Toggles the control of how adornments are drawn in the view.
bool | drawAdornments (MStatus *ReturnStatus=NULL)
| Returns the state of the adornment drawing for this view.
MStatus | drawAdornmentsNow ()
| Forces the adornment viewport elements to be drawn immediately.
MStatus | setDisplayAxis (bool display)
| Sets the axis display in the MPx3dModelView.
bool | displayAxisOn (MStatus *ReturnStatus=NULL) const
| Returns the axis display state for this MPx3dModelView.
MStatus | setDisplayAxisAtOrigin (bool display)
| Sets the origin axis display in the MPx3dModelView.
bool | displayAxisAtOriginOn (MStatus *ReturnStatus=NULL) const
| Returns the origin axis display state for this MPx3dModelView.
MStatus | setDisplayCameraAnnotation (bool display)
| Sets the camera annotation display in the MPx3dModelView.
bool | displayCameraAnnotationOn (MStatus *ReturnStatus=NULL) const
| Returns the camera annotation display state for this MPx3dModelView.
bool | isVisible (MStatus *ReturnStatus=NULL) const
| This method returns true if this view is visible, otherwise false is returned.
M3dView::DisplayStyle | displayStyle (MStatus *ReturnStatus=NULL) const
| Return the display style for this 3d view.
bool | isShadeActiveOnly (MStatus *ReturnStatus=NULL) const
| Returns true if this view's display style is shaded for objects that are active and wireframe otherwise.
MStatus | setDisplayStyle (M3dView::DisplayStyle style, bool activeOnly=false)
| Sets the display style for this view.
int | portWidth (MStatus *ReturnStatus=NULL)
| Returns the width of the current viewport.
int | portHeight (MStatus *ReturnStatus=NULL)
| Returns the height of the current viewport.
MStatus | beginXorDrawing (bool drawOrthographic=true, bool disableDepthTesting=true, float lineWidth=1.0f, M3dView::LineStipplePattern stipplePattern=M3dView::kStippleNone, const MColor &lineColor=MColor(1, 1, 1))
| Setup the context for exclusive-or (XOR) drawing.
MStatus | endXorDrawing ()
| Reset the context to non-exclusive-or (non-XOR) screen drawing.
MStatus | setDrawColor (unsigned int index, M3dView::ColorTable table=M3dView::kActiveColors)
| Set the color to draw in.
MStatus | setDrawColor (const MColor &color)
| Set the color to draw in.
unsigned int | numDormantColors (MStatus *ReturnStatus=NULL)
| Returns the number of dormant object colors in the internal application color table.
unsigned int | numActiveColors (MStatus *ReturnStatus=NULL)
| Returns the number of active object colors in the internal application color table.
unsigned int | numUserDefinedColors (MStatus *ReturnStatus=NULL)
| Returns the number of user defined colors in the internal application color table.
MStatus | setUserDefinedColor (unsigned int index, const MColor &color)
| Sets the user defined color at the given index.
unsigned int | userDefinedColorIndex (unsigned int index, MStatus *ReturnStatus=NULL)
| Returns the index for the given user-defined color.
bool | isBackgroundGradient (MStatus *ReturnStatus=NULL)
| Returns whether a gradient is being used as the background color.
MColor | templateColor (MStatus *ReturnStatus=NULL)
| Returns the value of the template color.
MColor | backgroundColor (MStatus *ReturnStatus=NULL)
| Returns the value of the background color.
MColor | backgroundColorTop (MStatus *ReturnStatus=NULL)
| Returns the value of the background gradient top color.
MColor | backgroundColorBottom (MStatus *ReturnStatus=NULL)
| Returns the value of the background gradient bottom color.
MColor | colorAtIndex (unsigned int index, M3dView::ColorTable table=M3dView::kActiveColors, MStatus *ReturnStatus=NULL)
| Returns the value of the color at the given index in the application's color table.
MStatus | getColorIndexAndTable (unsigned int glindex, unsigned int &index, M3dView::ColorTable &table) const
| Returns the color table and index representing the given OpenGL color-index value.
MStatus | viewToWorld (short x_pos, short y_pos, MPoint &worldPt, MVector &worldVector) const
| Takes a point in port coordinates and returns a corresponding ray in world coordinates.
MStatus | viewToWorld (short x_pos, short y_pos, MPoint &nearClipPt, MPoint &farClipPt) const
| Takes a point in port coordinates and returns a point on the near and far clipping planes.
MStatus | viewToObjectSpace (short x_pos, short y_pos, const MMatrix &localMatrixInverse, MPoint &oPt, MVector &oVector) const
| Takes a point in port coordinates and returns a corresponding ray in object coordinates.
bool | worldToView (const MPoint &worldPt, short &x_pos, short &y_pos, MStatus *ReturnStatus=NULL) const
| converts a point in world space to port space.
MStatus | setObjectDisplay (M3dView::DisplayObjects, bool)
| Sets the display option for various types of objects.
bool | objectDisplay (M3dView::DisplayObjects, MStatus *ReturnStatus=NULL)
| Test whether specific types of objects are to be displayed.
MStatus | setBackfaceCulling (bool cull)
| Sets backface culling.
bool | isBackfaceCulling (MStatus *ReturnStatus=NULL) const
| Returns the state of backface culling.
MStatus | setWireframeOnShaded (bool on)
| Displays as wireframe on shaded.
bool | isWireframeOnShaded (MStatus *ReturnStatus=NULL) const
| Returns the state of wireframe on shaded.
MStatus | setXrayEnabled (bool xray)
| Sets xray display state.
bool | isXrayEnabled (MStatus *ReturnStatus=NULL) const
| Returns the state of xray display.
MStatus | setTextureDisplayEnabled (bool texture)
| Enables texture display.
bool | isTextureDisplayEnabled (MStatus *ReturnStatus=NULL) const
| Returns the enable state of texture display.
MStatus | setTwoSidedLighting (bool twoSided)
| Enables two sided lighting.
bool | isTwoSidedLighting (MStatus *ReturnStatus=NULL) const
| Returns the state of two sided lighting.
MStatus | setLightingMode (MPx3dModelView::LightingMode)
| Sets the lighting mode.
MPx3dModelView::LightingMode | lightingMode (MStatus *ReturnStatus=NULL) const
| Returns the lighting mode.
MStatus | setFogEnabled (bool state)
| Enables and disables fog.
bool | isFogEnabled (MStatus *ReturnStatus=NULL) const
| Returns true if fog is enabled.
MPx3dModelView::FogSource | fogSource (MStatus *ReturnStatus=NULL) const
| Returns the algorithm used to compute fog.
MStatus | setFogSource (MPx3dModelView::FogSource)
| Sets the type of fog algorithm to use.
MPx3dModelView::FogMode | fogMode (MStatus *ReturnStatus=NULL) const
| Return the type of drop off used with fog.
MStatus | setFogMode (MPx3dModelView::FogMode)
| Sets the drop-off mode for fog.
double | fogDensity (MStatus *ReturnStatus=NULL) const
| Returns the fog density.
MStatus | setFogDensity (double)
| Determines the density of hardware fogging.
double | fogStart (MStatus *ReturnStatus=NULL) const
| Returns the fog start position.
MStatus | setFogStart (double)
| Determines the start location of hardware fogging.
double | fogEnd (MStatus *ReturnStatus=NULL) const
| Returns the fog end position.
MStatus | setFogEnd (double)
| Determines the end location of hardware fogging.
MColor | fogColor (MStatus *ReturnStatus=NULL) const
| Returns the fog color.
MStatus | setFogColor (const MColor &)
| Sets the color used for hardware fogging.
bool | isBackgroundFogEnabled (MStatus *ReturnStatus=NULL) const
| Returns true if the background fog is enabled.
MStatus | setBackgroundFogEnabled (bool enable)
| Enables and disables background fog.
MString | viewSelectedPrefix (MStatus *ReturnStatus) const
| Returns the prefix used when displaying the camera name in the heads up display when view selected in on.
MStatus | setViewSelectedPrefix (const MString &prefix)
| Sets the prefix for the camera name as displayed in the heads up display when view selected is enabled.
bool | viewSelected (MStatus *ReturnStatus=NULL) const
| Returns the state of view selected for this view.
MStatus | setViewSelected (bool viewSelected)
| Enables the view selected mode.
MObject | viewSelectedSet (MStatus *ReturnStatus=NULL) const
| Returns an MObject for the set used by view selected.
MStatus | setViewSelectedSet (const MObject &set)
| Sets the list of objects used by view selected as an object set.
MStatus | getObjectsToView (MSelectionList &list) const
| Returns a selection list containing all of the objects on the view selected list.
MStatus | setObjectsToView (const MSelectionList &list)
| Sets the list of objects used by view selected as a selection list.
bool | viewIsFiltered (MStatus *ReturnStatus=NULL) const
| Returns the state of view filtering for this view.
MStatus | filteredObjectList (MSelectionList &list) const
| Returns a selection list containing all of the objects that remain after filtering is applied to the view.
bool | hasStereoBufferSupport () const
| Returns true if this 3dModelView is running in stereo buffer mode.
MStatus | getAsM3dView (M3dView &view)
| Get this MPx3dModelView as a M3dView.
virtual bool | wantStereoGLBuffer () const
| Users should override this method if they want a stereo buffer enabled MPx3dModelView.
MStatus | setInStereoDrawMode (bool flag)
| Derived classes should call this method to indicate to Maya whether the view is currently drawing in stereo.
virtual bool | requestOkForDraw (const MDrawRequest &)
| This method provides some filter capabilities as to what is drawn.
## Static Public Member Functions
static MPx3dModelView * | getModelView (const MString &name, MStatus *ReturnStatus=NULL)
| Returns a pointer to a MPx3dModelView that has the passed name with the specified type (the same typed when registering the control).
static const char * | className ()
| Returns the name of this class.

## Member Enumeration Documentation

enum LightingMode

Search for all occurrences

Lighting mode used in this view.

Enumerator:

  kLightAll | Use all lights. Search for all occurrences
  kLightSelected | Selected lights only. Search for all occurrences
  kLightActive | Active lights only. Search for all occurrences
  kLightDefault | Default light only. Search for all occurrences
  kLightNone | Use no lights. Search for all occurrences
  kLightQuality | Use per pixel lighting. Search for all occurrences

enum FogSource

Search for all occurrences

Fog computation modes.

Enumerator:

  kFogFragment | Computed per pixel (default). Search for all occurrences
  kFogCoordinate | Computed by specified vertex fog coordinates. Search for all occurrences

enum FogMode

Search for all occurrences

Drop-off modes for fog.

Enumerator:

  kFogLinear | Linear drop off. Search for all occurrences
  kFogExponential | Exponential drop-off. Search for all occurrences
  kFogExponentialSquared | Squared exponential drop-off. Search for all occurrences

## Member Function Documentation

MString name | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns the name of the view.

Parameters:

  [out] | ReturnStatus | status

Returns:
  The name of the view.

Status Codes:
  - MS::kSuccess Operation successful

MString viewType | ( |  | ) | const`[virtual]`

Search for all occurrences

Returns a string specifying the view type.

The view type should be a different string for every class derived from MPx3dModelView. The default type is "MPx3dModelView".

Returns:
  The view type

Examples:
  narrowPolyViewer.h, and narrowPolyViewerCmd.cpp.

void preMultipleDraw | ( |  | ) | `[virtual]`

Search for all occurrences

This method is called before any drawing is performed in the model view.

It should control any setting required for every pass that will be drawn.

Examples:
  narrowPolyViewer.h.

void postMultipleDraw | ( |  | ) | `[virtual]`

Search for all occurrences

This method is called after the drawing is finished.

Any cleanup should be done by this method.

Examples:
  narrowPolyViewer.h.

void preMultipleDrawPass | ( | unsigned int | index | ) | `[virtual]`

Search for all occurrences

This method is called immediately before a specific pass is about to be drawn.

The unsigned int argument indictates which pass is about to be drawn.

Typically the camera (set with the setCameraInDraw method) and any pass specific settings would be made here.

Parameters:

  [in] | index | A number indicating which pass is about to be drawn.

Examples:
  narrowPolyViewer.h.

void postMultipleDrawPass | ( | unsigned int | index | ) | `[virtual]`

Search for all occurrences

This method is called when a specified pass is finshed.

Parameters:

  [in] | index | A number indicating which pass was just drawn.

Examples:
  narrowPolyViewer.h.

bool okForMultipleDraw | ( | const MDagPath & | dp | ) | `[virtual]`

Search for all occurrences

This method provides some filter capabilities as to what is drawn.

When ever a draw operation during the multiple camera drawing, this method will get called. If true is returned, then the object will be drawn.

This method is useful for filtering out multiple occurances of manipulators and ground planes.

To reduce the number of objects queried, look at the setViewSelected() method along with the setObjectsToView() method.

Parameters:

  [in] | dp | A MDagPath of the object that may be drawn.

Returns:
  true if it is OK to draw the passed object.

Examples:
  narrowPolyViewer.h.

unsigned int multipleDrawPassCount | ( |  | ) | `[virtual]`

Search for all occurrences

This method returns the number of multiple draw passes that are going to be made.

By default a 1 is returned.

Returns:
  The number of multiple draw passes that will be made.

Status Codes:
  - MS::kSuccess Operation successful

Examples:
  narrowPolyViewer.h.

bool multipleDrawEnabled | ( |  | ) | const

Search for all occurrences

This method returns the multiple draw enable state for this view.

Returns:
  true if multiple draw is enabled.

void setMultipleDrawEnable | ( | bool | enable | ) |

Search for all occurrences

This method turns enables/disables multiple camera drawing for this view.

If multiple draw is disabled, then this view will behave like a normal Maya view.

Parameters:

  [in] | enable | If true, then multiple draw is enabled.

bool destroyOnPanelDestruction | ( |  | ) | const

Search for all occurrences

This method queries the destruction setting for this MPx3dModelView which is employed when the panel associated with this view is destroyed.

By choosing to have the MPx3dModelView destroyed along with the panel, you are guaranteed that a new MPx3dModelView will be created the next time the editor is displayed.

Returns:
  true if this MPx3dModelView gets destroyed when its panel is destroyed (such as closing a torn-off window), and false if it is not to be destroyed.

void setDestroyOnPanelDestruction | ( | bool | how | ) |

Search for all occurrences

This method enables/disables destruction of the MPx3dModelView object when the panel is destroyed.

By default, Maya does not destroy the MPx3dModelView when the panel is destroyed. Example cases of destroying a panel are when you tear off a panel, or close a torn-off panel.

By choosing to have the MPx3dModelView destroyed along with the panel, you are guaranteed that a new MPx3dModelView will be created the next time the editor is displayed.

Parameters:

  [in] | how | If true, destroy the MPx3dModelView when the panel is destroyed. If false (the default behaviour), the editor is retained.

MStatus updateViewingParameters | ( |  | ) |

Search for all occurrences

This method tells the camera to set the view's transformation matrix.

Returns:
  Status code

void removingCamera | ( | MDagPath & | cameraPath | ) | `[virtual]`

Search for all occurrences

This method should be overloaded in MPx3dModelView derived classes.

It will get called whenever a camera that was used with this MPx3dModelView is deleted. The MPx3dModelView should then remove any reference to the deleted camera.

Parameters:

  [in] | cameraPath | The MDagPath for the camera that is about to be deleted.

Examples:
  narrowPolyViewer.h.

MStatus setDoUpdateOnMove | ( | bool | value | ) |

Search for all occurrences

Some viewports require a refresh when the user has moved the top level window.

This flag enables this custom view to trigger a refresh event when the top level window of the view is moved to a new location.

The default value for this flag is false.

Parameters:

  [in] | value | The state of the doUpdateOnMove flag.

Returns:
  - Status code

Status Codes:
  - MS::kSuccess Method was successful
  - MS::kFailure Object error

bool doUpdateOnMove | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns the state of the doUpdateOnMove flag.

This flag tells the refresh architecture if it is necessary to refresh your view when the user moves the control window for this viewport. If this flag is true, then refresh will be triggered on window move.

Parameters:

  [in] | ReturnStatus | return status of the check

Returns:
  - the state of the doUpdateOnMove flag

Status Codes:
  - MS::kSuccess Method was successful
  - MS::kFailure Object error

MStatus refresh | ( | bool | all = `false`,
|  | bool | force = `false`
| ) |  |

Search for all occurrences

Refresh the this view.

If all is set to true then all of the 3d-view will be refreshed.

If force is set to true, then the views will be refreshed even if they do not require it. This option should be used with extreme care because extra refreshes will greatly degrade application performance. In almost all cases it is better to use the default behavior where the view is only refreshed if it is required.

Parameters:

  [in] | all | If true then refresh all views, otherwise refresh this view.
  [in] | force | If true then force views to refresh even if they do not require it.

Returns:
  Status code

Status Codes:
  - MS::kSuccess Method was successful
  - MS::kFailure Object error

MStatus drawText | ( | const MString & | text,
|  | const MPoint | position,
|  | M3dView::TextPosition | textPosition = `M3dView::kLeft`
| ) |  |

Search for all occurrences

Draws the given text at the given spot in the default font.

This method is provided as a convienient way to draw OpenGL text.

Parameters:

  [in] | text | Text to draw
  [in] | position | Position in space to draw at
  [in] | textPosition | Text position relative to the point

Returns:
  Status code

Status Codes:
  - MS::kSuccess Method was successful
  - MS::kFailure Object error

MStatus beginGL | ( |  | ) |

Search for all occurrences

Setup port for native OpenGL drawing calls.

Only make openGL calls between the beginGL() and endGL() methods. M3dView and MPx3dModelView calls should not be made betwen beginGL() and endGL() calls.

This should only be used if there is not a M3dView or MPx3dModelView method that performs the required task.

Returns:
  Status code

Status Codes:
  - MS::kSuccess Method was successful
  - MS::kFailure Method failed

MStatus endGL | ( |  | ) |

Search for all occurrences

End OpenGL drawing.

Returns:
  Status code

Status Codes:
  - MS::kSuccess Method was successful
  - MS::kFailure Object error

MStatus setCameraInDraw | ( | MDagPath & | camera | ) |

Search for all occurrences

Sets the camera during a draw.

If the normal setCamera() method is used, then that camera will not get its parameters loaded during the draw.

Parameters:

  [in] | camera | Dag path of the camera

Returns:
  Status code

Status Codes:
  - MS::kSuccess Method was successful
  - MS::kFailure Object error

MStatus setDrawCameraOverride | ( | const MMatrix & | worldMatrix,
|  | const MMatrix & | projectionMatrix,
|  | double | left,
|  | double | right,
|  | double | bottom,
|  | double | top,
|  | double | nearpt,
|  | double | farpt,
|  | bool | isOrtho = `false`
| ) |  |

Search for all occurrences

Sets the camera during a draw.

Users must supply all of the parameters of the cameras. This only affects the draw matrices.

Maya uses view frustum culling to remove objects from the draw loop. To override the draw camera, you must also provide the frustum left, right, bottom, top parameters.

Parameters:

  [in] | worldMatrix | the worldMatrix of the camera. This will be used to construct the view matrix.
  [in] | projectionMatrix | projection matrix of the camera.
  [in] | left | the left edge of the frustum.
  [in] | right | the right edge of the frustum.
  [in] | bottom | the bottom edge of the frustum.
  [in] | top | the top edge of the frustum.
  [in] | nearpt | the near pt of the frustum.
  [in] | farpt | the far pt of the frustum.
  [in] | isOrtho | indicates if the frustum pts correspond to an ortho camera (default is false).

MStatus setDrawCameraOverride | ( | const MMatrix & | worldMatrix,
|  | const MMatrix & | projectionMatrix,
|  | const MPointArray & | frustum
| ) |  |

Search for all occurrences

Sets the camera during a draw.

Users must supply all of the parameters of the cameras. This only affects the draw matrices.

Maya uses view frustum culling to remove objects from the draw loop. To override the draw camera, you must also provide the frustum points so that objects and be appropriately culled from the scene.

Parameters:

  [in] | worldMatrix | the worldMatrix of the camera. This will be used to construct the view matrix.
  [in] | projectionMatrix | projection matrix of the camera.
  [in] | frustum | The 8 frustum points in the following order nearBottomLeft, nearBottomRight, nearTopLeft, nearTopRight, farBottomLeft, farBottomRight, farTopLeft, farTopRight

MStatus setCamera | ( | MDagPath & | camera | ) |

Search for all occurrences

Set the camera for this view.

Parameters:

  [in] | camera | Dag path of the camera for this view

Returns:
  Status code

Status Codes:
  - MS::kSuccess Method was successful
  - MS::kFailure Method failed

MStatus getCamera | ( | MDagPath & | camera | ) |

Search for all occurrences

Get the camera for this view.

Parameters:

  [out] | camera | Dag path for the camera (allocated by caller)

Returns:
  Status code

Status Codes:
  - MS::kSuccess Method was successful
  - MS::kFailure Method failed

MStatus setCameraSet | ( | MObject & | cameraSet | ) |

Search for all occurrences

Set the cameraSet for this view.

Parameters:

  [in] | cameraSet | cameraSet object for this view

Returns:
  Status code

Status Codes:
  - MS::kSuccess Method was successful
  - MS::kFailure Method failed

MStatus getCameraSet | ( | MObject & | cameraSet | ) |

Search for all occurrences

Get the cameraSet for this view.

Parameters:

  [out] | cameraSet | dependency node object for the cameraSet (allocated by caller)

Returns:
  Status code

Status Codes:
  - MS::kSuccess Method was successful
  - MS::kFailure Method failed

MStatus setCurrentCameraSetCamera | ( | const MString & | cameraName | ) |

Search for all occurrences

Set a camera used by the currently specified cameraSet as the controlled camera for this view.

Parameters:

  [in] | cameraName | camera layer camera name for this view

Returns:
  Status code

Status Codes:
  - MS::kSuccess Method was successful
  - MS::kFailure A cameraSet is not being viewed

MStatus getCurrentCameraSetCamera | ( | MString & | cameraName | ) |

Search for all occurrences

Get the cameraSet for this view.

Parameters:

  [out] | cameraName | dependency node object for the cameraSet (allocated by caller)

Returns:
  Status code

Status Codes:
  - MS::kSuccess Method was successful
  - MS::kFailure The view is invalid or no cameraSet has been set in the view.

MString getCameraHUDName | ( |  | ) | `[virtual]`

Search for all occurrences

Return the name to use for the camera in the heads up display.

Returns:
  The name of the camera

Examples:
  narrowPolyViewer.h.

MStatus setDisplayHUD | ( | bool | enable | ) |

Search for all occurrences

Enables or disables the drawing the heads up display in this view.

This method only affects this view and will stop all heads up display elements from being drawn in this view.

Parameters:

  [in] | enable | The enable state of the heads up display in this view.

Returns:
  Status

Status Codes:
  - MS::kSuccess Operation successful

bool displayHUD | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns the heads up display state for this view.

Parameters:

  [out] | ReturnStatus | the return status

Returns:
  The enable state for the HUD

Status Codes:
  - MS::kSuccess Operation successful

MStatus drawHUDNow | ( |  | ) |

Search for all occurrences

Forces the HUD viewport elements to be drawn immediately.

This should only be called when setDrawAdornments has been set to false. And this method should only be called in the postMultiple* draw methods. This allows the drawing of display elements during a specific pass while attached to a specific camera.

Returns:
  - MS::kFailure - invalid editor.
  - MS::kSuccess - success.

MStatus setDrawAdornments | ( | bool | display | ) |

Search for all occurrences

Toggles the control of how adornments are drawn in the view.

Adornments are objects that are drawn in the viewport that are not scene entities. This includes the origin axis and the camera decorations like film gate and resolution gate. These items are usually drawn last and outside of the multiple refresh loop. You can choose to disable the drawing of the adornments by specifying false here, and you can control the drawing of the feature within their display loop calling displayAdornmentsNow() method on this class. By default this flag is true; so adornments are always drawn unless explicitly disabled by you.

Parameters:

  [in] | display | toggle to control the display of the adornments.

Returns:
  Status code

Status Codes:
  - MS::kSuccess Operation successful

bool drawAdornments | ( | MStatus * | ReturnStatus = `NULL` | ) |

Search for all occurrences

Returns the state of the adornment drawing for this view.

See setDrawAdornments for more information on adornment drawing.

Parameters:

  [out] | ReturnStatus | Status code.

MStatus drawAdornmentsNow | ( |  | ) |

Search for all occurrences

Forces the adornment viewport elements to be drawn immediately.

This should only be called when setDrawAdornments has been set to false. And this method should only be called in the postMultiple* draw methods. This allows you to draw camera adornments during a specific pass while attached to a specific camera.

Returns:
  - MS::kFailure - invalid editor.
  - MS::kSuccess - success.

MStatus setDisplayAxis | ( | bool | enable | ) |

Search for all occurrences

Sets the axis display in the MPx3dModelView.

Parameters:

  [in] | enable | If true, then the axis is displayed.

Returns:
  Return status

Status Codes:
  - MS::kSuccess Operation successful
  - MS::kFailure Operation failed

bool displayAxisOn | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns the axis display state for this MPx3dModelView.

Parameters:

  [out] | ReturnStatus | The return status.

Returns:
  true if the axis is displayed.

Status Codes:
  - MS::kSuccess Operation successful
  - MS::kSuccess Operation failed

MStatus setDisplayAxisAtOrigin | ( | bool | enable | ) |

Search for all occurrences

Sets the origin axis display in the MPx3dModelView.

Parameters:

  [in] | enable | If true, then the origin axis is displayed.

Returns:
  Return status

Status Codes:
  - MS::kSuccess Operation successful
  - MS::kFailure Operation failed

bool displayAxisAtOriginOn | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns the origin axis display state for this MPx3dModelView.

Parameters:

  [out] | ReturnStatus | The return status.

Returns:
  true if the origin axis is displayed.

Status Codes:
  - MS::kSuccess Operation successful
  - MS::kSuccess Operation failed

MStatus setDisplayCameraAnnotation | ( | bool | enable | ) |

Search for all occurrences

Sets the camera annotation display in the MPx3dModelView.

Parameters:

  [in] | enable | If true, then the camera annotation is displayed.

Returns:
  Return status

Status Codes:
  - MS::kSuccess Operation successful
  - MS::kFailure Operation failed

bool displayCameraAnnotationOn | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns the camera annotation display state for this MPx3dModelView.

Parameters:

  [out] | ReturnStatus | The return status.

Returns:
  true if the camera annotation is displayed.

Status Codes:
  - MS::kSuccess Operation successful
  - MS::kFailure Operation failed

bool isVisible | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

This method returns true if this view is visible, otherwise false is returned.

Parameters:

  [out] | ReturnStatus | The return status.

Returns:
  true if the view is visible, otherwise false is returned.

Status Codes:
  - MS::kSuccess Method succeeded.
  - MS::kFailure Method failed.

M3dView::DisplayStyle displayStyle | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Return the display style for this 3d view.

The display style can be wireframe, flat-shaded, or smooth-shaded.

Parameters:

  [out] | ReturnStatus | Status code

Returns:
  The display style for this view

Status Codes:
  - MS::kSuccess Method was successful
  - MS::kFailure Object error

bool isShadeActiveOnly | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns true if this view's display style is shaded for objects that are active and wireframe otherwise.

Parameters:

  [out] | ReturnStatus | Status code

Returns:
  - true Only active objects are shaded if this view is in shaded mode
  - false All objects are shaded if this view is in shaded mode

Status Codes:
  - MS::kSuccess Method was successful
  - MS::kFailure Object error

MStatus setDisplayStyle | ( | M3dView::DisplayStyle | style,
|  | bool | activeOnly = `false`
| ) |  |

Search for all occurrences

Sets the display style for this view.

The display style can be wireframe, flat-shaded, or smooth-shaded.

Parameters:

  [in] | style | The display style to be set for this view
  [in] | activeOnly | Specifies whether only active objects are to be shaded in shaded mode.

Returns:
  Status code

Status Codes:
  - MS::kSuccess Method was successful
  - MS::kFailure Object error

int portWidth | ( | MStatus * | ReturnStatus = `NULL` | ) |

Search for all occurrences

Returns the width of the current viewport.

Parameters:

  [out] | ReturnStatus | Status Code

Returns:
  The width of this viewport

Status Codes:
  - MS::kSuccess Method was successful
  - MS::kFailure Object error

int portHeight | ( | MStatus * | ReturnStatus = `NULL` | ) |

Search for all occurrences

Returns the height of the current viewport.

Parameters:

  [out] | ReturnStatus | Status Code

Returns:
  The height of this viewport

Status Codes:
  - MS::kSuccess Method was successful
  - MS::kFailure Object error

MStatus beginXorDrawing | ( | bool | drawOrthographic = `true`,
|  | bool | disableDepthTesting = `true`,
|  | float | lineWidth = `1.0f`,
|  | M3dView::LineStipplePattern | stipplePattern = `M3dView::kStippleNone`,
|  | const MColor & | lineColor = `MColor(1, 1, 1)`
| ) |  |

Search for all occurrences

Setup the context for exclusive-or (XOR) drawing.

In XOR drawing the color values of the pixels being drawn is exclusive-ored with the color values already present in the view. The advantage of this is that exclusive-oring the same pixels with the same color values a second time will restore the pixels to their original colors, making it possible to temporarily display and erase lines without having to redraw the entire view. This makes XOR drawing particularly useful for drawing guidelines for tools.

One disadvantage of XOR drawing is that the final color after the exclusive-or will not match your drawing color, except when the original color of the pixel was black. For example, XORing a white line across a red background will result in a cyan line and XORing it across a changing background will result in a line of changing colors. However in most situations where you would use XOR drawing the color of the lines is irrelevant just so long as they are visible.

It is an error to call beginXorDrawing() again before calling endXorDrawing() first.

Parameters:

  [in] | drawOrthographic | Draw using orthographic projection. Default is true.
  [in] | disableDepthTesting | Disable depth testing during draw. Default is true.
  [in] | lineWidth | Set up line width. Default is 1.
  [in] | stipplePattern | Line stipple pattern. Default is M3dView::kStippleNone.
  [in] | lineColor | Line color. Default is white (1,1,1).

Returns:
  Status code

Status Codes:
  - MS::kSuccess Method was successful
  - MS::kFailure Object error

MStatus endXorDrawing | ( |  | ) |

Search for all occurrences

Reset the context to non-exclusive-or (non-XOR) screen drawing.

If endXorDrawing() is called without first calling beginXorDrawing() an error will result.

Returns:
  Status code

Status Codes:
  - MS::kSuccess Method was successful
  - MS::kFailure Object error

MStatus setDrawColor | ( | unsigned int | index,
|  | M3dView::ColorTable | table = `M3dView::kActiveColors`
| ) |  |

Search for all occurrences

Set the color to draw in.

The index argument is an index into the application's color tables. Valid values range between zero and the size of the table minus one. The size of the active and dormant color tables can be found using methods of this class. The background and template color tables are both of size one.

These indices do not directly correspond to those of the underlying OpenGL color index mode. Using the glIndex call directly is not recommended and may cause unpredictable results. This method should be used instead.

Note that this method will work in either RGBA mode or color index mode.

Parameters:

  [in] | index | index of the color to draw in
  [in] | table | color table to index into

Returns:
  Status code

Status Codes:
  - MS::kSuccess Method was successful
  - MS::kInvalidParameter Index is out of range
  - MS::kFailure Object error

MStatus setDrawColor | ( | const MColor & | color | ) |

Search for all occurrences

Set the color to draw in.

This method should only be used in RGBA mode. It is a convenient replacement for glColor.

Parameters:

  [in] | color | color to draw in

Returns:
  Status code

Status Codes:
  - MS::kSuccess Method was successful
  - MS::kInvalidParameter Index is out of range
  - MS::kFailure Object error

unsigned int numDormantColors | ( | MStatus * | ReturnStatus = `NULL` | ) |

Search for all occurrences

Returns the number of dormant object colors in the internal application color table.

Parameters:

  [out] | ReturnStatus | Status code

Returns:
  The number of dormant colors

Status Codes:
  - MS::kSuccess Method was successful

unsigned int numActiveColors | ( | MStatus * | ReturnStatus = `NULL` | ) |

Search for all occurrences

Returns the number of active object colors in the internal application color table.

Parameters:

  [out] | ReturnStatus | Status code

Returns:
  The number of active colors

Status Codes:
  - MS::kSuccess Method was successful

unsigned int numUserDefinedColors | ( | MStatus * | ReturnStatus = `NULL` | ) |

Search for all occurrences

Returns the number of user defined colors in the internal application color table.

These colors may be changed by the user and assigned to specific objects. See the methods of MFnDagNode for information on assigning user defined colors to individual objects.

The user defined colors are not a color table of their own. They exist in the active and dormant color tables.

Parameters:

  [out] | ReturnStatus | Status code

Returns:
  The number of user defined colors

Status Codes:
  - MS::kSuccess Method was successful

MStatus setUserDefinedColor | ( | unsigned int | index,
|  | const MColor & | color
| ) |  |

Search for all occurrences

Sets the user defined color at the given index.

Valid indices range between zero and the number of user defined colors.

Parameters:

  [in] | index | index into the user defined color
  [in] | color | color to set to

Returns:
  An index into the application's color table

Status Codes:
  - MS::kSuccess Method was successful
  - MS::kInvalidParameter Index is out of range

unsigned int userDefinedColorIndex | ( | unsigned int | index,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  |

Search for all occurrences

Returns the index for the given user-defined color.

Valid values for the index argument range between zero and the number of user-defined colors minus one.

The index returned gives the location of the specified color inside the active and dormant color tables (the index is the same in both tables).

Parameters:

  [in] | index | Index into user-defined colors
  [out] | ReturnStatus | Status code

Returns:
  Index of user-defined color into the active and dormant tables

Status Codes:
  - MS::kSuccess Method was successful

bool isBackgroundGradient | ( | MStatus * | ReturnStatus = `NULL` | ) |

Search for all occurrences

Returns whether a gradient is being used as the background color.

Parameters:

  [out] | ReturnStatus | Status code

Returns:
  - true background is a color gradient
  - false background is a solid color

Status Codes:
  - MS::kSuccess Method was successful

MColor templateColor | ( | MStatus * | ReturnStatus = `NULL` | ) |

Search for all occurrences

Returns the value of the template color.

Parameters:

  [out] | ReturnStatus | Status code

Returns:
  The template color

Status Codes:
  - MS::kSuccess Method was successful

MColor backgroundColor | ( | MStatus * | ReturnStatus = `NULL` | ) |

Search for all occurrences

Returns the value of the background color.

Parameters:

  [out] | ReturnStatus | Status code

Returns:
  The background color

Status Codes:
  - MS::kSuccess Method was successful

MColor backgroundColorTop | ( | MStatus * | ReturnStatus = `NULL` | ) |

Search for all occurrences

Returns the value of the background gradient top color.

Parameters:

  [out] | ReturnStatus | Status code

Returns:
  The background gradient top color

Status Codes:
  - MS::kSuccess Method was successful

MColor backgroundColorBottom | ( | MStatus * | ReturnStatus = `NULL` | ) |

Search for all occurrences

Returns the value of the background gradient bottom color.

Parameters:

  [out] | ReturnStatus | Status code

Returns:
  The background gradient bottom color

Status Codes:
  - MS::kSuccess Method was successful

MColor colorAtIndex | ( | unsigned int | index,
|  | M3dView::ColorTable | table = `M3dView::kActiveColors`,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  |

Search for all occurrences

Returns the value of the color at the given index in the application's color table.

Parameters:

  [in] | index | Index of the color to retrieve
  [in] | table | Table to index into
  [out] | ReturnStatus | Status code

Returns:
  The color

Status Codes:
  - MS::kSuccess Method was successful
  - MS::kInvalidParameter Index is out of range

MStatus getColorIndexAndTable | ( | unsigned int | glindex,
|  | unsigned int & | index,
|  | M3dView::ColorTable & | table
| ) |  | const

Search for all occurrences

Returns the color table and index representing the given OpenGL color-index value.

This method is useful when converting color indices obtained from glReadPixels(GL_COLOR_INDEX) to Maya color-index values suitable for use with the colorAtIndex and setDrawColor methods.

Parameters:

  [in] | glindex | Value of the OpenGL color-index to retrieve
  [out] | index | Returned ColorTable index
  [out] | table | Returned ColorTable

Returns:
  StatusCode

Status Codes:
  - MS::kSuccess Method was successful
  - MS::kInvalidParameter Index is out of range

MStatus viewToWorld | ( | short | x_pos,
|  | short | y_pos,
|  | MPoint & | worldPt,
|  | MVector & | worldVector
| ) |  | const

Search for all occurrences

Takes a point in port coordinates and returns a corresponding ray in world coordinates.

Parameters:

  [in] | x_pos | the x position of the point in port coordinates
  [in] | y_pos | the y position of the point in port coordinates
  [out] | worldPt | (returned) the source of the ray
  [out] | worldVector | (returned) the direction of the ray

Returns:
  Status Code

Status Codes:
  - MS::kSuccess Method was successful
  - MS::kFailure Object error

MStatus viewToWorld | ( | short | x_pos,
|  | short | y_pos,
|  | MPoint & | nearClipPt,
|  | MPoint & | farClipPt
| ) |  | const

Search for all occurrences

Takes a point in port coordinates and returns a point on the near and far clipping planes.

Parameters:

  [in] | x_pos | the x position of the point in port coordinates
  [in] | y_pos | the y position of the point in port coordinates
  [out] | nearClipPt | (returned) point on near clipping plane
  [out] | farClipPt | (returned) point on far clipping plane

Returns:
  Status Code

Status Codes:
  - MS::kSuccess Method was successful
  - MS::kFailure Object error

MStatus viewToObjectSpace | ( | short | x_pos,
|  | short | y_pos,
|  | const MMatrix & | localMatrixInverse,
|  | MPoint & | oPt,
|  | MVector & | oVector
| ) |  | const

Search for all occurrences

Takes a point in port coordinates and returns a corresponding ray in object coordinates.

Parameters:

  [in] | x_pos | the x position of the point in port coordinates
  [in] | y_pos | the y position of the point in port coordinates
  [in] | localMatrixInverse | the inclusive matrix inverse of the object in question
  [out] | oPt | (returned) the source of the ray in object space
  [out] | oVector | (returned) the direction of the ray in object space

Returns:
  Status Code

Status Codes:
  - MS::kSuccess Method was successful
  - MS::kFailure Object error

bool worldToView | ( | const MPoint & | worldPt,
|  | short & | x_pos,
|  | short & | y_pos,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  | const

Search for all occurrences

converts a point in world space to port space.

The return value indicates if the point is not clipped.

Parameters:

  [in] | worldPt | the point to world space
  [out] | x_pos | the x position of the point in port coordinates
  [out] | y_pos | the y position of the point in port coordinates
  [out] | ReturnStatus | Status code

Returns:
  - true point is not clipped
  - false point is undefined or outside frustum

Status Codes:
  - MS::kSuccess Method was successful
  - MS::kFailure Object error

MStatus setObjectDisplay | ( | M3dView::DisplayObjects | displayType,
|  | bool | display
| ) |  |

Search for all occurrences

Sets the display option for various types of objects.

By default everything is displayed.

Parameters:

  [in] | displayType | The type of object to display
  [in] | display | Should the object type be displayed?

Returns:
  The return status

Status Codes:
  - MS::kSuccess Method was successful
  - MS::kFailure Object error

bool objectDisplay | ( | M3dView::DisplayObjects | dispObjs,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  |

Search for all occurrences

Test whether specific types of objects are to be displayed.

Parameters:

  [in] | dispObjs | Bit mask of object display flags to be tested.
  [out] | ReturnStatus | Status code.

Returns:
  True if any of the object types specified by dispObjs are set to be displayed.

Status Codes:
  - MS::kSuccess Method was successful
  - MS::kFailure Object error

MStatus setBackfaceCulling | ( | bool | culling | ) |

Search for all occurrences

Sets backface culling.

Parameters:

  [in] | culling | sets the backface culling state

Returns:
  Status

Status Codes:
  - MS::kSuccess Operation successful

bool isBackfaceCulling | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns the state of backface culling.

Parameters:

  [out] | ReturnStatus | return status

Returns:
  true if backface culling is enabled.

Status Codes:
  - MS::kSuccess Operation successful

MStatus setWireframeOnShaded | ( | bool | onShaded | ) |

Search for all occurrences

Displays as wireframe on shaded.

Parameters:

  [in] | onShaded | sets the wireframe on shaded state

Returns:
  Status

Status Codes:
  - MS::kSuccess Operation successful

bool isWireframeOnShaded | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns the state of wireframe on shaded.

Parameters:

  [out] | ReturnStatus | return status

Returns:
  true if backface onShaded is enabled.

Status Codes:
  - MS::kSuccess Operation successful

MStatus setXrayEnabled | ( | bool | xray | ) |

Search for all occurrences

Sets xray display state.

Parameters:

  [in] | xray | sets the xray display state

Returns:
  Status

Status Codes:
  - MS::kSuccess Operation successful

bool isXrayEnabled | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns the state of xray display.

Parameters:

  [out] | ReturnStatus | return status

Returns:
  true if xray is enabled.

Status Codes:
  - MS::kSuccess Operation successful

MStatus setTextureDisplayEnabled | ( | bool | textureDisplay | ) |

Search for all occurrences

Enables texture display.

Parameters:

  [in] | textureDisplay | sets the texture display state

Returns:
  Status

Status Codes:
  - MS::kSuccess Operation successful

bool isTextureDisplayEnabled | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns the enable state of texture display.

Parameters:

  [out] | ReturnStatus | return status

Returns:
  true if texture display is enabled.

Status Codes:
  - MS::kSuccess Operation successful

MStatus setTwoSidedLighting | ( | bool | twoSided | ) |

Search for all occurrences

Enables two sided lighting.

Parameters:

  [in] | twoSided | sets the two sided lighting state

Returns:
  Status

Status Codes:
  - MS::kSuccess Operation successful

bool isTwoSidedLighting | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns the state of two sided lighting.

Parameters:

  [out] | ReturnStatus | return status

Returns:
  true if two sided lighting is enabled.

Status Codes:
  - MS::kSuccess Operation successful

MStatus setLightingMode | ( | MPx3dModelView::LightingMode | lightingMode | ) |

Search for all occurrences

Sets the lighting mode.

Parameters:

  [in] | lightingMode | sets the lighting mode

Returns:
  Status

Status Codes:
  - MS::kSuccess Operation successful

MPx3dModelView::LightingMode lightingMode | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns the lighting mode.

Parameters:

  [out] | ReturnStatus | return status

Returns:
  The lighting mode.

Status Codes:
  - MS::kSuccess Operation successful

MStatus setFogEnabled | ( | bool | state | ) |

Search for all occurrences

Enables and disables fog.

If fog is enabled for one pass and disabled for another, the background fog will not be drawn. To display background fog in that configuration, use the MPx3dModelView::setBackgroundFogEnabled() call.

Parameters:

  [in] | state | true is fog should be on.

Returns:
  Status

Status Codes:
  - MS::kSuccess Operation successful

bool isFogEnabled | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns true if fog is enabled.

Parameters:

  [out] | ReturnStatus | status

Returns:
  true is fog is enabled.

Status Codes:
  - MS::kSuccess Operation successful

MPx3dModelView::FogSource fogSource | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns the algorithm used to compute fog.

See MPx3dModelView::setFogSource for a description.

Parameters:

  [out] | ReturnStatus | status

Returns:
  The algorithm used to compute fog.

Status Codes:
  - MS::kSuccess Operation successful
  - MS::kFailure Operation failed

MStatus setFogSource | ( | MPx3dModelView::FogSource | source | ) |

Search for all occurrences

Sets the type of fog algorithm to use.

If the source argument is kFogFragment (default) then fog is computed per pixel. If the argument is kFogCoordinate then if the geometry has specified vertex fog coordinates, and the OpenGL extension for vertex fog is supported by the graphics system, then fog is computed per vertex.

Parameters:

  [in] | source | The type of algorithm to use.

Returns:
  Status

Status Codes:
  - MS::kSuccess Operation successful
  - MS::kInvalidParameter Unknown fog source
  - MS::kFailure Operation failed

MPx3dModelView::FogMode fogMode | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Return the type of drop off used with fog.

See MPx3dModelView::setFogMode for description of the drop off types.

Parameters:

  [out] | ReturnStatus | status

Returns:
  The type of drop off used with fog.

Status Codes:
  - MS::kSuccess Operation successful
  - MS::kFailure Operation failed

MStatus setFogMode | ( | MPx3dModelView::FogMode | mode | ) |

Search for all occurrences

Sets the drop-off mode for fog.

The possibilities are:

- kFogLinear linear drop-off
- kFogExponential exponential drop-off
- kFogExponentialSquared squared exponential drop-off

Parameters:

  [in] | mode | The type of drop off to use with fog.

Returns:
  Status

Status Codes:
  - MS::kSuccess Operation successful
  - MS::kInvalidParameter Unknown fog mode
  - MS::kFailure Operation failed

double fogDensity | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns the fog density.

Parameters:

  [out] | ReturnStatus | status

Returns:
  The fog density.

Status Codes:
  - MS::kSuccess Operation successful

MStatus setFogDensity | ( | double | density | ) |

Search for all occurrences

Determines the density of hardware fogging.

This is meaniful for kFogExponential and kFogExponentialSquared drop off types (set by the MPx3dModelView::setFogMode() method).

Parameters:

  [in] | density |

Returns:
  Status

Status Codes:
  - MS::kSuccess Operation successful

double fogStart | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns the fog start position.

Parameters:

  [out] | ReturnStatus | status

Returns:
  The fog start position.

Status Codes:
  - MS::kSuccess Operation successful

MStatus setFogStart | ( | double | start | ) |

Search for all occurrences

Determines the start location of hardware fogging.

This is meaniful for kFogLinear drop off type (set by the MPx3dModelView::setFogMode() method).

Parameters:

  [in] | start |

Returns:
  Status

Status Codes:
  - MS::kSuccess Operation successful

double fogEnd | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns the fog end position.

Parameters:

  [out] | ReturnStatus | status

Returns:
  The fog end location.

Status Codes:
  - MS::kSuccess Operation successful

MStatus setFogEnd | ( | double | end | ) |

Search for all occurrences

Determines the end location of hardware fogging.

This is meaniful for kFogLinear drop off type (set by the MPx3dModelView::setFogMode() method).

Parameters:

  [in] | end |

Returns:
  Status

Status Codes:
  - MS::kSuccess Operation successful

MColor fogColor | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns the fog color.

Parameters:

  [out] | ReturnStatus | status

Returns:
  The fog color.

Status Codes:
  - MS::kSuccess Operation successful

MStatus setFogColor | ( | const MColor & | color | ) |

Search for all occurrences

Sets the color used for hardware fogging.

Parameters:

  [in] | color | The color used by hardware fogging.

Returns:
  Status

Status Codes:
  - MS::kSuccess Operation successful

bool isBackgroundFogEnabled | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns true if the background fog is enabled.

Parameters:

  [out] | ReturnStatus | status

Returns:
  true, if the background fog is enabled, otherwise false.

Status Codes:
  - MS::kSuccess Operation successful

MStatus setBackgroundFogEnabled | ( | bool | state | ) |

Search for all occurrences

Enables and disables background fog.

Parameters:

  [in] | state | true if background fog should be enabled.

Returns:
  Status

Status Codes:
  - MS::kSuccess Operation successful

MString viewSelectedPrefix | ( | MStatus * | ReturnStatus | ) | const

Search for all occurrences

Returns the prefix used when displaying the camera name in the heads up display when view selected in on.

Parameters:

  [out] | ReturnStatus | the return status

Returns:
  The prefix.

Status Codes:
  - MS::kSuccess Operation successful

MStatus setViewSelectedPrefix | ( | const MString & | prefix | ) |

Search for all occurrences

Sets the prefix for the camera name as displayed in the heads up display when view selected is enabled.

The prefix is concatenated with the camera name.

The default value is "isolate: "

Parameters:

  [in] | prefix | The prefix to use.

Returns:
  Status

Status Codes:
  - MS::kSuccess Operation successful

bool viewSelected | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns the state of view selected for this view.

Parameters:

  [out] | ReturnStatus | return status

Returns:
  true if view selected is enabled.

Status Codes:
  - MS::kSuccess Operation successful

MStatus setViewSelected | ( | bool | enable | ) |

Search for all occurrences

Enables the view selected mode.

Parameters:

  [in] | enable | enable or disable view selected mode.

Returns:
  Status

Status Codes:
  - MS::kSuccess Operation successful

MObject viewSelectedSet | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns an MObject for the set used by view selected.

If there is not a set associated with this view, then an invalid MObject will be returned. Check the isNull() method of the MObject to see if a valid set was found.

Parameters:

  [out] | ReturnStatus | return status

Returns:
  The MObject

Status Codes:
  - MS::kSuccess Operation successful

MStatus setViewSelectedSet | ( | const MObject & | set | ) |

Search for all occurrences

Sets the list of objects used by view selected as an object set.

View selected must be turned on for this to have an effect.

Parameters:

  [in] | set | The object set to be used by view selected.

Returns:
  Return status

Status Codes:
  - MS::kSuccess Operation successful
  - MS::kFailure Operation failed

MStatus getObjectsToView | ( | MSelectionList & | list | ) | const

Search for all occurrences

Returns a selection list containing all of the objects on the view selected list.

Parameters:

  [out] | list | The list of objects used by view selected.

Returns:
  Return status

Status Codes:
  - MS::kSuccess Operation successful
  - MS::kFailure Operation failed

MStatus setObjectsToView | ( | const MSelectionList & | list | ) |

Search for all occurrences

Sets the list of objects used by view selected as a selection list.

View selected must be turned on for this to have an effect.

Parameters:

  [in] | list | The objects to view with view selected.

Returns:
  Return status

Status Codes:
  - MS::kSuccess Operation successful
  - MS::kFailure Operation failed

bool viewIsFiltered | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns the state of view filtering for this view.

This includes both view selected state and additional object list filters.

Parameters:

  [out] | ReturnStatus | return status

Returns:
  True if the view is filtered.

Status Codes:
  - MS::kSuccess Operation successful
  - MS::kFailure Operation failed

MStatus filteredObjectList | ( | MSelectionList & | list | ) | const

Search for all occurrences

Returns a selection list containing all of the objects that remain after filtering is applied to the view.

Parameters:

  [out] | list | The list of objects left after filtering.

Returns:
  Return status

Status Codes:
  - MS::kSuccess Operation successful
  - MS::kFailure Operation failed

bool hasStereoBufferSupport | ( |  | ) | const

Search for all occurrences

Returns true if this 3dModelView is running in stereo buffer mode.

This should be used in cases where the API developer has requested to create stereo buffer enabled view. See wantStereoGLBuffer()

MStatus getAsM3dView | ( | M3dView & | view | ) |

Search for all occurrences

Get this MPx3dModelView as a M3dView.

Parameters:

  [in] | view | The M3dView to set as this MPx3dModelView

Returns:
  Return status

Status Codes:
  - MS::kSuccess Method was successful
  - MS::kFailure Method failed

MPx3dModelView * getModelView | ( | const MString & | name,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  | `[static]`

Search for all occurrences

Returns a pointer to a MPx3dModelView that has the passed name with the specified type (the same typed when registering the control).

If one does not exist, then a NULL pointer is returned.

Parameters:

  [in] | name | The name to find
  [out] | ReturnStatus | the return status

Returns:
  A pointer to the MPx3dModelView.

Status Codes:
  - MS::kSuccess Operation successful

bool wantStereoGLBuffer | ( |  | ) | const`[virtual]`

Search for all occurrences

Users should override this method if they want a stereo buffer enabled MPx3dModelView.

You must have a graphics card that can support stereo mode. If your graphics card does not support stereo mode, a non-stereo buffer is created.

Returns:
  true, if you want to create a stereo buffered view

MStatus setInStereoDrawMode | ( | bool | flag | ) |

Search for all occurrences

Derived classes should call this method to indicate to Maya whether the view is currently drawing in stereo.

One place where this is useful to know is for playblast which will check the view to see if it is in stereo mode, and enforce rendering of left and right stereo pairs versus mono rendering.

Parameters:

  [in] | flag | Flag telling if drawing in stereo mode.

Status Codes:
  - MStatus::kSuccess Operation successful
  - MStatus::kFailure Operation failed

bool requestOkForDraw | ( | const MDrawRequest & | request | ) | `[virtual]`

Search for all occurrences

This method provides some filter capabilities as to what is drawn.

When ever a draw operation during the multiple camera drawing, this method will get called. If true is returned, then the object will be drawn.

This method is useful for excluding types of material from the draw loop.

Parameters:

  [in] | request | A MDrawRequest of the object that may be drawn.

Returns:
  true if it is OK to draw the passed object.

const char * className | ( |  | ) | `[static]`

Search for all occurrences

Returns the name of this class.

Returns:
  The name of this class.

Examples:
  narrowPolyViewer.h.

MPx3dModelView MPx3dModelView MPx3dModelView MPx3dModelView MPx3dModelView MPx3dModelView MPx3dModelView MPx3dModelView MPx3dModelView MPx3dModelView
MPx3dModelView MPx3dModelView MPx3dModelView MPx3dModelView MPx3dModelView MPx3dModelView MPx3dModelView MPx3dModelView MPx3dModelView MPx3dModelView