What's New in the Maya 2022.1 devkit

Important:

Updates to Maya 2022 will continue to support both Python 2 and Python 3. However, it is recommended that you migrate your Python 2 scripts and plug-ins to Python 3.

What's new in Maya 2022.1 at a glance

Change to the way maya.api.OpenMaya.MFnMesh() handles empty meshes

maya.api.OpenMaya.MFnMesh() in the Maya Python API 2.0 now returns an error when it is initialized with an empty mesh. This aligns it with the way maya.OpenMesh.MFnMesh() Maya Python API 1.0 handles empty meshes.

Back to top

isValidReference() added to MFnReference

A new method, isValidReference() has been added to MFnReference:

bool isValidReference(MStatus* ReturnStatus = NULL) const

The method returns true if the reference is a valid file reference. This method is used to validate a file reference before passing it to other methods, such as MFnReferemce::isLoaded(), to avoid triggering an exception.

Back to top

uniqueName() added to MFnDependencyNode

A new method, uniqueName() has been added to MFnDependencyNode:

MString uniqueName(MStatus* ReturnStatus = NULL) const

Back to top

New overloaded getReferenceNodes() method added to MFileIO

A new overloaded getReferenceNodes() that has dagPath as a parameter has been added to MFileIO.

MStatus MFileIO::getReferenceNodes(const MString& fileName, MStringArray& nodes, bool dagPath)

When dagPath is set to true, the names of any returned dag objects will include enough path to make their names unique. When set to false, the names of the dag objects are returned without a path.

dagPath is false by default, and getReferenceNodes(const MString& fileName, MStringArray& nodes) will return the names of dag objects without their paths.

Back to top

New selection levels added to MHWRender::MSelectionContext::SelectionLevel

Three new selection levels have been added to the MSelectionContext::SelectionLevel enum that specifies the granularity to use for a Viewport 2.0 selection:

MSelectionContext::setSelectionLevel() can now take any one of five selection levels: kComponent, kObject, kFace, kEdge, and kVertex.

Similarly, MSelectionContext::selectionLevel() can now return any one of five selection levels: kComponent, kObject, kFace, kEdge, and kVertex.

MIntersection::selectionLevel() will continue to return either kObject or kComponent.

Back to top

New enum and new methods added to MHWRender::MRenderItem

A new enum and two new methods have been added to MHWRender::MRenderItem so that a MRenderItem can be filtered based on the default material setting of the viewport.

enum DefaultMaterialFiltering specifies how to handle drawing when the default material mode is active.

void setDefaultMaterialHandling(MRenderItem::DefaultMaterialFiltering state) determines whether this object should be drawn when default material mode is active.

MRenderItem::DefaultMaterialFiltering getDefaultMaterialHandling() const returns whether this render item will draw when default material mode is active.

Back to top

MFn.kAttribute2Long and MFn.kAttribute3Long have been deprecated

The MFn.kAttribute2Long and MFn.kAttribute3Long Maya Python API 2.0 attributes have been deprecated. Use MFn.kAttribute2Int and MFn.kAttribute3Int instead.

Back to top

Generating Python code from ui files using pyside2-uic

pyside2-uic and pyside2-rcc are now included with Maya.

Users can now use pyside2-uic to generate Python code from their .ui files.

Back to top

Changes to the duplicate and internalVar commands

Back to top

Qt distribution now includes QML

Maya's Qt distribution now includes QML

Corrected a version error in the Open Source Component list

The FreeImage and FreeType versions were corrected in the 2022 Open Source Components list.

The correct versions are:

Back to top