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.
This commit is contained in:
Campbell Barton 2022-05-26 21:15:57 +10:00
parent 790fe55c52
commit 38a2576ace
Notes: blender-bot 2024-03-25 12:30:38 +01:00
Referenced by issue #98461, Regression: Crash running screenshot from the command-line
1 changed files with 8 additions and 0 deletions

View File

@ -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);