Use MPxLocatorNode legacy fixed draw code and selection in Viewport 2.0

It is possible to reuse Viewport 1 rendering and picking when using the Viewport 2.0 renderer for plug-in locators. However, this should only be considered a temporary solution to allow for an incremental migration to Viewport 2.0. The final aim should be to re-implement rendering using a geometry or subscene override for proper integration.

Enabling

To reuse the VP1 drawing code implementation when using the Viewport 2.0 renderer, set the environment variable MAYA_ENABLE_VP2_PLUGIN_LOCATOR_LEGACY_DRAW to any value.

To re-enable the VP1 draw code for selection, set the environment variable MAYA_VP2_USE_VP1_SELECTION to any value. If this environment variable is not set, then the selection picking is only performed on the locator's bounding box center.

Requirements and limitations

  • You must run Viewport 2.0 in OpenGL - Core Profile (Compatibility) or OpenGL - Legacy mode
    • OpenGL - Core Profile (strict) mode is not supported, as it does not allow a fixed function pipeline to be run.
    • DirectX 11 mode is not supported.
  • OpenGL state may not be set up in the same way as the Legacy Default Viewport. Legacy draw code should be careful not to make assumptions about the initial state.
    • It is the responsibility of the legacy draw code to set up fixed function state such as lighting, and so forth.
  • It is the responsibility of the legacy draw code to ensure that it does not corrupt any OpenGL state.
  • There is no guarantee of equivalent performance when compared to:
    • Legacy viewport drawing
    • A geometry/subscene override implementation for Viewport 2.0
  • Optimizations from Viewport 2.0 are not supported (for example, consolidation).
  • Not all selection options may be supported.