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.
Build environment:
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.
Platform | OS | Compiler |
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) |
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.
-
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:
MAYA_BATCH_STDOUT_LOGGING_LEVEL
andMAYA_BATCH_STDERR_LOGGING_LEVEL.
-
Opting out of analytics in batch mode - Analytics will run by default when Maya starts in batch mode. Set
MAYA_DISABLE_ADP
to 1 to opt out of analytics. -
AutoLoadOnce added to PackageContent.xml - A new option,
AutoLoadOnce
has been added toPackageContents.xml
that 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:
FBXExtPlugin
andmimicManipulation
. Several new flags and options were added along with changes to some.
Python Updates
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, runmaya.exe -pythonver 2
on command window. - Set the environment variable
MAYA_PYTHON_VERSION
to 2. For example, setMAYA_PYTHON_VERSION
to 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 2
on Windows or./Render -pythonver 2
- Python 3: Run
Render.exe -pythonver 3
on 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>
- Windows:
mayapy -m pip <command>
API Updates
-
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 -
MayaQclocaleDoubleValidator
was added tomaya.internal.common.qt.doubleValidator
to accomodate locales where decimal values use commas instead of periods. -
New class in OpenMayaAnim module -
MFalloffContext
-
New class added as part of the GPU deformer upgrades -
MFnFloatVectorArrayData
has been added to provide access toMFloatVectorArray
. -
New class and methods to perform MRenderItem-specific evaluations -
MPxViewportComputeItem
,MRenderItem::addViewportComputeItem()
, andMRenderItem::viewportComputeItem()
. -
New syntax for Python iterators - The newly-added syntax calls
next
with the iterator as the parameter:next(iterator)
. -
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 ifListAdjustment
is set tokReplaceList
, otherwise it will do nothing. -
Deprecated method and changed behavior in MCacheSchema - The method
reset()
has been deprecated andattributes()
is now a range overMObject
rather thanMPlug
. -
Changes to MItGeometry constructors - Two new constructors have been added for
MItGeometry
. -
Changes to MRenderItem - Six new methods have been added to
MRenderItem
. Three methods have been deprecated. -
New attribute and method added to MPxGeometryFilter - The
componentTagExpression
attribute has been added toMPxGeometryFilter
in theOpenMayaAnim
module. -
New interface added to MRenderOverride in the OpenMayaRender module - New interface added to
MRenderOverride
to override the default Viewport 2.0 selection -
New methods added to MSelectionInfo in the OpenMayaRender module - Two new methods were added to
MSelectionInfo
. -
New methods and types added to MFnGeometryData to support component tags - Several new methods and types added to
MFnGeometryData
to support component tags -
New methods and types added to MItDependencyGraph - Several new methods and types have been added to
MItDependencyGraph
to allow for traversing on graphs based on different relations. -
New methods added to MFragmentManager - Two new methods were added to
MFragmentManager
to 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 toMSelectionList
. -
New method added to MDGModifier -
deleteNode()
has been added toMDGModifier
. -
New methods added to MPxGPUDeformer - Two new methods have been added to
MPxGPUDeformer
. -
New method added to MFnNurbsCurve -
findParamFromLength()
has been added toMFnNurbsCurve
. -
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
MGPUDeformerRegistrationInfo
. -
Changes to MGPUDeformerBuffer - Two new methods added to
MGPUDeformerBuffer
, and the signature forMGPUDeformerBuffer()
has been changed. -
Signature changes in MGPUDeformerData and MPxGPUDeformer classes - The signature for
MGPUDeformerData::getBuffer()
andMPxGPUDeformer::evaluate()
has changed. -
New argument added to MPxCommand.setResult - A new argument,
append
, has been added toMPxCommand.setResult
in Python API 2.0
Devkit Updates
-
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
py1
prefix and Python 2.0 examples havepy2
prefix. Python examples have been moved fromscripting
directory topython
directory. -
New examples - Six new examples added to the devkit:
customComponentTagNode
,exampleFalloff
,basicMorphNode
,simpleSkipNode
,evaluationPruningEvaluator
, andnarrowPolyRenderOverride
-
Updated examples - Six examples have been updated:
offsetNode
,threadingLockTests
,moveManip.py
,blindDoubleDataCmd.py
,glslShader
, andmanipOverride
. -
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:
gpuCache
,AbcBullet
,AbcImport
,AbcExport
-
Removed examples - Two examples removed from the devkit:
exampleCameraSetView
,narrowPolyViewer
Scripting Updates
-
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:
convertToComponentTags.py
,snapTransform.py
, andgameVertexCount
-
New commands - Two new commands:
FBXExtPlugin
,mimicManipulation
-
New flags and options New flags and options added to these commands:
file
,outlinerEditor
,sets
,deformerEvaluator
,filterCurve
,optVar
,geometryAttrInfo
,deformableShape
, andghosting
-
Changed flags and options - Changes made to:
deformableShape
,deleteAttr
,affectedNet
,dynExpression
, andcutKey
-
Removed script -
performSkinCluster.mel
have been removed.
Please refer to What's New / What's Changed in the Developer Help documentation for details.
Comments