[Bf-blender-cvs] [01234b430b5] master: Fix T89345: Edit-mesh decimate doesn't update face normals

Campbell Barton noreply at git.blender.org
Tue Jun 22 10:29:24 CEST 2021


Commit: 01234b430b506daf692fada162a73846109c03c3
Author: Campbell Barton
Date:   Tue Jun 22 18:25:15 2021 +1000
Branches: master
https://developer.blender.org/rB01234b430b506daf692fada162a73846109c03c3

Fix T89345: Edit-mesh decimate doesn't update face normals

Invalid face normals were used for tessellation.

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

M	source/blender/bmesh/tools/bmesh_decimate_collapse.c
M	source/blender/editors/mesh/editmesh_tools.c

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

diff --git a/source/blender/bmesh/tools/bmesh_decimate_collapse.c b/source/blender/bmesh/tools/bmesh_decimate_collapse.c
index 869856d0c5b..bc497c38e7a 100644
--- a/source/blender/bmesh/tools/bmesh_decimate_collapse.c
+++ b/source/blender/bmesh/tools/bmesh_decimate_collapse.c
@@ -1285,6 +1285,11 @@ static bool bm_decim_edge_collapse(BMesh *bm,
  *        a vertex group is the usual source for this.
  * \param symmetry_axis: Axis of symmetry, -1 to disable mirror decimate.
  * \param symmetry_eps: Threshold when matching mirror verts.
+ *
+ * \note The caller is responsible for recalculating face and vertex normals.
+ * - Vertex normals are maintained while decimating,
+ *   although they won't necessarily match the final recalculated normals.
+ * - Face normals are not maintained at all.
  */
 void BM_mesh_decimate_collapse(BMesh *bm,
                                const float factor,
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c
index d4491721689..a3643b3bc8e 100644
--- a/source/blender/editors/mesh/editmesh_tools.c
+++ b/source/blender/editors/mesh/editmesh_tools.c
@@ -5823,7 +5823,7 @@ static int edbm_decimate_exec(bContext *C, wmOperator *op)
     EDBM_update(obedit->data,
                 &(const struct EDBMUpdate_Params){
                     .calc_looptri = true,
-                    .calc_normals = false,
+                    .calc_normals = true,
                     .is_destructive = true,
                 });
   }



More information about the Bf-blender-cvs mailing list