Maya 2022 API Updates

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 and MAYA_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 to PackageContents.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 and mimicManipulation. 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:

  1. Start Maya from the command line with -pythonver 2. For example, run maya.exe -pythonver 2 on command window.
  2. Set the environment variable MAYA_PYTHON_VERSION to 2. For example, set MAYA_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

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 have py2 prefix. Python examples have been moved from scripting directory to python directory.

  • New examples - Six new examples added to the devkit: customComponentTagNodeexampleFalloffbasicMorphNodesimpleSkipNodeevaluationPruningEvaluator, and narrowPolyRenderOverride

  • Updated examples - Six examples have been updated: offsetNodethreadingLockTestsmoveManip.pyblindDoubleDataCmd.pyglslShader, and manipOverride.

  • 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: gpuCacheAbcBulletAbcImportAbcExport

  • Removed examples - Two examples removed from the devkit: exampleCameraSetViewnarrowPolyViewer

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.pysnapTransform.py, and gameVertexCount

  • New commands - Two new commands: FBXExtPluginmimicManipulation

  • New flags and options New flags and options added to these commands: fileoutlinerEditorsetsdeformerEvaluatorfilterCurveoptVargeometryAttrInfodeformableShape, and ghosting

  • Changed flags and options - Changes made to: deformableShapedeleteAttraffectedNetdynExpression, and cutKey

  • Removed script - performSkinCluster.mel have been removed.

Please refer to What's New / What's Changed in the Developer Help documentation for details.


Comments

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading