diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-01-07 14:11:19 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-01-07 14:14:36 +0300 |
commit | c128b30bd13bbf48a701fe068fa27c1d21378515 (patch) | |
tree | d7cb94213e72d823bfa41f336a67fbaf947efbc7 /source/blender/editors/mesh/editmesh_utils.c | |
parent | cb1f48ab7f5024715a898b767576ce4258098516 (diff) |
Edit Mesh: pass in Mesh instead of BMEditMesh to EDBM_update_generic
This avoids a list lookup in Main (recently added), passing in a mesh
instead of an edit-mesh, since the mesh links to the edit-mesh.
Diffstat (limited to 'source/blender/editors/mesh/editmesh_utils.c')
-rw-r--r-- | source/blender/editors/mesh/editmesh_utils.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/source/blender/editors/mesh/editmesh_utils.c b/source/blender/editors/mesh/editmesh_utils.c index e3883ea04d4..96fa31e17e9 100644 --- a/source/blender/editors/mesh/editmesh_utils.c +++ b/source/blender/editors/mesh/editmesh_utils.c @@ -1421,18 +1421,12 @@ void EDBM_stats_update(BMEditMesh *em) /* so many tools call these that we better make it a generic function. */ -void EDBM_update_generic(BMEditMesh *em, const bool do_tessellation, const bool is_destructive) +void EDBM_update_generic(Mesh *mesh, const bool do_tessellation, const bool is_destructive) { - /* FIXME: pass in mesh. */ - Main *bmain = G_MAIN; - for (Mesh *mesh = bmain->meshes.first; mesh; mesh = mesh->id.next) { - if (mesh->edit_mesh == em) { - /* Order of calling isn't important. */ - DEG_id_tag_update(&mesh->id, ID_RECALC_GEOMETRY); - WM_main_add_notifier(NC_GEOM | ND_DATA, &mesh->id); - break; - } - } + BMEditMesh *em = mesh->edit_mesh; + /* Order of calling isn't important. */ + DEG_id_tag_update(&mesh->id, ID_RECALC_GEOMETRY); + WM_main_add_notifier(NC_GEOM | ND_DATA, &mesh->id); if (do_tessellation) { BKE_editmesh_looptri_calc(em); |