diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-06-14 15:56:01 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-06-14 15:56:01 +0300 |
commit | 8083527f90d1556f576cf102d4143749677c45e0 (patch) | |
tree | 347f2be8a4aaa305a8e6a1125dbf5f7fb3174b13 /source/blender/editors/mesh/editmesh_polybuild.c | |
parent | 1d2eb461b528cc309ad6d2fa94ce1e910e93d8be (diff) |
Edit Mesh: use params arg for update function, add calc_normals arg
Rename function EDBM_update_generic to EDBM_update, use a parameters
argument for better readability.
Also add calc_normals argument, which will have benefits when
calculating normals and tessellation together is optimized.
Diffstat (limited to 'source/blender/editors/mesh/editmesh_polybuild.c')
-rw-r--r-- | source/blender/editors/mesh/editmesh_polybuild.c | 40 |
1 files changed, 30 insertions, 10 deletions
diff --git a/source/blender/editors/mesh/editmesh_polybuild.c b/source/blender/editors/mesh/editmesh_polybuild.c index 4d37b78c9b7..92d97f76509 100644 --- a/source/blender/editors/mesh/editmesh_polybuild.c +++ b/source/blender/editors/mesh/editmesh_polybuild.c @@ -154,8 +154,12 @@ static int edbm_polybuild_transform_at_cursor_invoke(bContext *C, BM_face_select_set(bm, (BMFace *)ele_act, true); } - EDBM_mesh_normals_update(em); - EDBM_update_generic(vc.obedit->data, true, true); + EDBM_update(vc.obedit->data, + &(const struct EDBMUpdate_Params){ + .calc_looptri = true, + .calc_normals = true, + .is_destructive = true, + }); if (basact != NULL) { if (vc.view_layer->basact != basact) { ED_object_base_activate(C, basact); @@ -237,8 +241,12 @@ static int edbm_polybuild_delete_at_cursor_invoke(bContext *C, } if (changed) { - EDBM_mesh_normals_update(em); - EDBM_update_generic(vc.obedit->data, true, true); + EDBM_update(vc.obedit->data, + &(const struct EDBMUpdate_Params){ + .calc_looptri = true, + .calc_normals = true, + .is_destructive = true, + }); if (basact != NULL) { if (vc.view_layer->basact != basact) { ED_object_base_activate(C, basact); @@ -400,8 +408,12 @@ static int edbm_polybuild_face_at_cursor_invoke(bContext *C, wmOperator *op, con } if (changed) { - EDBM_mesh_normals_update(em); - EDBM_update_generic(vc.obedit->data, true, true); + EDBM_update(vc.obedit->data, + &(const struct EDBMUpdate_Params){ + .calc_looptri = true, + .calc_normals = true, + .is_destructive = true, + }); if (basact != NULL) { if (vc.view_layer->basact != basact) { @@ -488,8 +500,12 @@ static int edbm_polybuild_split_at_cursor_invoke(bContext *C, } if (changed) { - EDBM_mesh_normals_update(em); - EDBM_update_generic(vc.obedit->data, true, true); + EDBM_update(vc.obedit->data, + &(const struct EDBMUpdate_Params){ + .calc_looptri = true, + .calc_normals = true, + .is_destructive = true, + }); WM_event_add_mousemove(vc.win); @@ -578,8 +594,12 @@ static int edbm_polybuild_dissolve_at_cursor_invoke(bContext *C, if (changed) { edbm_flag_disable_all_multi(vc.view_layer, vc.v3d, BM_ELEM_SELECT); - EDBM_mesh_normals_update(em); - EDBM_update_generic(vc.obedit->data, true, true); + EDBM_update(vc.obedit->data, + &(const struct EDBMUpdate_Params){ + .calc_looptri = true, + .calc_normals = true, + .is_destructive = true, + }); if (vc.view_layer->basact != basact) { ED_object_base_activate(C, basact); |