diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-10-29 05:41:44 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-10-29 05:41:44 +0300 |
commit | 95150b8414c119b4acb8f26fd19e800e5c42e4a0 (patch) | |
tree | 140640c9dc68fdc006c076059d244547d2059b98 /source/blender | |
parent | 45aa812fb385b9f7e1ca2f62f1477d21dcedc4af (diff) |
Multi-Object EditMode: curve select next/prev
D3842 & D3843 by @zazizizou
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/curve/editcurve_select.c | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/source/blender/editors/curve/editcurve_select.c b/source/blender/editors/curve/editcurve_select.c index baf5950e263..6792ff01347 100644 --- a/source/blender/editors/curve/editcurve_select.c +++ b/source/blender/editors/curve/editcurve_select.c @@ -708,13 +708,18 @@ void CURVE_OT_select_row(wmOperatorType *ot) static int select_next_exec(bContext *C, wmOperator *UNUSED(op)) { - Object *obedit = CTX_data_edit_object(C); - ListBase *editnurb = object_editcurve_get(obedit); - - select_adjacent_cp(editnurb, 1, 0, SELECT); - DEG_id_tag_update(obedit->data, DEG_TAG_SELECT_UPDATE); - WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data); + ViewLayer *view_layer = CTX_data_view_layer(C); + uint objects_len = 0; + 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]; + ListBase *editnurb = object_editcurve_get(obedit); + select_adjacent_cp(editnurb, 1, 0, SELECT); + DEG_id_tag_update(obedit->data, DEG_TAG_SELECT_UPDATE); + WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data); + } + MEM_freeN(objects); return OPERATOR_FINISHED; } @@ -737,13 +742,18 @@ void CURVE_OT_select_next(wmOperatorType *ot) static int select_previous_exec(bContext *C, wmOperator *UNUSED(op)) { - Object *obedit = CTX_data_edit_object(C); - ListBase *editnurb = object_editcurve_get(obedit); - - select_adjacent_cp(editnurb, -1, 0, SELECT); - DEG_id_tag_update(obedit->data, DEG_TAG_SELECT_UPDATE); - WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data); + ViewLayer *view_layer = CTX_data_view_layer(C); + uint objects_len = 0; + 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]; + ListBase *editnurb = object_editcurve_get(obedit); + select_adjacent_cp(editnurb, -1, 0, SELECT); + DEG_id_tag_update(obedit->data, DEG_TAG_SELECT_UPDATE); + WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data); + } + MEM_freeN(objects); return OPERATOR_FINISHED; } |