Commit: 95150b8414c119b4acb8f26fd19e800e5c42e4a0
Author: Campbell Barton
Date:   Mon Oct 29 13:41:44 2018 +1100
Branches: blender2.8
https://developer.blender.org/rB95150b8414c119b4acb8f26fd19e800e5c42e4a0

Multi-Object EditMode: curve select next/prev

D3842 & D3843 by @zazizizou

===================================================================

M       source/blender/editors/curve/editcurve_select.c

===================================================================

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;
 }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to