[Bf-blender-cvs] [44b0c70919e] blender-v3.1-release: Fix T92288, T96041: instancing of shared mesh objects without modifiers broken

Brecht Van Lommel noreply at git.blender.org
Mon Feb 28 19:17:59 CET 2022


Commit: 44b0c70919e92f7b70f0e03eba9570ca8906ab90
Author: Brecht Van Lommel
Date:   Mon Feb 28 17:17:40 2022 +0100
Branches: blender-v3.1-release
https://developer.blender.org/rB44b0c70919e92f7b70f0e03eba9570ca8906ab90

Fix T92288, T96041: instancing of shared mesh objects without modifiers broken

New code from the vertex normal refactor cfa53e0fbeed combined with older code
from 592759e3d62a that disabled instancing for custom normals and autosmooth
meant that instancing was always disabled.

However we do not need to disable instancing for custom normals and autosmooth
at all, this can be shared between instances just fine.

===================================================================

M	source/blender/blenkernel/intern/DerivedMesh.cc

===================================================================

diff --git a/source/blender/blenkernel/intern/DerivedMesh.cc b/source/blender/blenkernel/intern/DerivedMesh.cc
index 411e5f81262..1fcf1bf1839 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.cc
+++ b/source/blender/blenkernel/intern/DerivedMesh.cc
@@ -1304,12 +1304,7 @@ static void mesh_calc_modifiers(struct Depsgraph *depsgraph,
    * we need to apply these back onto the Mesh. If we have no
    * Mesh then we need to build one. */
   if (mesh_final == nullptr) {
-    /* NOTE: this check on cdmask is a bit dodgy, it handles the issue at stake here (see T68211),
-     * but other cases might require similar handling?
-     * Could be a good idea to define a proper CustomData_MeshMask for that then. */
-    if (deformed_verts == nullptr && allow_shared_mesh &&
-        (final_datamask.lmask & CD_MASK_NORMAL) == 0 &&
-        (final_datamask.pmask & CD_MASK_NORMAL) == 0) {
+    if (deformed_verts == nullptr && allow_shared_mesh) {
       mesh_final = mesh_input;
     }
     else {



More information about the Bf-blender-cvs mailing list