[Bf-blender-cvs] [38a2576acef] blender-v3.2-release: Fix display error after sorting mesh elements

Campbell Barton noreply at git.blender.org
Thu May 26 13:24:44 CEST 2022


Commit: 38a2576acef020566497f1d0c8c2c492de74b769
Author: Campbell Barton
Date:   Thu May 26 21:15:57 2022 +1000
Branches: blender-v3.2-release
https://developer.blender.org/rB38a2576acef020566497f1d0c8c2c492de74b769

Fix display error after sorting mesh elements

Sorting faces caused the tessellation data to be outdated,
making faces show the wrong materials.

Re-calculate tessellation when re-ordering faces.

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

M	source/blender/editors/mesh/editmesh_tools.c

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

diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c
index cafcc4ec578..feecefdb7ea 100644
--- a/source/blender/editors/mesh/editmesh_tools.c
+++ b/source/blender/editors/mesh/editmesh_tools.c
@@ -7032,6 +7032,14 @@ static void sort_bmelem_flag(bContext *C,
   }
 
   BM_mesh_remap(em->bm, map[0], map[1], map[2]);
+
+  EDBM_update(ob->data,
+              &(const struct EDBMUpdate_Params){
+                  .calc_looptri = (totelem[2] != 0),
+                  .calc_normals = false,
+                  .is_destructive = true,
+              });
+
   DEG_id_tag_update(ob->data, ID_RECALC_GEOMETRY);
   WM_event_add_notifier(C, NC_GEOM | ND_DATA, ob->data);



More information about the Bf-blender-cvs mailing list