diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2018-10-30 23:04:27 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2018-10-30 23:07:32 +0300 |
commit | d7c6013d01ee12da5c04be3dc38d3d4fd726a0b5 (patch) | |
tree | e0e45ed8930a3de483897cab7d88935987ab613e /source/blender/editors | |
parent | df613a52e66676e514fa3241533780cdcc636a9a (diff) |
Multi-Objects: CURVE_OT_dissolve_verts
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/curve/editcurve.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index e717f9497a7..d3e20173564 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -5897,11 +5897,19 @@ static bool test_bezt_is_sel_any(const void *bezt_v, void *user_data) static int curve_dissolve_exec(bContext *C, wmOperator *UNUSED(op)) { - Object *obedit = CTX_data_edit_object(C); + ViewLayer *view_layer = CTX_data_view_layer(C); View3D *v3d = CTX_wm_view3d(C); - Curve *cu = (Curve *)obedit->data; - { + uint objects_len; + Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data(view_layer, &objects_len); + for (uint ob_index = 0; ob_index < objects_len; ob_index++) { + Object *obedit = objects[ob_index]; + Curve *cu = (Curve *)obedit->data; + + if (!ED_curve_select_check(v3d, cu->editnurb)) { + continue; + } + ListBase *editnurb = object_editcurve_get(obedit); Nurb *nu; @@ -5968,11 +5976,9 @@ static int curve_dissolve_exec(bContext *C, wmOperator *UNUSED(op)) } } } - } - ed_curve_delete_selected(obedit, v3d); + ed_curve_delete_selected(obedit, v3d); - { cu->actnu = cu->actvert = CU_ACT_NONE; if (ED_curve_updateAnimPaths(obedit->data)) WM_event_add_notifier(C, NC_OBJECT | ND_KEYS, obedit); @@ -5980,7 +5986,7 @@ static int curve_dissolve_exec(bContext *C, wmOperator *UNUSED(op)) WM_event_add_notifier(C, NC_GEOM | ND_DATA, obedit->data); DEG_id_tag_update(obedit->data, 0); } - + MEM_freeN(objects); return OPERATOR_FINISHED; } |