The MUIDrawManager::mesh() interface has been overloaded and a new interface added to support float data types.
void mesh( Primitive mode, const MFloatPointArray& position, const MFloatVectorArray* normal = NULL, const MColorArray* color = NULL, const MUintArray* index = NULL, const MFloatPointArray* texcoord = NULL );
The following MPxSelectionContext::doPress(), MPxSelectionContext::doRelease(), MPxSelectionContext::doDrag(), and MPxSelectionContext::doHold() virtual functions have been added to handle mouse events for Viewport 2.0.
Now when you derive a class from MPxSelectionContext, you can override these functions to handle mouse events such as a button press or release:
To ensure that your plug-in works correctly in both the Legacy Default Viewport and Viewport 2.0, you can keep the legacy implementation of MPxSelectionContext unchanged, but you must override the Viewport 2.0 implementation.
See the moveTool devkit example for more information.
You can validate the shader fragments by compiling and binding a shader instance generated from the final effect source. To enable the fragment debugging code path, set the following environment variable: MAYA_CUSTOMSPRITESHADER_DEBUG_FRAGMENTS = 1. Shader compilation errors or warnings can be displayed in the Maya Script Editor. When errors or warnings occur, modify the fragments in XML. After updating, restart Maya and reload the scene the test your fixes.
See the customSpriteShader/customSpriteShader.cpp plug-in example for more information.
The plug-in connects geometry shader fragments by creating a shader instance from a fragment graph using MShaderInstance::addInputFragment(). The fragment graph connections, properties, values, and outputs are defined by an XML schema.
An implementation of color management on the input texture is also included in the supplied customFileTextureOutputColor.xml file. This file shows how Maya converts texture color from sRGB space or linear space. You can also use the existing MShaderInstance::createShaderInstanceWithColorManagementFragment() interface, or refer to customFileTextureOutputColor.xml for custom implementation of color management depending on your specific needs. The MPxShaderOverride::isTransparent() virtual method handles transparency notifications.
For debugging the shader fragments, the final effect source of the shader instance is written to disk using a new MShaderInstance::writeEffectSourceToFile() interface. Shader compilation errors can be displayed in the Maya Script Editor, during binding, or queried using MShaderManager::getLastError().
The customSpriteShader plug-in supports all Viewport 2.0 OpenGL Core Profile, OpenGL, and DirectX 11 modes.
You can now access and query for camera near and far planes from shaders using uniform or semantic parameters. For effects generated from a file or buffer, new parameters with semantics have been added to the MUniformParameter class DataSemantic enumerators. These uniform parameters provide access to near and far clipping planes in full effects created by the MPxShaderOverride class.
For shader fragments, a parameter with semantics nearClipPlane and farClipPlane are automatically updated by Viewport 2.0.
These updates do not require plug-in source code changes or recompiling.
The new functions include:
The rawfootPrintNode plug-in example has been updated to demonstrate the use of the new functions.
A new customImagePlane/customImagePlane.cpp example for C++ and Python demonstrates how to use the new MPxImagePlaneOverride class and includes how to:
Note that depth map updates still need to be done using MPxImagePlane::loadImageMap().
Error: line 0: Failed to create evaluator for "drawdb/geometry/apiMesh" classification because the current drawing API isn't supported.
This update coincides with Maya's internal changes, which allow texture sizes to be greater than the upper limit of int type of 2^31. Note that this change breaks existing code and requires plug-ins to be updated and recompiled.
The following plug-in examples have been updated with this parameter change:
const MFrameContext* getFrameContext() const;
For example, the previous implementation required the following call to release a render target:
targetManager->releaseRenderTarget((MHWRender::MRenderTarget*)colorTarget);
Can now be simplified to the following:
targetManager->releaseRenderTarget(colorTarget);.
As part of the OpenMaya namespace implementation, the following OpenMayaRender classes have be renamed to maintain backwards compatibility:
MGeometry renamed to MGeometryLegacy
MGeometryRequirements renamed to MGeometryRequirementsLegacy
MRenderTarget renamed to MRenderTargetLegacy
For more information about the OpenMaya namespace, see Important updates to the Maya API.