Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2021-06-14 15:56:01 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-06-14 15:56:01 +0300
commit8083527f90d1556f576cf102d4143749677c45e0 (patch)
tree347f2be8a4aaa305a8e6a1125dbf5f7fb3174b13 /source/blender/editors/mesh/editmesh_tools.c
parent1d2eb461b528cc309ad6d2fa94ce1e910e93d8be (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_tools.c')
-rw-r--r--source/blender/editors/mesh/editmesh_tools.c475
1 files changed, 403 insertions, 72 deletions
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c
index bb332a4094c..7e8f0c5ea8e 100644
--- a/source/blender/editors/mesh/editmesh_tools.c
+++ b/source/blender/editors/mesh/editmesh_tools.c
@@ -132,7 +132,12 @@ static int edbm_subdivide_exec(bContext *C, wmOperator *op)
false,
seed);
- EDBM_update_generic(obedit->data, true, true);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = true,
+ });
}
MEM_freeN(objects);
@@ -324,7 +329,12 @@ static int edbm_subdivide_edge_ring_exec(bContext *C, wmOperator *op)
continue;
}
- EDBM_update_generic(obedit->data, true, true);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = true,
+ });
}
MEM_freeN(objects);
@@ -384,7 +394,12 @@ static int edbm_unsubdivide_exec(bContext *C, wmOperator *op)
}
EDBM_selectmode_flush(em);
- EDBM_update_generic(obedit->data, true, true);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = true,
+ });
}
MEM_freeN(objects);
@@ -499,7 +514,12 @@ static int edbm_delete_exec(bContext *C, wmOperator *op)
BM_custom_loop_normals_from_vector_layer(em->bm, false);
- EDBM_update_generic(obedit->data, true, true);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = true,
+ });
DEG_id_tag_update(obedit->data, ID_RECALC_SELECT);
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
@@ -628,7 +648,12 @@ static int edbm_delete_loose_exec(bContext *C, wmOperator *op)
EDBM_flag_disable_all(em, BM_ELEM_SELECT);
- EDBM_update_generic(obedit->data, true, true);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = true,
+ });
}
int totelem_new[3];
@@ -686,7 +711,12 @@ static int edbm_collapse_edge_exec(bContext *C, wmOperator *op)
continue;
}
- EDBM_update_generic(obedit->data, true, true);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = true,
+ });
}
MEM_freeN(objects);
@@ -971,7 +1001,12 @@ static int edbm_add_edge_face_exec(bContext *C, wmOperator *op)
continue;
}
- EDBM_update_generic(obedit->data, true, true);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = true,
+ });
changed_multi = true;
}
MEM_freeN(objects);
@@ -1047,7 +1082,12 @@ static int edbm_mark_seam_exec(bContext *C, wmOperator *op)
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
Object *obedit = objects[ob_index];
- EDBM_update_generic(obedit->data, true, false);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = false,
+ });
}
MEM_freeN(objects);
@@ -1117,7 +1157,12 @@ static int edbm_mark_sharp_exec(bContext *C, wmOperator *op)
BM_elem_flag_set(eed, BM_ELEM_SMOOTH, clear);
}
- EDBM_update_generic(obedit->data, true, false);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = false,
+ });
}
MEM_freeN(objects);
@@ -1239,7 +1284,12 @@ static bool edbm_connect_vert_pair(BMEditMesh *em, struct Mesh *me, wmOperator *
BM_custom_loop_normals_from_vector_layer(bm, false);
- EDBM_update_generic(me, true, true);
+ EDBM_update(me,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = true,
+ });
}
}
MEM_freeN(verts);
@@ -1538,7 +1588,12 @@ static int edbm_vert_connect_path_exec(bContext *C, wmOperator *op)
BM_custom_loop_normals_from_vector_layer(bm, false);
- EDBM_update_generic(obedit->data, true, true);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = true,
+ });
}
else {
failed_selection_order_len++;
@@ -1603,7 +1658,12 @@ static int edbm_vert_connect_concave_exec(bContext *C, wmOperator *op)
em, op, "faces.out", true, "connect_verts_concave faces=%hf", BM_ELEM_SELECT)) {
continue;
}
- EDBM_update_generic(obedit->data, true, true);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = true,
+ });
}
MEM_freeN(objects);
@@ -1657,7 +1717,12 @@ static int edbm_vert_connect_nonplaner_exec(bContext *C, wmOperator *op)
continue;
}
- EDBM_update_generic(obedit->data, true, true);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = true,
+ });
}
MEM_freeN(objects);
@@ -1726,7 +1791,12 @@ static int edbm_face_make_planar_exec(bContext *C, wmOperator *op)
continue;
}
- EDBM_update_generic(obedit->data, true, true);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = true,
+ });
}
MEM_freeN(objects);
@@ -1775,7 +1845,12 @@ static bool edbm_edge_split_selected_edges(wmOperator *op, Object *obedit, BMEdi
BM_custom_loop_normals_from_vector_layer(em->bm, false);
EDBM_select_flush(em);
- EDBM_update_generic(obedit->data, true, true);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = true,
+ });
return true;
}
@@ -1845,7 +1920,12 @@ static bool edbm_edge_split_selected_verts(wmOperator *op, Object *obedit, BMEdi
BM_custom_loop_normals_from_vector_layer(em->bm, false);
EDBM_select_flush(em);
- EDBM_update_generic(obedit->data, true, true);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = true,
+ });
return true;
}
@@ -1958,7 +2038,12 @@ static int edbm_duplicate_exec(bContext *C, wmOperator *op)
if (!EDBM_op_finish(em, &bmop, op, true)) {
continue;
}
- EDBM_update_generic(obedit->data, true, true);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = true,
+ });
}
MEM_freeN(objects);
@@ -2114,7 +2199,12 @@ static int edbm_flip_normals_exec(bContext *C, wmOperator *op)
lnor_ed->clnors_data);
}
BM_loop_normal_editdata_array_free(lnors_ed_arr);
- EDBM_update_generic(obedit->data, true, false);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = false,
+ });
}
continue;
}
@@ -2133,7 +2223,12 @@ static int edbm_flip_normals_exec(bContext *C, wmOperator *op)
}
if (flip_custom_normals(em->bm, lnors_ed_arr) || has_flipped_faces) {
- EDBM_update_generic(obedit->data, true, false);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = false,
+ });
}
if (lnors_ed_arr != NULL) {
@@ -2255,7 +2350,12 @@ static int edbm_edge_rotate_selected_exec(bContext *C, wmOperator *op)
continue;
}
- EDBM_update_generic(obedit->data, true, true);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = true,
+ });
}
MEM_freeN(objects);
@@ -2341,7 +2441,12 @@ static int edbm_hide_exec(bContext *C, wmOperator *op)
}
if (EDBM_mesh_hide(em, unselected)) {
- EDBM_update_generic(obedit->data, true, false);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = false,
+ });
changed = true;
}
}
@@ -2392,7 +2497,12 @@ static int edbm_reveal_exec(bContext *C, wmOperator *op)
BMEditMesh *em = BKE_editmesh_from_object(obedit);
if (EDBM_mesh_reveal(em, select)) {
- EDBM_update_generic(obedit->data, true, false);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = false,
+ });
}
}
MEM_freeN(objects);
@@ -2458,7 +2568,12 @@ static int edbm_normals_make_consistent_exec(bContext *C, wmOperator *op)
}
}
- EDBM_update_generic(obedit->data, true, false);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = false,
+ });
}
MEM_freeN(objects);
@@ -2570,7 +2685,12 @@ static int edbm_do_smooth_vertex_exec(bContext *C, wmOperator *op)
EDBM_verts_mirror_cache_end(em);
}
- EDBM_update_generic(obedit->data, true, false);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = false,
+ });
}
MEM_freeN(objects);
@@ -2694,7 +2814,12 @@ static int edbm_do_smooth_laplacian_vertex_exec(bContext *C, wmOperator *op)
EDBM_verts_mirror_cache_end(em);
}
- EDBM_update_generic(obedit->data, true, false);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = false,
+ });
}
MEM_freeN(objects);
@@ -2787,7 +2912,12 @@ static int edbm_faces_shade_smooth_exec(bContext *C, wmOperator *UNUSED(op))
}
mesh_set_smooth_faces(em, 1);
- EDBM_update_generic(obedit->data, false, false);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = false,
+ .calc_normals = false,
+ .is_destructive = false,
+ });
}
MEM_freeN(objects);
@@ -2830,7 +2960,12 @@ static int edbm_faces_shade_flat_exec(bContext *C, wmOperator *UNUSED(op))
}
mesh_set_smooth_faces(em, 0);
- EDBM_update_generic(obedit->data, false, false);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = false,
+ .calc_normals = false,
+ .is_destructive = false,
+ });
}
MEM_freeN(objects);
@@ -2887,7 +3022,12 @@ static int edbm_rotate_uvs_exec(bContext *C, wmOperator *op)
continue;
}
- EDBM_update_generic(obedit->data, false, false);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = false,
+ .calc_normals = false,
+ .is_destructive = false,
+ });
}
MEM_freeN(objects);
@@ -2920,7 +3060,12 @@ static int edbm_reverse_uvs_exec(bContext *C, wmOperator *op)
if (!EDBM_op_finish(em, &bmop, op, true)) {
continue;
}
- EDBM_update_generic(obedit->data, false, false);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = false,
+ .calc_normals = false,
+ .is_destructive = false,
+ });
}
MEM_freeN(objects);
@@ -2958,7 +3103,12 @@ static int edbm_rotate_colors_exec(bContext *C, wmOperator *op)
}
/* dependencies graph and notification stuff */
- EDBM_update_generic(ob->data, false, false);
+ EDBM_update(ob->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = false,
+ .calc_normals = false,
+ .is_destructive = false,
+ });
}
MEM_freeN(objects);
@@ -2994,7 +3144,12 @@ static int edbm_reverse_colors_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
- EDBM_update_generic(obedit->data, false, false);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = false,
+ .calc_normals = false,
+ .is_destructive = false,
+ });
}
MEM_freeN(objects);
@@ -3243,7 +3398,12 @@ static int edbm_merge_exec(bContext *C, wmOperator *op)
BM_custom_loop_normals_from_vector_layer(em->bm, false);
- EDBM_update_generic(obedit->data, true, true);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = true,
+ });
/* once collapsed, we can't have edge/face selection */
if ((em->selectmode & SCE_SELECT_VERTEX) == 0) {
@@ -3422,7 +3582,12 @@ static int edbm_remove_doubles_exec(bContext *C, wmOperator *op)
if (count) {
count_multi += count;
- EDBM_update_generic(obedit->data, true, true);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = true,
+ });
}
}
MEM_freeN(objects);
@@ -3522,7 +3687,12 @@ static int edbm_shape_propagate_to_all_exec(bContext *C, wmOperator *op)
tot_shapekeys++;
}
- EDBM_update_generic(me, false, false);
+ EDBM_update(me,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = false,
+ .calc_normals = false,
+ .is_destructive = false,
+ });
}
MEM_freeN(objects);
@@ -3644,7 +3814,12 @@ static int edbm_blend_from_shape_exec(bContext *C, wmOperator *op)
interp_v3_v3v3(eve->co, eve->co, co, blend);
}
}
- EDBM_update_generic(me, true, false);
+ EDBM_update(me,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = false,
+ });
}
}
MEM_freeN(objects);
@@ -3781,7 +3956,12 @@ static int edbm_solidify_exec(bContext *C, wmOperator *op)
continue;
}
- EDBM_update_generic(obedit->data, true, true);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = true,
+ });
}
MEM_freeN(objects);
@@ -4113,7 +4293,12 @@ static int edbm_knife_cut_exec(bContext *C, wmOperator *op)
BM_custom_loop_normals_from_vector_layer(bm, false);
- EDBM_update_generic(obedit->data, true, true);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = true,
+ });
return OPERATOR_FINISHED;
}
@@ -4516,7 +4701,12 @@ static int edbm_separate_exec(bContext *C, wmOperator *op)
}
if (retval) {
- EDBM_update_generic(base->object->data, true, true);
+ EDBM_update(base->object->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = true,
+ });
}
}
MEM_freeN(bases);
@@ -4664,7 +4854,12 @@ static int edbm_fill_exec(bContext *C, wmOperator *op)
continue;
}
- EDBM_update_generic(obedit->data, true, true);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = true,
+ });
}
MEM_freeN(objects);
@@ -4958,7 +5153,12 @@ static int edbm_fill_grid_exec(bContext *C, wmOperator *op)
continue;
}
- EDBM_update_generic(obedit->data, true, true);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = true,
+ });
}
MEM_freeN(objects);
@@ -5030,7 +5230,12 @@ static int edbm_fill_holes_exec(bContext *C, wmOperator *op)
continue;
}
- EDBM_update_generic(obedit->data, true, true);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = true,
+ });
}
MEM_freeN(objects);
@@ -5113,7 +5318,12 @@ static int edbm_beautify_fill_exec(bContext *C, wmOperator *op)
continue;
}
- EDBM_update_generic(obedit->data, true, true);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = true,
+ });
}
MEM_freeN(objects);
@@ -5197,9 +5407,12 @@ static int edbm_poke_face_exec(bContext *C, wmOperator *op)
continue;
}
- EDBM_mesh_normals_update(em);
-
- EDBM_update_generic(obedit->data, true, true);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = true,
+ .is_destructive = true,
+ });
}
MEM_freeN(objects);
@@ -5301,7 +5514,12 @@ static int edbm_quads_convert_to_tris_exec(bContext *C, wmOperator *op)
BM_custom_loop_normals_from_vector_layer(em->bm, false);
- EDBM_update_generic(obedit->data, true, true);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = true,
+ });
}
MEM_freeN(objects);
@@ -5413,7 +5631,12 @@ static int edbm_tris_convert_to_quads_exec(bContext *C, wmOperator *op)
BM_custom_loop_normals_from_vector_layer(em->bm, false);
- EDBM_update_generic(obedit->data, true, true);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = true,
+ });
}
MEM_freeN(objects);
@@ -5597,7 +5820,12 @@ static int edbm_decimate_exec(bContext *C, wmOperator *op)
}
EDBM_selectmode_flush_ex(em, selectmode);
}
- EDBM_update_generic(obedit->data, true, true);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = true,
+ });
}
MEM_freeN(objects);
@@ -5736,7 +5964,12 @@ static int edbm_dissolve_verts_exec(bContext *C, wmOperator *op)
BM_custom_loop_normals_from_vector_layer(em->bm, false);
- EDBM_update_generic(obedit->data, true, true);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = true,
+ });
}
MEM_freeN(objects);
@@ -5797,7 +6030,12 @@ static int edbm_dissolve_edges_exec(bContext *C, wmOperator *op)
BM_custom_loop_normals_from_vector_layer(em->bm, false);
- EDBM_update_generic(obedit->data, true, true);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = true,
+ });
}
MEM_freeN(objects);
@@ -5858,7 +6096,12 @@ static int edbm_dissolve_faces_exec(bContext *C, wmOperator *op)
BM_custom_loop_normals_from_vector_layer(em->bm, false);
- EDBM_update_generic(obedit->data, true, true);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = true,
+ });
}
MEM_freeN(objects);
@@ -6003,7 +6246,12 @@ static int edbm_dissolve_limited_exec(bContext *C, wmOperator *op)
BM_custom_loop_normals_from_vector_layer(em->bm, false);
- EDBM_update_generic(obedit->data, true, true);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = true,
+ });
}
MEM_freeN(objects);
@@ -6090,7 +6338,12 @@ static int edbm_dissolve_degenerate_exec(bContext *C, wmOperator *op)
/* tricky to maintain correct selection here, so just flush up from verts */
EDBM_select_flush(em);
- EDBM_update_generic(obedit->data, true, true);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = true,
+ });
totelem_new[0] += bm->totvert;
totelem_new[1] += bm->totedge;
@@ -6181,7 +6434,12 @@ static int edbm_delete_edgeloop_exec(bContext *C, wmOperator *op)
EDBM_selectmode_flush_ex(em, SCE_SELECT_VERTEX);
- EDBM_update_generic(obedit->data, true, true);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = true,
+ });
}
MEM_freeN(objects);
@@ -6242,10 +6500,13 @@ static int edbm_split_exec(bContext *C, wmOperator *op)
continue;
}
- /* Geometry has changed, need to recalc normals and looptris */
- EDBM_mesh_normals_update(em);
-
- EDBM_update_generic(obedit->data, true, true);
+ /* Geometry has changed, need to recalculate normals and tessellation. */
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = true,
+ .is_destructive = true,
+ });
}
MEM_freeN(objects);
@@ -7085,7 +7346,12 @@ static int edbm_bridge_edge_loops_for_single_editmesh(wmOperator *op,
}
if (EDBM_op_finish(em, &bmop, op, true)) {
- EDBM_update_generic(me, true, true);
+ EDBM_update(me,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = true,
+ });
}
/* Always return finished so the user can select different options. */
@@ -7220,7 +7486,12 @@ static int edbm_wireframe_exec(bContext *C, wmOperator *op)
continue;
}
- EDBM_update_generic(obedit->data, true, true);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = true,
+ });
}
MEM_freeN(objects);
@@ -7311,7 +7582,12 @@ static int edbm_offset_edgeloop_exec(bContext *C, wmOperator *op)
em->bm, bmop.slots_out, "edges.out", BM_EDGE, BM_ELEM_SELECT, true);
if (EDBM_op_finish(em, &bmop, op, true)) {
- EDBM_update_generic(obedit->data, true, true);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = true,
+ });
changed_multi = true;
}
}
@@ -7441,7 +7717,12 @@ static int edbm_convex_hull_exec(bContext *C, wmOperator *op)
continue;
}
- EDBM_update_generic(obedit->data, true, true);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = true,
+ });
EDBM_selectmode_flush(em);
}
@@ -7529,7 +7810,12 @@ static int mesh_symmetrize_exec(bContext *C, wmOperator *op)
if (!EDBM_op_finish(em, &bmop, op, true)) {
continue;
}
- EDBM_update_generic(obedit->data, true, true);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = true,
+ });
EDBM_selectmode_flush(em);
}
MEM_freeN(objects);
@@ -7671,7 +7957,12 @@ static int mesh_symmetry_snap_exec(bContext *C, wmOperator *op)
}
}
}
- EDBM_update_generic(obedit->data, false, false);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = false,
+ .calc_normals = false,
+ .is_destructive = false,
+ });
/* No need to end cache, just free the array. */
MEM_freeN(index);
@@ -8347,7 +8638,12 @@ static int edbm_point_normals_modal(bContext *C, wmOperator *op, const wmEvent *
if (point_normals_ensure(C, op)) {
point_normals_apply(C, op, target, do_reset);
- EDBM_update_generic(obedit->data, true, false); /* Recheck bools. */
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = false,
+ }); /* Recheck bools. */
point_normals_update_header(C, op);
}
else {
@@ -8404,7 +8700,12 @@ static int edbm_point_normals_exec(bContext *C, wmOperator *op)
point_normals_apply(C, op, target, false);
- EDBM_update_generic(obedit->data, true, false);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = false,
+ });
point_normals_cancel(C, op);
return OPERATOR_FINISHED;
@@ -8663,7 +8964,12 @@ static int normals_split_merge(bContext *C, const bool do_merge)
BM_loop_normal_editdata_array_free(lnors_ed_arr);
}
- EDBM_update_generic(obedit->data, true, false);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = false,
+ });
}
MEM_freeN(objects);
@@ -8875,7 +9181,12 @@ static int edbm_average_normals_exec(bContext *C, wmOperator *op)
} while ((l_curr = l_curr->next) != l_first);
}
- EDBM_update_generic(obedit->data, true, false);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = false,
+ });
}
BLI_heapsimple_free(loop_weight, NULL);
@@ -9126,7 +9437,12 @@ static int edbm_normals_tools_exec(bContext *C, wmOperator *op)
BM_loop_normal_editdata_array_free(lnors_ed_arr);
- EDBM_update_generic(obedit->data, true, false);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = false,
+ });
}
MEM_freeN(objects);
@@ -9280,7 +9596,12 @@ static int edbm_set_normals_from_faces_exec(bContext *C, wmOperator *op)
MEM_freeN(loop_set);
MEM_freeN(vnors);
- EDBM_update_generic(obedit->data, true, false);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = false,
+ });
}
MEM_freeN(objects);
@@ -9388,7 +9709,12 @@ static int edbm_smooth_normals_exec(bContext *C, wmOperator *op)
BM_loop_normal_editdata_array_free(lnors_ed_arr);
MEM_freeN(smooth_normal);
- EDBM_update_generic(obedit->data, true, false);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = true,
+ .calc_normals = false,
+ .is_destructive = false,
+ });
}
MEM_freeN(objects);
@@ -9477,7 +9803,12 @@ static int edbm_mod_weighted_strength_exec(bContext *C, wmOperator *op)
}
}
- EDBM_update_generic(obedit->data, false, false);
+ EDBM_update(obedit->data,
+ &(const struct EDBMUpdate_Params){
+ .calc_looptri = false,
+ .calc_normals = false,
+ .is_destructive = false,
+ });
}
MEM_freeN(objects);