Share

Modeling

Changes to class Matrix3 and DMatrix3

Starting with 3ds Max 2022, instances of Matrix3 and DMatrix3 will be initialized to the identity matrix. All the methods of these two classes will update the identity related flags stored by the matrix for the purposes to optimize performance of some operations.

3rd party code that used to call Matrix3::SetNotIdent() following certain matrix operations can remove those calls. Leaving them does not impact the correctness of matrix functionality, but it could have a slight performance impact.

Changes to class TriObjectNormalXTC

Non-deformer modifiers might be affected by a performance boosting change to class TriObjectNormalXTC.

TriObjectNormalXTC instances now only depend on the topology channel (TOPO_CHANNEL).

Modifiers that indicated that they processed normals correctly, by setting the MESH_NORMAL_MODIFIER_SUPPORT flag in their Modifier::ModifyObject() method, are not affected by this change.

Modifiers that do not set the MESH_NORMAL_MODIFIER_SUPPORT flag and change topology (TOPO_CHANNEL) will have their NormalSpec cleared. Those that do not set the MESH_NORMAL_MODIFIER_SUPPORT flag and only change geometry (GEOM_CHANNEL) may now generate incorrect normals. These modifiers need to be updated to support the MeshNormalSpec or MNNormalSpec. Note that those modifiers that affect the GEOM_CHANNEL only through the Deformer interface (see class Deformer) will have deformation of normal handled correctly and are not affected by this change.

Changes to class Deformer

In order to improve the performance of Deformer, its non-const Map() and IsThreadSafe() methods have been deprecated. A new method called MapNormal() has been added, which together with Map() have to be thread safe.

New functions added to the MNMesh class

The following methods have been added to the MNMesh class:

int MNMesh::NumDeadVerts() 
int MNMesh::NumDeadEdges() 
int MNMesh::NumDeadFaces() 

In 3ds Max, when a vertex, edge or face is deleted, it is sometimes flagged as 'dead' instead of being deleted right away. This is done for performance reasons: instead of deleting each element individually and reallocating memory every time this happens, we wait until many elements have been flagged as 'dead', and then we delete them all at the same time.

The methods listed above allow 3rd party developers to query the number of dead vertices, edges and faces, which are now cached in three private member variables that have also been added to the MNMesh class.

Before these methods were added, the only way to access these numbers was to iterate over the vertices, edges and faces and count the number of dead ones. Now it is possible to do this in an efficient manner thanks to how these values are cached.

New function added to the Modifier class

The following method has been added to the Modifier class:

virtual bool Modifier::ShouldCollapseOnSave()

Improve sub-object picking with High DPI systems

Picking with the mouse now properly accounts for high DPI displays and a tunable scaling factor is also present. 3rd party plugin developers can take advantage of the following new APIs to update their code:

float IMouseConfigManager::GetSelectionRadius() const 
float IMouseConfigManager::GetSelectionRadiusScale() const 
void IMouseConfigManager:: SetSelectionRadiusScale(float selectionRadiusScale) 

In most cases, 3rd party plugins can simply query the selection radius computed by 3ds Max and use it instead of a hard-coded pixel value.

These settings are exposed to MAXScript through the MouseConfigManager interface.

Was this information helpful?