From 38a2576acef020566497f1d0c8c2c492de74b769 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 26 May 2022 21:15:57 +1000 Subject: 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. --- source/blender/editors/mesh/editmesh_tools.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/blender/editors/mesh') 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); -- cgit v1.2.3