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>2018-10-29 05:25:04 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-10-29 05:25:04 +0300
commit45aa812fb385b9f7e1ca2f62f1477d21dcedc4af (patch)
treedb8ad3ef4ceac1aef7ce2912a830b450a7ef7fc5 /source/blender/editors/curve/editcurve_select.c
parenta0453dadf0685782ffb8ac6b3c6470a3d44c8a01 (diff)
Multi-Object EditMode: curve select more/less
D3844 by @zazizizou with support for select-less
Diffstat (limited to 'source/blender/editors/curve/editcurve_select.c')
-rw-r--r--source/blender/editors/curve/editcurve_select.c43
1 files changed, 30 insertions, 13 deletions
diff --git a/source/blender/editors/curve/editcurve_select.c b/source/blender/editors/curve/editcurve_select.c
index 1a4785f16f7..baf5950e263 100644
--- a/source/blender/editors/curve/editcurve_select.c
+++ b/source/blender/editors/curve/editcurve_select.c
@@ -764,9 +764,8 @@ void CURVE_OT_select_previous(wmOperatorType *ot)
/***************** select more operator **********************/
-static int select_more_exec(bContext *C, wmOperator *UNUSED(op))
+static void curve_select_more(Object *obedit)
{
- Object *obedit = CTX_data_edit_object(C);
ListBase *editnurb = object_editcurve_get(obedit);
Nurb *nu;
BPoint *bp, *tempbp;
@@ -829,10 +828,20 @@ static int select_more_exec(bContext *C, wmOperator *UNUSED(op))
select_adjacent_cp(editnurb, 1, 0, SELECT);
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);
-
+static int curve_select_more_exec(bContext *C, wmOperator *UNUSED(op))
+{
+ 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];
+ curve_select_more(obedit);
+ 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;
}
@@ -844,7 +853,7 @@ void CURVE_OT_select_more(wmOperatorType *ot)
ot->description = "Select control points directly linked to already selected ones";
/* api callbacks */
- ot->exec = select_more_exec;
+ ot->exec = curve_select_more_exec;
ot->poll = ED_operator_editsurfcurve;
/* flags */
@@ -854,9 +863,8 @@ void CURVE_OT_select_more(wmOperatorType *ot)
/******************** select less operator *****************/
/* basic method: deselect if control point doesn't have all neighbors selected */
-static int select_less_exec(bContext *C, wmOperator *UNUSED(op))
+static void curve_select_less(Object *obedit)
{
- Object *obedit = CTX_data_edit_object(C);
ListBase *editnurb = object_editcurve_get(obedit);
Nurb *nu;
BPoint *bp;
@@ -1017,11 +1025,20 @@ static int select_less_exec(bContext *C, wmOperator *UNUSED(op))
}
}
}
+}
- DEG_id_tag_update(obedit->data, DEG_TAG_SELECT_UPDATE);
- WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
- BKE_curve_nurb_vert_active_validate(obedit->data);
-
+static int curve_select_less_exec(bContext *C, wmOperator *UNUSED(op))
+{
+ 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];
+ curve_select_less(obedit);
+ 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;
}
@@ -1033,7 +1050,7 @@ void CURVE_OT_select_less(wmOperatorType *ot)
ot->description = "Reduce current selection by deselecting boundary elements";
/* api callbacks */
- ot->exec = select_less_exec;
+ ot->exec = curve_select_less_exec;
ot->poll = ED_operator_editsurfcurve;
/* flags */