What's New in API in Maya 2016

The Maya 2016 Developer Kit is now available online at Autodesk Exchange at https://apps.exchange.autodesk.com/MAYA/en/Home/Index.

Jump to the following sections:

API compatibility

Maya 2016 Extension 2 is not binary compatible with Maya 2016. To obtain the Maya 2016 and Maya 2016 Extension 1 API Guide, see http://www.autodesk.com/me-sdk-docs-2016.

C++ plug-ins that were compiled against Maya 2016 or Maya 2016 Extension 1, including Maya 2016 service pack releases, must be re-compiled against Maya 2016 Extension 2 in order to be recognized by this version of Maya.

In addition, plug-ins compiled against Maya 2016 Extension 2 will either not load or exhibit unpredictable behavior if loaded in Maya 2016, Maya 2016 Extension 1, or any Maya 2016 service pack release.

Python API 2.0

Since Extension for Maya 2015, 23 new classes have been added to the Python API 2.0 and additional developer kit examples are also available in the plug-ins\scripted directory of the Maya Developer Kit. All Python API 2.0 developer kit examples are named with the prefix py.

For a list of Python classes added since Extension for Maya 2015, see New Python API 2.0 classes in Maya 2016.

The Python Learning Path is updated to include Python API 2.0 examples.

For more information, see Maya Python API 2.0 Reference.

Rendering

OpenMayaRender

UI Draw Manager Enhancements

MShaderInstance Enhancements

MShaderManager Enhancements

MRenderItem Enhancements

Shader Fragment Enhancements

MFrameContext Enhancements

MDrawContext Enhancements

MRenderOverride Enhancements

MRenderOperation Enhancements

MRenderUtilities Enhancements

MPxSubSceneOverride Enhancements

MRenderTarget Enhancements

MTexture Enhancements

MTextureManager Enhancements

MPxDrawOverride Enhancements

MPxShaderOverride Enhancements

The following new method allows plug-in writers to supply a shader to be used in non-textured mode. If this method is not specified, then a fixed grey shader is always used:

MVertexBuffer and MIndexBuffer Enhancements

Component selection

MPxGeometryOverride Enhancements

MDrawRegistry Enhancements

MPxSubSceneOverride Enhancements

New classes: MSelectionContext, MIntersection, MSelectionInfo and MPxComponentConverter were added to support component selection in Viewport 2.0.

Note: The new component selection classes and interfaces only take into effect if either of the following conditions are true, in which case hardware selection is enabled:

Utilities Enhancements

Manipulators Enhancements

Varying parameters Enhancements

Implement a 3rd party renderer in the Hypershade

Renderer Enhancements

Renderer notifications

Renderer output target size override

The following convenience methods were added to MRenderer:

Color management enhancements

Shader semantics supported by Viewport 2.0

The list of Semantics supported by Viewport 2.0 has been updated.

Developer Kit examples

Documentation updates

Animation

OpenMaya

Added the following new classes to support GPU override deformers:

MPxMotionPathNode

A new MPxMotionPathNode class has been added, and is the base class for user defined motionPath nodes. It allows you to create your own motion path classes by providing methods that specify how the position, orientation and other attributes of connected nodes transform based on the position along the path. You can follow either of these workflows to use the MPxMotionPathNode class:

The advantage of MPxMotionPathNode over the built-in motionPath node is the ability to control how calculations are performed. Here are some examples of how you can create effects using the MPxMotionPathNode node:

MPxAnimCurveInterpolator

MPxAnimCurveInterpolator is a new class that you can derive from to create user-defined animation curve interpolation types. It dictates how an animation curve evaluates between two keyframes.

OpenMayaAnim

Added the following new classes to support GPU override deformers:

Deformer classes have been re-organized. New classes:

OpenMayaUI

Developer Kit examples

Modeling

OpenMaya

MPolyMessage enhancements:

MFnMesh enhancements

OpenMayaUI

New context proxy class

New command proxy class

MPxContext Enhancements

Profiler

When you instrument a procedure using MProfilingScope, you can also register an associated DG node. This way, when you select an instrumented event in your Profiler graph, its associated DG node is also selected and displayed in the Attribute Editor, Outliner or Node Editor.

MProfilingScope::MProfilingScope() now accepts an optional input parameter: an MObject that points to the associated node of the procedure being instrumented.

The MObject input parameter must point to a DG node and cannot point to an attribute or a component.

Example as follows:

import maya.OpenMaya as OpenMaya
import maya.cmds as cmds

testCategoryIndex = cmds.profiler(addCategory = "testCategory")

def associatedNode():
    # Create a cone
    myCone = cmds.polyCone()
    mSelList = OpenMaya.MSelectionList()
    OpenMaya.MGlobal.getActiveSelectionList( mSelList)
        
    # Prepare the MObject to point to the cone.
    coneObj = OpenMaya.MObject()
    mSelList.getDependNode(0, coneObj)

    # Instrument the procedure and register its associated DG node; that is the cone node that was just created.
    profiler = OpenMaya.MProfilingScope(testCategoryIndex, OpenMaya.MProfiler.kColorE_L1, "associatedNode", "associatedNodeDesc", coneObj)
    cmds.select( myCone[0] )
    cmds.rotate( '45deg', 0, 0, r=True )

cmds.profiler(sampling = True)
associatedNode()
cmds.profiler(sampling = False)

64-bit integer support

The Maya C++ API now supports 64-bit integers. The following interfaces have been added:

Limitations:

General

Universally Unique Identifiers (UUID's) for nodes

Python equivalent to MDGModifier::commandToExecute() added

A new MDGModifier::pythonCommandToExecute() has been added that allows you to add an operation that executes a Python command/script to a dependency graph modifier.

This is the Python equivalent of the method MDGModifier::commandToExecute().

Removed classes

The obsolete classic cloth MCloth classes have been removed.

.NET API

MPxShaderOverride non-virtual protected methods are now exposed in the .NET API, and you can use them to render your materials in Viewport 2.0: