Maya 2020 API update guide

The guide is based on What’s New in the Maya Devkit in Maya 2020 with some extra info. Check the Maya documentation for the most up to date information.

For Mac users, Apple has introduced notarization since OS X 10.14.5 and it is going to be enforced for Applications after 10.15. It requires the host application to declare entitlements for the plug-ins. Although Maya is the parent application, you should be aware that it may cause your plug-in to fail in these Mac releases if Maya didn’t declare the entitlement. Please test your plug-in in both 10.14.5 and 10.15 if possible. For more details please check Notarizing Your App Before Distribution from Apple.

Build environment:

The build environments have been upgraded. Mac has been updated to Mojave 10.14.x with Xcode 10.2.1, and Windows has been updated to Windows 10 with VS2017. Linux remains unchanged.

Platform OS Compiler
Windows Windows 10 x64 Visual Studio 2017
Windows SDK Version 10.0.10586.0
Mac Mojave 10.14.x XCode 10.2.1
Linux CentOS/RHEL 7.3(x>=3) gcc 6.3.1(DTS 6.1)

Developer resources

  • The Maya docs are being updated with API changes. You can find the most up to date information for the API in the What’s New / What’s Changed section.

Autodesk Standard Surface Shader

Introduction

In Maya 2020, a new Maya node called standardSurface will be shipped as a new surface shading node.

Based on the Autodesk Standard Surface specification, it is a renderer agnostic uber surface shader that aims to provide a material representation capable of accurately modeling the vast majority of materials used in practical visual effects and feature animation productions. The next release of Maya will have an implementation of the Autodesk Standard Surface based on version v1.0.1 of the specification.

Purpose and Scope

Using the Standard Surface node will allow more flexibility for rendering and for data interchange between applications.

  • Allows multiple renderers to get similar rendering results by using the same native Maya surface node.
  • Allows scene importer/exporter plugins to keep as much shading information.

Compatibility

The Standard Surface specification is a common base that can be extended (or reduced) by render engines that support it. For example, the Arnold Standard Surface shader has some additional parameters like subsurface_type or exittobackground not defined in the specification. The Arnold renderer plugin for Maya (MtoA) is responsible for extending the Maya Standard Surface node with those specific parameters. On the other side of the spectrum, some real-time renderers might not support some advanced parameters. In this scenario, some simplification can be done by zeroing the combination weights of the unsupported layers like transmission or subsurface for example. See the Compatibility section in the Autodesk Standard Surface specification.

Roadmap

Deprecating the Lambert shader in favor of the Standard Surface as the de facto default surface shader in Maya is the final goal. However since the Lambert shader has been used since the very first version of Maya, we decided to keep it as the default surface shader for now. You can experiment using the standardSurface as the default surface shader in the next release of Maya by setting the environment variable “MAYA_DEFAULT_SURFACE_SHADER” to “standardSurface”.

API Updates

The following classes, methods, and types were added to the Viewport 2.0 API to support the new shader.

  • New classes

    MFnStandardSurfaceShader

  • New types

    MFn.kStandardSurface
    k3dStandardSurfaceShader in MStockShader

  • New methods

    MShaderInstance::addInputFragmentForMultiParams()

Refer to What’s New / What’s Changed and Autodesk Standard Surface specification for details.

Devkit updates

New samples

basicBlendShapeDeformer – Deformer Subsetting: MPxBlendShape plugins
simpleSimulationNode – Cached playback support
pyPanelCanvasInfo.py – Graph Editor overlay drawing support
pyPanelCanvas.py – Graph Editor overlay drawing support

Samples updated

apiMeshShape – Added component selection support to the example and Light plugin enhancements following internal changes to vizualization of objectSets
apiMeshSubSceneOverride – Selection update
viewObjectSetOverride – Light plugin enhancements following internal changes to vizualization of objectSets
footPrintNode_GeometryOverride – rewrite for better caching support
footPrintNode_GeometryOverride_AnimatedMaterial – requireRenderItemUpdate default value to false
geometryOverrideExample1 – requireRenderItemUpdate default value to false
geometryOverrideExample2 – requireRenderItemUpdate default value to false
customImagePlane – Revisited plugin after deprecation of MPxImagePlaneOverride

Samples removed from devkit/plug-ins

geometryOverrideHighPerformance
AnimEngine – A similar AnimX example is available from https://github.com/Autodesk/animx

Headers removed from devkit

MRenderSetupPrivate.h

New headers included

MCacheMode.h
MCacheSchema.h
MPlugin.h
MTimeRange.h

API Updates in Maya 2020

Graph Editor overlay drawing

This feature allow users to draw primitives over the Graph Editor. Several new classes, methods, and examples were added to the API to support Graph Editor overlay drawing.

  • New C++ and Python classes

    MPanelCanvas
    MPanelCanvasInfo

  • New Python samples

    pyPanelCanvasInfo.py
    pyPanelCanvas.py

Cached Playback Support

Your plug-in can now support Cached Playback. These new classes and methods have been added to the API to make it easier for you to define and configure your node for Cached Playback.

  • New classes

    MNodeCacheDisablingInfo
    MNodeCacheDisablingInfoHelper
    MNodeCacheSetupInfo
    MCacheMode
    MCacheSchema
    MTimeRange

  • New methods

    MPxGeometryOverride::configCache()
    MPxNode::configCache()
    MPxNode::transformInvalidRange()
    MPxNode::hasInvalidationRangeTransformation()
    MPxNode::getCacheSetup()
    MPxLocatorNode::getCacheSetup()
    MNodeCacheDisablingInfo::setUnsafeNode()

simpleSimulationNode example have been added to the devkit to showcase the new cached playback APIs.

Refer to C++ API reference for details.

Other New Classes and Methods

Here are a few more classes and methods that have been added to the API. They’re new classes and methods to help with your deformer, selection pass rendering, and iterating over geometry data.

  • New C++ classes

    MGPUEventList
    MIndexMapper

  • New methods for selection pass rendering

    MPxSubSceneOverride::enableUpdateForSelection()
    MFrameContext::getSelectionInfo()

    apiMeshSubSceneOverride example have been updated to use the new methods.

  • New method added to MItGeometry

    MItGeometry::positionIndex()

  • New Python 2.0 classes

    MItGeometry
    MPyIterObject

Refer to What’s New / What’s Changed and the C++ API reference for details.

Fixes and Changes

Several third party libraries have been updated. Some methods which have been changed or fixed as well. If your plug-in uses the following methods, check the docs to see what’s been fixed or changed.

  • Third party libraries

    Boost has been updated to 1.61. Maya is replacing boost with std, some headers have been removed from the boost library shipped with Maya.

    Qt has been updated to Qt 5.12.5.

  • OSX Plugin export symbols
    If you wanted to update your existing plugin makefile for Mac, here are the export symbols.

    __Z16initializePluginN8Autodesk4Maya16OpenMaya202000007MObjectE
    __Z18uninitializePluginN8Autodesk4Maya16OpenMaya202000007MObjectE

  • Fixed feature

    MPxTransform::boundingBox() and MPxTransform::isBounded()

  • Change in signature

    MFnPlugin::registerEvaluator()
    MPxNode::configCache()
    MFnPlugin::registerImageFile()
    MeshIntersector::create()

  • Change in default value

    MPxGeometryOverride::requireRenderItemUpdate

    footPrintNode_GeometryOverride_AnimatedMaterial, geometryOverrideExample1, and geometryOverrideExample2 examples have been updated to reflect this change.

Refer to What’s New / What’s Changed for details.

Deprecated classes

Creating custom image plane has been simplified. If you’re creating a custom image plane, you may want to update your plug-in because the following class have been deprecated.

MPxImagePlaneOverride

Refer to What’s New / What’s Changed for details.
`