diff options
Diffstat (limited to 'source/blender/editors/mesh/editmesh_tools.c')
-rw-r--r-- | source/blender/editors/mesh/editmesh_tools.c | 145 |
1 files changed, 72 insertions, 73 deletions
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 54605f4cb68..de0aa513da0 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -133,7 +133,7 @@ static int edbm_subdivide_exec(bContext *C, wmOperator *op) false, seed); - EDBM_update_generic(em, true, true); + EDBM_update_generic(obedit->data, true, true); } MEM_freeN(objects); @@ -325,7 +325,7 @@ static int edbm_subdivide_edge_ring_exec(bContext *C, wmOperator *op) continue; } - EDBM_update_generic(em, true, true); + EDBM_update_generic(obedit->data, true, true); } MEM_freeN(objects); @@ -385,7 +385,7 @@ static int edbm_unsubdivide_exec(bContext *C, wmOperator *op) } EDBM_selectmode_flush(em); - EDBM_update_generic(em, true, true); + EDBM_update_generic(obedit->data, true, true); } MEM_freeN(objects); @@ -534,7 +534,7 @@ static int edbm_delete_exec(bContext *C, wmOperator *op) EDBM_flag_disable_all(em, BM_ELEM_SELECT); - EDBM_update_generic(em, true, true); + EDBM_update_generic(obedit->data, true, true); DEG_id_tag_update(obedit->data, ID_RECALC_SELECT); WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data); @@ -663,7 +663,7 @@ static int edbm_delete_loose_exec(bContext *C, wmOperator *op) EDBM_flag_disable_all(em, BM_ELEM_SELECT); - EDBM_update_generic(em, true, true); + EDBM_update_generic(obedit->data, true, true); } int totelem_new[3]; @@ -721,7 +721,7 @@ static int edbm_collapse_edge_exec(bContext *C, wmOperator *op) continue; } - EDBM_update_generic(em, true, true); + EDBM_update_generic(obedit->data, true, true); } MEM_freeN(objects); @@ -1004,7 +1004,7 @@ static int edbm_add_edge_face_exec(bContext *C, wmOperator *op) continue; } - EDBM_update_generic(em, true, true); + EDBM_update_generic(obedit->data, true, true); changed_multi = true; } MEM_freeN(objects); @@ -1080,8 +1080,7 @@ 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]; - BMEditMesh *em = BKE_editmesh_from_object(obedit); - EDBM_update_generic(em, true, false); + EDBM_update_generic(obedit->data, true, false); } MEM_freeN(objects); @@ -1151,7 +1150,7 @@ static int edbm_mark_sharp_exec(bContext *C, wmOperator *op) BM_elem_flag_set(eed, BM_ELEM_SMOOTH, clear); } - EDBM_update_generic(em, true, false); + EDBM_update_generic(obedit->data, true, false); } MEM_freeN(objects); @@ -1185,7 +1184,7 @@ void MESH_OT_mark_sharp(wmOperatorType *ot) RNA_def_property_flag(prop, PROP_SKIP_SAVE); } -static bool edbm_connect_vert_pair(BMEditMesh *em, wmOperator *op) +static bool edbm_connect_vert_pair(BMEditMesh *em, struct Mesh *me, wmOperator *op) { BMesh *bm = em->bm; BMOperator bmop; @@ -1264,7 +1263,7 @@ static bool edbm_connect_vert_pair(BMEditMesh *em, wmOperator *op) /* so newly created edges get the selection state from the vertex */ EDBM_selectmode_flush(em); - EDBM_update_generic(em, true, true); + EDBM_update_generic(me, true, true); } } MEM_freeN(verts); @@ -1284,7 +1283,7 @@ static int edbm_vert_connect_exec(bContext *C, wmOperator *op) Object *obedit = objects[ob_index]; BMEditMesh *em = BKE_editmesh_from_object(obedit); - if (!edbm_connect_vert_pair(em, op)) { + if (!edbm_connect_vert_pair(em, obedit->data, op)) { failed_objects_len++; } } @@ -1541,7 +1540,7 @@ static int edbm_vert_connect_path_exec(bContext *C, wmOperator *op) /* when there is only 2 vertices, we can ignore selection order */ if (is_pair) { - if (!edbm_connect_vert_pair(em, op)) { + if (!edbm_connect_vert_pair(em, obedit->data, op)) { failed_connect_len++; } continue; @@ -1558,7 +1557,7 @@ static int edbm_vert_connect_path_exec(bContext *C, wmOperator *op) if (bm_vert_connect_select_history(bm)) { EDBM_selectmode_flush(em); - EDBM_update_generic(em, true, true); + EDBM_update_generic(obedit->data, true, true); } else { failed_selection_order_len++; @@ -1617,7 +1616,7 @@ 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(em, true, true); + EDBM_update_generic(obedit->data, true, true); } MEM_freeN(objects); @@ -1671,7 +1670,7 @@ static int edbm_vert_connect_nonplaner_exec(bContext *C, wmOperator *op) continue; } - EDBM_update_generic(em, true, true); + EDBM_update_generic(obedit->data, true, true); } MEM_freeN(objects); @@ -1740,7 +1739,7 @@ static int edbm_face_make_planar_exec(bContext *C, wmOperator *op) continue; } - EDBM_update_generic(em, true, true); + EDBM_update_generic(obedit->data, true, true); } MEM_freeN(objects); @@ -1794,7 +1793,7 @@ static int edbm_edge_split_exec(bContext *C, wmOperator *op) EDBM_select_flush(em); } - EDBM_update_generic(em, true, true); + EDBM_update_generic(obedit->data, true, true); } MEM_freeN(objects); @@ -1863,7 +1862,7 @@ static int edbm_duplicate_exec(bContext *C, wmOperator *op) if (!EDBM_op_finish(em, &bmop, op, true)) { continue; } - EDBM_update_generic(em, true, true); + EDBM_update_generic(obedit->data, true, true); } MEM_freeN(objects); @@ -1920,7 +1919,7 @@ static int edbm_flip_normals_exec(bContext *C, wmOperator *op) continue; } - EDBM_update_generic(em, true, false); + EDBM_update_generic(obedit->data, true, false); } MEM_freeN(objects); @@ -2031,7 +2030,7 @@ static int edbm_edge_rotate_selected_exec(bContext *C, wmOperator *op) continue; } - EDBM_update_generic(em, true, true); + EDBM_update_generic(obedit->data, true, true); } MEM_freeN(objects); @@ -2117,7 +2116,7 @@ static int edbm_hide_exec(bContext *C, wmOperator *op) } if (EDBM_mesh_hide(em, unselected)) { - EDBM_update_generic(em, true, false); + EDBM_update_generic(obedit->data, true, false); changed = true; } } @@ -2168,7 +2167,7 @@ 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(em, true, false); + EDBM_update_generic(obedit->data, true, false); } } MEM_freeN(objects); @@ -2221,7 +2220,7 @@ static int edbm_normals_make_consistent_exec(bContext *C, wmOperator *op) EDBM_op_callf(em, op, "reverse_faces faces=%hf flip_multires=%b", BM_ELEM_SELECT, true); } - EDBM_update_generic(em, true, false); + EDBM_update_generic(obedit->data, true, false); } MEM_freeN(objects); @@ -2335,7 +2334,7 @@ static int edbm_do_smooth_vertex_exec(bContext *C, wmOperator *op) EDBM_verts_mirror_cache_end(em); } - EDBM_update_generic(em, true, false); + EDBM_update_generic(obedit->data, true, false); } MEM_freeN(objects); @@ -2459,7 +2458,7 @@ static int edbm_do_smooth_laplacian_vertex_exec(bContext *C, wmOperator *op) EDBM_verts_mirror_cache_end(em); } - EDBM_update_generic(em, true, false); + EDBM_update_generic(obedit->data, true, false); } MEM_freeN(objects); @@ -2552,7 +2551,7 @@ static int edbm_faces_shade_smooth_exec(bContext *C, wmOperator *UNUSED(op)) } mesh_set_smooth_faces(em, 1); - EDBM_update_generic(em, false, false); + EDBM_update_generic(obedit->data, false, false); } MEM_freeN(objects); @@ -2595,7 +2594,7 @@ static int edbm_faces_shade_flat_exec(bContext *C, wmOperator *UNUSED(op)) } mesh_set_smooth_faces(em, 0); - EDBM_update_generic(em, false, false); + EDBM_update_generic(obedit->data, false, false); } MEM_freeN(objects); @@ -2652,7 +2651,7 @@ static int edbm_rotate_uvs_exec(bContext *C, wmOperator *op) continue; } - EDBM_update_generic(em, false, false); + EDBM_update_generic(obedit->data, false, false); } MEM_freeN(objects); @@ -2685,7 +2684,7 @@ static int edbm_reverse_uvs_exec(bContext *C, wmOperator *op) if (!EDBM_op_finish(em, &bmop, op, true)) { continue; } - EDBM_update_generic(em, false, false); + EDBM_update_generic(obedit->data, false, false); } MEM_freeN(objects); @@ -2723,7 +2722,7 @@ static int edbm_rotate_colors_exec(bContext *C, wmOperator *op) } /* dependencies graph and notification stuff */ - EDBM_update_generic(em, false, false); + EDBM_update_generic(ob->data, false, false); } MEM_freeN(objects); @@ -2739,8 +2738,8 @@ static int edbm_reverse_colors_exec(bContext *C, wmOperator *op) view_layer, CTX_wm_view3d(C), &objects_len); for (uint ob_index = 0; ob_index < objects_len; ob_index++) { - Object *ob = objects[ob_index]; - BMEditMesh *em = BKE_editmesh_from_object(ob); + Object *obedit = objects[ob_index]; + BMEditMesh *em = BKE_editmesh_from_object(obedit); if (em->bm->totfacesel == 0) { continue; @@ -2759,7 +2758,7 @@ static int edbm_reverse_colors_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - EDBM_update_generic(em, false, false); + EDBM_update_generic(obedit->data, false, false); } MEM_freeN(objects); @@ -3003,7 +3002,7 @@ static int edbm_merge_exec(bContext *C, wmOperator *op) continue; } - EDBM_update_generic(em, true, true); + EDBM_update_generic(obedit->data, true, true); /* once collapsed, we can't have edge/face selection */ if ((em->selectmode & SCE_SELECT_VERTEX) == 0) { @@ -3176,7 +3175,7 @@ static int edbm_remove_doubles_exec(bContext *C, wmOperator *op) if (count) { count_multi += count; - EDBM_update_generic(em, true, true); + EDBM_update_generic(obedit->data, true, true); } } MEM_freeN(objects); @@ -3270,7 +3269,7 @@ static int edbm_shape_propagate_to_all_exec(bContext *C, wmOperator *op) tot_shapekeys++; } - EDBM_update_generic(em, false, false); + EDBM_update_generic(me, false, false); } MEM_freeN(objects); @@ -3396,7 +3395,7 @@ static int edbm_blend_from_shape_exec(bContext *C, wmOperator *op) interp_v3_v3v3(eve->co, eve->co, co, blend); } } - EDBM_update_generic(em, true, false); + EDBM_update_generic(me, true, false); } } MEM_freeN(objects); @@ -3532,7 +3531,7 @@ static int edbm_solidify_exec(bContext *C, wmOperator *op) continue; } - EDBM_update_generic(em, true, true); + EDBM_update_generic(obedit->data, true, true); } MEM_freeN(objects); @@ -3861,7 +3860,7 @@ static int edbm_knife_cut_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - EDBM_update_generic(em, true, true); + EDBM_update_generic(obedit->data, true, true); return OPERATOR_FINISHED; } @@ -4259,7 +4258,7 @@ static int edbm_separate_exec(bContext *C, wmOperator *op) } if (retval) { - EDBM_update_generic(em, true, true); + EDBM_update_generic(base->object->data, true, true); } } MEM_freeN(bases); @@ -4406,7 +4405,7 @@ static int edbm_fill_exec(bContext *C, wmOperator *op) continue; } - EDBM_update_generic(em, true, true); + EDBM_update_generic(obedit->data, true, true); } MEM_freeN(objects); @@ -4679,7 +4678,7 @@ static int edbm_fill_grid_exec(bContext *C, wmOperator *op) continue; } - EDBM_update_generic(em, true, true); + EDBM_update_generic(obedit->data, true, true); } MEM_freeN(objects); @@ -4751,7 +4750,7 @@ static int edbm_fill_holes_exec(bContext *C, wmOperator *op) continue; } - EDBM_update_generic(em, true, true); + EDBM_update_generic(obedit->data, true, true); } MEM_freeN(objects); @@ -4834,7 +4833,7 @@ static int edbm_beautify_fill_exec(bContext *C, wmOperator *op) continue; } - EDBM_update_generic(em, true, true); + EDBM_update_generic(obedit->data, true, true); } MEM_freeN(objects); @@ -4920,7 +4919,7 @@ static int edbm_poke_face_exec(bContext *C, wmOperator *op) EDBM_mesh_normals_update(em); - EDBM_update_generic(em, true, true); + EDBM_update_generic(obedit->data, true, true); } MEM_freeN(objects); @@ -5018,7 +5017,7 @@ static int edbm_quads_convert_to_tris_exec(bContext *C, wmOperator *op) continue; } - EDBM_update_generic(em, true, true); + EDBM_update_generic(obedit->data, true, true); } MEM_freeN(objects); @@ -5126,7 +5125,7 @@ static int edbm_tris_convert_to_quads_exec(bContext *C, wmOperator *op) continue; } - EDBM_update_generic(em, true, true); + EDBM_update_generic(obedit->data, true, true); } MEM_freeN(objects); @@ -5310,7 +5309,7 @@ static int edbm_decimate_exec(bContext *C, wmOperator *op) } EDBM_selectmode_flush_ex(em, selectmode); } - EDBM_update_generic(em, true, true); + EDBM_update_generic(obedit->data, true, true); } MEM_freeN(objects); @@ -5446,7 +5445,7 @@ static int edbm_dissolve_verts_exec(bContext *C, wmOperator *op) use_boundary_tear)) { continue; } - EDBM_update_generic(em, true, true); + EDBM_update_generic(obedit->data, true, true); } MEM_freeN(objects); @@ -5503,7 +5502,7 @@ static int edbm_dissolve_edges_exec(bContext *C, wmOperator *op) continue; } - EDBM_update_generic(em, true, true); + EDBM_update_generic(obedit->data, true, true); } MEM_freeN(objects); @@ -5560,7 +5559,7 @@ static int edbm_dissolve_faces_exec(bContext *C, wmOperator *op) continue; } - EDBM_update_generic(em, true, true); + EDBM_update_generic(obedit->data, true, true); } MEM_freeN(objects); @@ -5703,7 +5702,7 @@ static int edbm_dissolve_limited_exec(bContext *C, wmOperator *op) use_dissolve_boundaries, delimit); - EDBM_update_generic(em, true, true); + EDBM_update_generic(obedit->data, true, true); } MEM_freeN(objects); @@ -5790,7 +5789,7 @@ 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(em, true, true); + EDBM_update_generic(obedit->data, true, true); totelem_new[0] += bm->totvert; totelem_new[1] += bm->totedge; @@ -5881,7 +5880,7 @@ static int edbm_delete_edgeloop_exec(bContext *C, wmOperator *op) EDBM_selectmode_flush_ex(em, SCE_SELECT_VERTEX); - EDBM_update_generic(em, true, true); + EDBM_update_generic(obedit->data, true, true); } MEM_freeN(objects); @@ -5941,7 +5940,7 @@ static int edbm_split_exec(bContext *C, wmOperator *op) /* Geometry has changed, need to recalc normals and looptris */ EDBM_mesh_normals_update(em); - EDBM_update_generic(em, true, true); + EDBM_update_generic(obedit->data, true, true); } MEM_freeN(objects); @@ -6683,6 +6682,7 @@ static int edbm_bridge_tag_boundary_edges(BMesh *bm) static int edbm_bridge_edge_loops_for_single_editmesh(wmOperator *op, BMEditMesh *em, + struct Mesh *me, const bool use_pairs, const bool use_cyclic, const bool use_merge, @@ -6784,7 +6784,7 @@ static int edbm_bridge_edge_loops_for_single_editmesh(wmOperator *op, } if (EDBM_op_finish(em, &bmop, op, true)) { - EDBM_update_generic(em, true, true); + EDBM_update_generic(me, true, true); } /* Always return finished so the user can select different options. */ @@ -6813,7 +6813,7 @@ static int edbm_bridge_edge_loops_exec(bContext *C, wmOperator *op) } edbm_bridge_edge_loops_for_single_editmesh( - op, em, use_pairs, use_cyclic, use_merge, merge_factor, twist_offset); + op, em, obedit->data, use_pairs, use_cyclic, use_merge, merge_factor, twist_offset); } MEM_freeN(objects); return OPERATOR_FINISHED; @@ -6919,7 +6919,7 @@ static int edbm_wireframe_exec(bContext *C, wmOperator *op) continue; } - EDBM_update_generic(em, true, true); + EDBM_update_generic(obedit->data, true, true); } MEM_freeN(objects); @@ -7030,7 +7030,7 @@ static int edbm_offset_edgeloop_exec(bContext *C, wmOperator *op) continue; } else { - EDBM_update_generic(em, true, true); + EDBM_update_generic(obedit->data, true, true); ret = OPERATOR_FINISHED; } } @@ -7147,7 +7147,7 @@ static int edbm_convex_hull_exec(bContext *C, wmOperator *op) continue; } - EDBM_update_generic(em, true, true); + EDBM_update_generic(obedit->data, true, true); EDBM_selectmode_flush(em); } @@ -7236,7 +7236,7 @@ static int mesh_symmetrize_exec(bContext *C, wmOperator *op) continue; } else { - EDBM_update_generic(em, true, true); + EDBM_update_generic(obedit->data, true, true); EDBM_selectmode_flush(em); } } @@ -7379,7 +7379,7 @@ static int mesh_symmetry_snap_exec(bContext *C, wmOperator *op) } } } - EDBM_update_generic(em, false, false); + EDBM_update_generic(obedit->data, false, false); /* No need to end cache, just free the array. */ MEM_freeN(index); @@ -8027,7 +8027,7 @@ static int edbm_point_normals_modal(bContext *C, wmOperator *op, const wmEvent * RNA_property_float_set_array(op->ptr, prop_target, target); } point_normals_apply(C, op, target, do_reset); - EDBM_update_generic(em, true, false); /* Recheck bools. */ + EDBM_update_generic(obedit->data, true, false); /* Recheck bools. */ point_normals_update_header(C, op); } @@ -8058,7 +8058,6 @@ static int edbm_point_normals_invoke(bContext *C, wmOperator *op, const wmEvent static int edbm_point_normals_exec(bContext *C, wmOperator *op) { Object *obedit = CTX_data_edit_object(C); - BMEditMesh *em = BKE_editmesh_from_object(obedit); if (!point_normals_init(C, op, NULL)) { point_normals_free(C, op); @@ -8073,7 +8072,7 @@ static int edbm_point_normals_exec(bContext *C, wmOperator *op) point_normals_apply(C, op, target, false); - EDBM_update_generic(em, true, false); + EDBM_update_generic(obedit->data, true, false); point_normals_free(C, op); return OPERATOR_FINISHED; @@ -8325,7 +8324,7 @@ static int normals_split_merge(bContext *C, const bool do_merge) BM_loop_normal_editdata_array_free(lnors_ed_arr); } - EDBM_update_generic(em, true, false); + EDBM_update_generic(obedit->data, true, false); } MEM_freeN(objects); @@ -8531,7 +8530,7 @@ static int edbm_average_normals_exec(bContext *C, wmOperator *op) } BLI_heapsimple_free(loop_weight, NULL); - EDBM_update_generic(em, true, false); + EDBM_update_generic(obedit->data, true, false); } MEM_freeN(objects); @@ -8778,7 +8777,7 @@ static int edbm_normals_tools_exec(bContext *C, wmOperator *op) BM_loop_normal_editdata_array_free(lnors_ed_arr); - EDBM_update_generic(em, true, false); + EDBM_update_generic(obedit->data, true, false); } MEM_freeN(objects); @@ -8926,7 +8925,7 @@ static int edbm_set_normals_from_faces_exec(bContext *C, wmOperator *op) MEM_freeN(loop_set); MEM_freeN(vnors); - EDBM_update_generic(em, true, false); + EDBM_update_generic(obedit->data, true, false); } MEM_freeN(objects); @@ -9028,7 +9027,7 @@ static int edbm_smoothen_normals_exec(bContext *C, wmOperator *op) BM_loop_normal_editdata_array_free(lnors_ed_arr); MEM_freeN(smooth_normal); - EDBM_update_generic(em, true, false); + EDBM_update_generic(obedit->data, true, false); } MEM_freeN(objects); @@ -9117,7 +9116,7 @@ static int edbm_mod_weighted_strength_exec(bContext *C, wmOperator *op) } } - EDBM_update_generic(em, false, false); + EDBM_update_generic(obedit->data, false, false); } MEM_freeN(objects); |