Maya's API version has been updated (MAYA_API_VERSION is now 201700). Note that all plug-ins compiled against Maya 2016, including Maya 2016 Extension 1, 2 or service pack releases, must be re-compiled against Maya 2017 in order to be recognized by this version of Maya.
Maya now uses Qt version 5.6.1 and PySide version 2.0.
See Building the plug-in for updated instructions on how to build Qt plug-ins.
The Developer Kit is available online at Autodesk Exchange at https://apps.exchange.autodesk.com/MAYA/en/Home/Index.
The Maya 2016 Extension 2 API Guide is available online at http://www.autodesk.com/maya-sdkdoc-2016-enu. You can also obtain a downloadable version at http://www.autodesk.com/me-sdk-docs-2016.
The downloadable version of the Maya 2016 and Maya 2016 Extension 1 API Guide is available at http://www.autodesk.com/me-sdk-docs-2016.
Jump to the following sections:
A viewRenderOverrideFromFragments example plug-in has been added which demonstrates the use of a set of new APIs that allow you to use scripted fragment and fragment graphs to render the scene and any desired post effects. Script fragments are the building blocks used internally by Maya for standard viewport rendering effects, and are located in a series of .xml files in the bin/ScriptFragment folder of your Maya installation directory.
The following API classes and interfaces have been added to enable you to create a fragment renderer:
Derive from this class to create a callback function that can be registered and called from your script fragment .xml. Implement the execute() function which allows you to obtain the MRenderParameters from the current renderer graph and three optional values coming from the script. Use this method to compute any desired behavior and call MRenderParameters::setParameter() to pass the results back to the script or to other connected fragments in the graph. See the Call command in the Script fragment commands topic for more information.
See Write fragments and fragment graphs to render to the viewport.
See the footPrintNode_GeometryOverride Developer Kit example for more information. See also Selection mask usage.
This method is also available for Python API 2.0.
See the viewObjectSetOverride plug-in example in the Developer Kit.
To achieve the best performance, set this parameter to False, and refrain from using the static draw callback.
See the pyFootPrintNode.py Developer Kit example for more information.
When MShaderInstance::createShaderInstanceWithColorManagementFragment() is used to add a color management fragment to an MShaderInstance, any pre or post render callbacks set on the shader instance are no longer lost. Previously they would both be set to null.
Refer to the uiDrawManager and lineManipContainer (C++ API) and the pyUiDrawManager.py (Python API 2.0) Developer Kit examples for more information.
A new method has been added:
const MFrameContext* MRenderOverride::getFrameContext()
This method allows access to the current frame render context information which is available between MRenderOverride::setup() and MRenderOverride::cleanup(). Per object / render item information is not available at setup time as the pipeline has not yet been run. Note that this provides information regardless of whether the override is called for viewport, Playblast, Render View or batch rendering.
See the pyFrameContexTest.py plug-in example which demonstrates the use of MRenderOverride.getFrameContext() to extract various per-frame data.
It is now possible to combine a custom draw override with internal Viewport 2.0 lighting support by specifying both a "drawdb/light" and a "drawdb/geometry" classification when registering a node.
A sample use case is to draw a custom object in the viewport that performs lighting in Viewport 2.0 as a native Maya light would. See the apiDirectionalLightShape plug-in example and Registration for more information.
The access of vertex ids, face ids and local parameterization is now exposed via the MGeometryExtractor interface. To extract completely unshared geometric data from a DAG shape, kPolyGeom_NotSharing needs to be specified when constructing an MGeometryExtractor instance.
Similar to MPxShaderOverride, there is no new interface on MGeometryExtractor that requests vertex ids, face ids or local parameterization. Instead MVertexBufferDescriptor should be specified with the following semantic names to populate these vertex buffers:
Refer to the geometryReplicator plug-in example for more information. To execute this plug-in example, first set the following environment variables, then assign a hwPhongShader to the geometryReplicator shape.
New API extensions have been added that let you define custom evaluators. Custom evaluators allow you to override how DG nodes are scheduled and executed by the evaluation manager. See Custom evaluator overview. See also MPxCustomEvaluator and the simpleEvaluator and constraintEvaluator plug-in examples in the Developer Kit.
A new MObjectHandle::objectHashCode() interface has been added that allows you to return a hash code for the provided MObject without having to construct or destruct MObjectHandle. You should use this interface instead of MObjectHandle::hashCode() if your plug-in is threaded because the construction and destruction of MObjectHandle are not thread safe.
A new MPxAssembly::postActivateRep() virtual function has been added that provides the assembly with an opportunity to perform operations on it after the representation has been activated.
This method is also available for Python API 2.0.
This method is also available for Python API 2.0.
The Maya Viewport 2.0 whitepaper can be found at http://www.autodesk.com/developmaya.
This document is divided into two parts. The first (Viewport 2.0 API Porting Guide) is an overview of Viewport 2.0 and outlines the differences between the legacy default viewport and Viewport 2.0. The second part (Viewport 2.0 API Porting Guide Details) is more detailed and specifies the recommended interfaces and provides code examples for common tasks.
The Improving Performance with Parallel Evaluation whitepaper can be found at http://www.autodesk.com/maya-docs.
Refer to this document for information on how to use the new Evaluation Manager feature to improve playback and manipulation of your animated scenes through scene-level graph analysis and parallelization. In addition, it provides information on the API extensions that your plug-in can implement to take advantage of these features, as well as guidelines on how to use the Profiler to evaluate performance in your scene.