diff options
author | Campbell Barton <campbell@blender.org> | 2022-05-26 14:15:57 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-05-26 14:23:19 +0300 |
commit | 38a2576acef020566497f1d0c8c2c492de74b769 (patch) | |
tree | 810798be402cf3ebca44b9e79e7344899d9fed26 /source | |
parent | 790fe55c52057919b3f3f6e95f4e510719293eeb (diff) |
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.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/mesh/editmesh_tools.c | 8 |
1 files changed, 8 insertions, 0 deletions
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); |