Maya 2022 API Update guide
The guide is based on What's New in the Maya Devkit in Maya 2022 with some extra info. Check the Maya documentation for the most up to date information.
The build environments have been upgraded. Mac still uses Mojave 10.14.x with Xcode 10.x, and Windows remains Windows 10 with an upgrade to VS2019. Linux has been updated to CentOS/RHEL 7.6 or above and DTS 9.1.
|Windows||Windows 10 x64||Visual Studio 2019|
|Mac||Mojave 10.14.x||XCode 10.2.1|
|Linux||CentOS/RHEL 7.6+ and 8.2+
(8.0 and 8.1 are missing some system packages)
|gcc 9.3.1 (DTS 9.1)|
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.
For those who are part of the Feedback community, there is an additional resource to help determine if your plug-in needs to be recompiled for Maya 2022. The product team is posting API compatibility reports in the Feedback forum for every PR release so check it out.
Changes in Maya 2022 at a glance
Python 3 support - Python 3 support is now available for all OS. Python 2 is still supported on Linux and Windows only.
Changes to third party components - Qt and PySide updated to version 5.15.2. Updates made to Alembic and OpenEXR libraries. Qt Creator Tools will not be distributed in their entirety. The pysideuic module has been deprecated by QtC and replaced by the pyside2-uic script.
Unicode characters support in Script Editor - Scripts are now saved using UTF-8 encoding as prescibed by PEP-263.
New environment variables - Two new environment variables added to control what is the output to stderr and stdout:
Opting out of analytics in batch mode - Analytics will run by default when Maya starts in batch mode. Set
MAYA_DISABLE_ADPto 1 to opt out of analytics.
AutoLoadOnce added to PackageContent.xml - A new option,
AutoLoadOncehas been added to
PackageContents.xmlthat is used when distributing plug-ins using the App Store format.
API changes - New smart pointer, classes, methods, and attributes have been added along with some changes made to the API.
Changes to Devkit examples - Several examples have new node IDs. Python examples have been renamed and moved. New examples added to the Devkit and some have been updated.
Scripting changes - Some commands now accept UFE path strings. Two new commands:
mimicManipulation. Several new flags and options were added along with changes to some.
Maya starts up in Python 3 by default
Note: Maya on Windows and Linux supports both Python 2 and Python 3. Maya on macOS only supports Python 3.
To ways to start Maya in Python 2 mode:
- Start Maya from the command line with
-pythonver 2. For example, run
maya.exe -pythonver 2on command window.
- Set the environment variable
MAYA_PYTHON_VERSIONto 2. For example, set
MAYA_PYTHON_VERSIONto 2 in the command window, then start Maya from the same command window.
Render.exe and Render.sh can now run in either Python 2 or Python 3 mode
- Python 2: Run
Render.exe -pythonver 2on Windows or
./Render -pythonver 2
- Python 3: Run
Render.exe -pythonver 3on Windows or
./Render -pythonver 3.
New pip support
mayapy now supports installing Python 3 modules with pip. To use pip with
mayapy, use the follow command:
- Linux and macOS:
./mayapy -m pip <command>
mayapy -m pip <command>
New smart pointer -
MSharedPtr<>has been added to Maya. They are used in the Maya API to make object ownership explicit.
New validator for decimal indicators -
MayaQclocaleDoubleValidatorwas added to
maya.internal.common.qt.doubleValidatorto accomodate locales where decimal values use commas instead of periods.
New class in OpenMayaAnim module -
New class added as part of the GPU deformer upgrades -
MFnFloatVectorArrayDatahas been added to provide access to
New class and methods to perform MRenderItem-specific evaluations -
New syntax for Python iterators - The newly-added syntax calls
nextwith the iterator as the parameter:
Changed behavior for MGlobal::setActiveSelectionList() -
MGlobal::setActiveSelectionList()will behave as expected: when it is called with an empty selection list, it will delete the list if
ListAdjustmentis set to
kReplaceList, otherwise it will do nothing.
Deprecated method and changed behavior in MCacheSchema - The method
reset()has been deprecated and
attributes()is now a range over
Changes to MItGeometry constructors - Two new constructors have been added for
Changes to MRenderItem - Six new methods have been added to
MRenderItem. Three methods have been deprecated.
New attribute and method added to MPxGeometryFilter - The
componentTagExpressionattribute has been added to
New interface added to MRenderOverride in the OpenMayaRender module - New interface added to
MRenderOverrideto override the default Viewport 2.0 selection
New methods added to MSelectionInfo in the OpenMayaRender module - Two new methods were added to
New methods and types added to MFnGeometryData to support component tags - Several new methods and types added to
MFnGeometryDatato support component tags
New methods and types added to MItDependencyGraph - Several new methods and types have been added to
MItDependencyGraphto allow for traversing on graphs based on different relations.
New methods added to MFragmentManager - Two new methods were added to
MFragmentManagerto add and remove, respectively, a specific shader stage's input parameters. Three new methods were added to manage the mapping between parameter names and transient names.
New method added to MSelectionList -
getPlug()have been added to
New method added to MDGModifier -
deleteNode()has been added to
New methods added to MPxGPUDeformer - Two new methods have been added to
New method added to MFnNurbsCurve -
findParamFromLength()has been added to
New methods added to MEvaluationNode - Two new methods have been added to
MEvaluationNode. A new example,
simpleSkipNode, has been added to demonstrate the use of these new methods.
New methods added to MPxCustomEvaluator - Two new methods have been added to
MPxCustomEvaluator. A new example, evaluationPruningEvaluator, has been added to demonstrate the use of these new methods.
New methods added to MGPUDeformerRegistrationInfo - Four new methods have been added to
Changes to MGPUDeformerBuffer - Two new methods added to
MGPUDeformerBuffer, and the signature for
MGPUDeformerBuffer()has been changed.
Signature changes in MGPUDeformerData and MPxGPUDeformer classes - The signature for
New argument added to MPxCommand.setResult - A new argument,
append, has been added to
MPxCommand.setResultin Python API 2.0
New node IDs for several examples - Changes were made to ensure that the node IDs used in all examples were unique. Examples with node ID changes will need to be recompiled.
Python examples have been moved and renamed - Python 1.0 examples have been renamed to have
py1prefix and Python 2.0 examples have
py2prefix. Python examples have been moved from
New examples - Six new examples added to the devkit:
Updated examples - Six examples have been updated:
Alembic examples updated to only support Ogawa Alembic files - Maya no longer supports HDF5 variants of Alembic. These examples now only support Ogawa Alembic files:
Removed examples - Two examples removed from the devkit:
UFE-aware commands - Some commands now accept UFE path strings. Commands that are UFE-aware will have different syntax than non-UFE-aware commands.
New plug-ins - Three new plug-ins:
New commands - Two new commands:
New flags and options New flags and options added to these commands:
Changed flags and options - Changes made to:
Removed script -
performSkinCluster.melhave been removed.
Please refer to What's New / What's Changed in the Developer Help documentation for details.