The apiMeshShape example has been updated to use OpenGL.
A README included with the example provides information on how to migrate your code to use OpenGL calls instead of glFunctionTable
.
Python API 2.0 now includes MFnAssembly
.
componentTag
command has been added.-fullNodeName
, -nodeName
, and -attributeType
options have been added to the listAttr
command.-fullNodeName
option has been added to the listConnections
and listHistory
commands.Two new classes, MDisplayLayerMessage
and MFnDisplayLayer
, have been added to the Maya devkit. These two classes help communicate what has changed in a display layer.
MDisplayLayerMessage
registers callbacks for display layer membership changes. MFnDisplayLayer
is the function set for querying the contents of a display layer.
A new method, setOverrideBlendState()
has been added to MHWRender::MUIDrawManager
.
void setOverrideBlendState (const MHWRender::MTargetBlendDesc &blendStateDesc)
setOverrideBlendState()
lets you specify a new blend state to override the default blend state of the UI painter. The new blend state can be any configuration that can be set with an MTargetBlendDesc
, including premultiplied alpha blending.
The overriding blend state applies to any mesh-like UI objects drawn through the draw manager, such as a mesh, line, point, circle, or sphere. It does not apply to text or icon UI objects.
Two new methods, setDrawLast()
and isDrawLast()
, have been added to MRenderItem
.
void MRenderItem::setDrawLast(bool state)
bool MRenderItem::isDrawLast()
Passing true
to setDrawLast()
indicates that the render item should be drawn after all other objects in the scene.
isDrawLast()
returns true
if the item will be drawn last in the scene. It returns false
otherwise.
The about
command's -ltVersion
option has been deprecated and has been updated to -creativeVersion
. If about -creativeVersion
is called from within Maya, it will return 0. If about -creativeVersion
is called from within Maya Creative, it will return 1.
These additional scripting changes were also made in 2023.2:
keyTangentControl
command has been added.-readOnly
and -highlightMode
options have been added to both the gradientControl
and gradientControlNoAttr
commands.-verticalScrollPosition
option has been added to the treeView
command. -rebuildCommand
option has been added to the channelBox
command.A new method, inAlternateContext()
has been added to MPxContext
. This method returns true when an alternate context is active.
bool MPxContext::inAlternateContext() const
-paintChannel
option has been added to the artAttrPaintVertexCtx
command.-displayColorAsGreyScale
has been added to the polyOptions
command.The new minimum version of macOS is 10.14.
Devkit examples now require CMake version 3.13 or later to compile.
The Alembic libraries have moved. This change should be transparent as long as you are using the find_alembic
macro in your CMakeLists.txt
files.
If you are not currently using library macros, you are strongly encouraged to do so.
Maya now only supports Python 3. Support for Python 2 has been removed on all platforms. You will need to update your plug-ins and scripts to Python 3.9.
If you have plug-ins or scripts written in Python 3.7, you may encounter issues when porting them to Python 3.9 as code compatibility is not guaranteed between these two versions.
PySide now also builds with Python 3.9.
Consult What's New in Python 3.8 and What's New in Python 3.9 for details.
New site-package directories specific to Maya's release version have been introduced.
Operating system | Path to new site-packages location |
---|---|
macOS | $HOME/Library/Preferences/Autodesk/maya/2023/scripts/site-packages |
linux | $HOME/maya/2023/scripts/site-packages |
Windows | C:/Users/<username>/Documents/maya/2023/scripts/site-packages |
This is an added directory. Packages will not be moved to this directory, and this directory will not replace any existing directories. However, packages in this directory will be prioritized over Maya's own site-packages directory.
Use the pip
--target
option to install packages to this location:
mayapy -m pip install <package_name> --target <full_path_to_maya_2023_site-packages>
pyside2-uic
and pyside2-rcc
are now included with Maya.
Users can now use pyside2-uic
to generate Python code from .ui
files.
In order to improve how Maya handles preferences, changes have been made to the MGlobal
class and the optionVar
command.
Three new methods have been added to MGlobal:
static bool initOptionVar(const MString& name, int value, const MString& category)
static bool initOptionVar(const MString& name, double value, const MString& category)
static bool initOptionVar(const MString& name, MString value, const MString& category)
And several new options and flags have been added to the optionVar command:
-intValue2
(-iv2
), -intValue3
, (-iv3
), -intValue4
(-iv4
), -floatValue2
(-fv2
), -floatValue3
(-fv3
), -floatValue4
(-fv4
): create 2, 3, or 4 element int or float array variables-floatArray
(-fa
), -intArray
(-ia
), -stringArray
(-sa
): create empty int, float, or string array variables-transient
(-t
): flags that the variable is not to be saved between sessions-category
(-cat
): sets the variable's category -default
(-d
): sets the variable's current and default value to the specified value-init
(-ini
): initializes or resets the variable-listCategories
(-lc
): returns a list of all defined variable categories-listModified
(-lm
): returns a list of all variables that have been changed from their default valuesThe default tolerance of MFnMesh::getPointsAtUV()
has changed from 0 to 0.001. If no points are found, the method will no longer fail. Instead its arrays of points polygon IDs will be empty.
The new BorderInfo
enum holds information about whether an edge lies on geometry/UV borders or shares UVs. This enum is returned by the new edgeBorderInfo()
method:
BorderInfo MFnMesh::edgeBorderInfo(int edgeId, unsigned int setId=-1, MStatus *ReturnStatus=NULL) const
The new getUVBorderEdges()
method retrieves the edge indecies of edges lying on a UV border:
MStatus MFnMesh::getUVBorderEdges(unsigned int setId, MIntArray &edgeList) const
The new getMeshShellIds()
method is the mesh counterpart to getUvShellsIds()
. It returns an array of integers where each unique integer represents a mesh shell. The array lets users identify connected pieces of mesh.
MStatus MFnMesh::getMeshShellsIds(MFn::Type compType, MIntArray & meshShellIds, unsigned int & nbMeshShells)
The new getRawUVs()
method returns a pointer to the internal texture coordinates for this mesh.
const float* MFnMesh::getRawUVs(MStatus*, const MString * uvSet = NULL) const;
The new BoolClassification
enum indicates whether to use edge classification or normal classification when computing booleans between meshes using the booleanOps()
method.
The signature of booleanOps()
has changed to accommodate the use of this classification:
MStatus MFnMesh::booleanOps(BoolOperation op, const MObjectArray &meshes, bool useLegacy = false, BoolClassification classification = kNormalClassification)
The classification will be ignored if useLegacy
is set to true
.
The new overloaded methods mirror the mesh creation used by mayaAscii and mayaBinary file readers.
MObject create( const MPointArray &vertexArray, const MIntArray &edgeArray, const MIntArray &polygonCounts, const MIntArray &polygonConnects, MObject parentOrOwner = MObject::kNullObj, MStatus * ReturnStatus = NULL )
MObject create( const MFloatPointArray &vertexArray, const MIntArray &edgeArray, const MIntArray &polygonCounts, const MIntArray &polygonConnects, MObject parentOrOwner = MObject::kNullObj, MStatus * ReturnStatus = NULL )
MObject create( const MPointArray &vertexArray, const MIntArray &edgeArray, const MIntArray &polygonCounts, const MIntArray &polygonConnects, const MFloatArray & uArray, const MFloatArray & vArray, MObject parentOrOwner = MObject::kNullObj, MStatus * ReturnStatus = NULL )
MObject create( const MFloatPointArray &vertexArray, const MIntArray &edgeArray, const MIntArray &polygonCounts, const MIntArray &polygonConnects, const MFloatArray & uArray, const MFloatArray & vArray, MObject parentOrOwner = MObject::kNullObj, MStatus * ReturnStatus = NULL );
MStatus createInPlace( const MPointArray &vertexArray, const MIntArray &edgeArray, const MIntArray &polygonCounts, const MIntArray &polygonConnects )
MStatus createInPlace( const MFloatPointArray &vertexArray, const MIntArray &edgeArray, const MIntArray &polygonCounts, const MIntArray &polygonConnects )
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.
Three new selection levels have been added to the MSelectionContext::SelectionLevel
enum that specifies the granularity to use for a Viewport 2.0 selection:
kFace
: Face-level selection; only faces are selectablekEdge
:Edge-level selection; only edges are selectablekVertex
:Vertex-level selection; only vertices are selectablekComponent
is still a valid selection level for MSelectionContext::setSelectionLevel()
and MSelectionContext::selectionLevel()
. However, for each individual selection hit, MIntersection::selectionLevel()
will no longer return kComponent
. Instead, MIntersection::selectionLevel()
will return one of the three new levels.
Plug-ins that test the selection level of a selection hit against the kComponent
level should be updated to test against the three new levels instead.
The following reset()
methods in MItMeshPolygon
, MItMeshVertex
, and MItMeshEdge
have been modified to remove invalid component IDs automatically:
MStatus MItMeshPolygon::reset( const MDagPath &polyObject, MObject & component )
MStatus MItMeshVertex::reset( const MDagPath &polyObject, MObject& component )
MStatus MItMeshEdge::reset( MObject & polyObject, MObject & component )
MStatus MItMeshEdge::reset( const MDagPath &polyObject, MObject & component )
Three classes and five methods have been added to simplify using GPU deformers.
The MOpenCLUtils
, MOpenCLKernelInfo
, and MPxGPUStandardDeformer
classes have been added.
One new method has been added to MGPUDeformerRegistrationInfo
:
virtual bool isGeometryFilter() const
And four new methods have been added to MPxGPUDeformer
:
static bool isBufferUpdateNeeded(const MOpenCLBuffer& buffer, const MEvaluationNode& evaluationNode, const MObject& attribute)
cl_int uploadFixedSetupData(const MString& name, MOpenCLBuffer& buffer, cl_int& errorCode, unsigned int* arrayLength)
static MFnGeometryData::SubsetState getSubsetState(MDataBlock& block, unsigned int multiIndex, MStatus* ReturnStatus = NULL)
static const char* className()
The offsetNode example has been updated to use these new classes and methods.
Two new methods, MColorPickerUtilities::applyViewTransform()
and MColorPickerUtilities::grabColor()
, and one new class, MColorMixingSpaceHelper
, have been added for creating a color managed color picker using the API.
MColor MColorPickerUtilities::applyViewTransform(const MColor &inputColor, Direction direction)
MColor MColorPickerUtilities::grabColor(MStatus * returnedStatus = nullptr)
grabColor()
runs an eye dropper tool that lets users interactively grab a color on screen with their mouse. applyViewTransform()
applies a color transform using Maya's color management settings.
The MTimeSliderCustomDrawManager
class has been added to the Maya API. This class provides a way to draw custom items on the timeline.
In PR131, three callback methods were added:
void setStopPrimitiveEditFunction(MCustomDrawID id, MSharedPtr< MStopPrimitiveEditingFct > fct)
void setStartPrimitiveEditFunction(MCustomDrawID id, MSharedPtr< MStartPrimitiveEditingFct > fct)
void setEditPrimitiveFunction(MCustomDrawID id, MSharedPtr< MEditPrimitiveFct > fct)
The three abstract classes, MStopPrimitiveEditingFct
, MStartPrimitiveEditingFct
, and MEditPrimitiveFct
, were added to support these callbacks.
The return type of MIndexMapper::affectMap()
has changed from MIntArray
to MUintArray
.
MUintArray MIndexMapper::affectMap() const
The MUIDrawManager::setTexture()
method has been modified. Two new parameters, inputColorSpace
and alphaDiscardThreshold
, have been added to its signature:
void MUIDrawManager::setTexture(MHWRender::MTexture* texture, const MString& inputColorSpace, const float alphaDiscardThreshold = 0.05f)
inputColorSpace
is the color space of the texture that will be used to create a shader override when converting texture color to render space color.
alphaDiscardThreshold
controls the shader that draws textured UI objects. Any parts of the texture that have an alpha value lower than the threshold will not be drawn. A threshold of 0.0 means everything will be drawn while 1.0 means nothing will be. This parameter was added in PR131.
kSelectionHighlighting
has been added to MGeometry::DrawMode
.
When kSelectionHighlighting
is passed to MRenderItem::setDrawMode()
, the render item will only be drawn if selection highlighting is enabled.
The gpuCache
example has been updated to use this new enum.
A new stock shader, k3dIsotropicStandardSurfaceShader
has been added to the MShaderManager
class.
The apiMeshShape
example has been updated to use this shader instead of the Blinn shader.
A new enum and three new methods have been added to MHWRender::MRenderItem
.
DefaultMaterialFiltering
, setDefaultMaterialHandling()
, and getDefaultMaterialHandling()
were added 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 MHWRender::MRenderItem::setDefaultMaterialHandling(MRenderItem::DefaultMaterialFiltering state)
determines whether this object should be drawn when default material mode is active.
getDefaultMaterialHandling()
returns whether this render item will draw when default material mode is active.
And InternalObjectId()
was added to provide a unique identifier for a render item:
MUint64 MHWRender::MRenderItem::InternalObjectId() const
It returns a unique identifier for a render item. If two MRenderItem
s hold the same internal render item, they will have the same InternalObjectIds.
A new enum and new method have been added to MHWRender::MUIDrawManager
.
The DrawPass
enum indicates whether a HUD pass item is drawn before or after the view cube.
beginDrawPass()
specifies which draw pass items within the scope of beginDrawable()
and endDrawable()
will be added to.
MStatus MHWRender::MUIDrawManager::beginDrawPass(DrawPass pass)
A call to endDrawPass()
must follow a call to beginDrawPass()
.
Two new methods have been added to replicate joint-like behavior in custom transforms:
MQuaternion MPxTransformationMatrix::preRotation() const
MQuaternion MPxTransform::getPreRotation() const
MPxTransformationMatrix::preRotation()
is an optional rotation that can be applied after the rotation channel and before the translation channel in the transform matrix. It can be used to replicate joint-like behavior in a custom transform.
MPxTransform::getPreRotation()
returns the preRotation.
The rockingTransform
example has been modified to use this new functionality.
Two new methods, isProxy()
and proxied()
, have been added to MPlug
.
bool MPlug::isProxy(MStatus* ReturnStatus ) const
MPlug MPlug::proxied()
isProxy()
returns true if the plug is a proxy plug. A proxy plug forwards its connection to another plug, and is not associated with a datablock.
proxied()
returns the plug the proxy plug forwards to. If the plug is empty or not a proxy plug, proxied()
will return the plug itself. If the plug iis an unconnected proxy, proxied()
will return a null plug.
thisMObject()
has been added to the following classes
|
|
|
|
The snapToActive()
method has been added to MSelectionInfo
:
bool MHWRender::MSelectionInfo::snapToActive (MStatus* ReturnStatus = nullptr) const
snapToActive()
returns true if an active object should be snapped to, and returns false otherwise.
A new method, getMemberPaths()
, has been added to MFnSets
:
MStatus MFnSet::getMemberPaths(MDagPathArray &members, bool shading) const
getMemberPaths()
is used to get an array of dagPaths that are members of the set.
A new method, isInCrashHandler()
, has been added to MGlobal
:
bool MGlobal::isInCrashHandler()
isInCrashHandler()
lets a plug-in query whether or not Maya has crashed. This is useful in the case where the plug-in is responding to a callback, especially one related to file I/O, as it lets the plug-in know if the callback was triggered by a crash.
A new method, isValidReference()
, has been added to MFnReference
:
bool MFnReference::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.
A new method, uniqueName()
, has been added to MFnDependencyNode
:
MString MFnDependencyNode::uniqueName(MStatus* ReturnStatus = NULL) const
A new method, devicePixelRatio()
, has been added to M3dView
:
double M3dView::devicePixelRatio (MStatus* ReturnStatus = NULL) const
devicePixelRatio()
returns the ratio of Qt logical pixels to viewport rendering pixels for the devide.
A new method, ufeIdentifiersInUse()
, has been added to MPxSubSceneOverride
:
bool MHWRender::MPxSubSceneOverride::ufeIdentifiersInUse() const
ufeIdentifiersInUse()
returns true when a Maya feature that relies on Ufe Identifiers is enabled.
A new method, isEmpty()
, has been added to MString
:
bool MString::isEmpty( ) const
isEmpty()
will return true if the string is empty. It will return false otherwise.
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.
The Python counterparts of the following C++ methods have been added to the Python API 2.0:
virtual void MPxNode::getCacheSetup(const MEvaluationNode&, MNodeCacheDisablingInfo&, MNodeCacheSetupInfo&, MObjectArray&) const
virtual void MPxNode::configCache(const MEvaluationNode&, MCacheSchema&) const
virtual MTimeRange MPxNode::transformInvalidationRange(const MPlug& source, const MTimeRange& input) const
bool MPxNode::hasInvalidationRangeTransformation() const
virtual void MPxGeometryOverride::configCache(const MEvaluationNode&, MCacheSchema&) const
A new py1ArrayAttrBlenderNode.py
example demonstrates how to implement array attributes in a straightforward way.
The py1MoveTool.py example has been updated from using VP1 to using VP2, and updated to use Python API 2.0. It has been renamed to py2MoveTool.py.
The customImagePlane
example has been updated to fix an issue where images were not animated when scrubbing.
The gpuCache
example has been updated to use the new kSelectionHighlighting
enum.
The rockingTransform
example has been updated to use the new preRotation()
method in MPxTransformationMatrix
.
The offsetNode
example has been updated to use the new GPU deformer API.
The apiMeshShape
example has been updated to remove deprecated code, to fix a bug in the example, and to use the new k3dIsotropicStandardSurfaceShader
stock shader.
The following Blue Pencil commands have been added:
bluePencilUtil
bluePencilNode
bluePencilLayer
bluePencilFrame
bluePencilStroke
bluePencilDrawCtx
bluePencilTransformCtx
These commands were introduced in an earlier PR under similar names prefixed with "cz", for example czBluePencilUtil
.
-fullPath
option added to the duplicate
command-alpha
option added to the displayRGBColor
command-alpha
option has been added to the grabColor
command-connectedGraphingMode
option added to the nodeEditor
command-copyWeights
option added to the blendShape
command-workspaceControls
option added to the lsUI
command-showFullPath
option added to the referenceQuery
command-useVpColorPicker
option added to colorSliderGrp
, providing a means to disable the default Viewport color picker.-tabicon
and -tabIconIndex
options added to both the shelfTabLayout
and tabLayout
commands-mayaInstallDir
option was added to the internalVar
command. This option returns the directory where Maya is installed. This directory will be identical to the one pointed to by MAYA_LOCATION on Linux and Windows, but will be different than the one pointed to by MAYA_LOCATION on macOS. On macOS, MAYA_LOCATION includes the path to the Contents
folder under Maya.app
. The directory returned by mayaInstallDir
does not include that path.separator
-horizontal
option now applies to all styles and not only to single
. It can now be used to specify the orientation of any separator.greasePencilCtx
, greasePencilHelper
, and greaseRenderPlane
commands have been removed.threadCount
command