[Bf-blender-cvs] [647232f7f16] blender2.8: Multi-Object-Mode: EditCurve Select Linked

Campbell Barton noreply at git.blender.org
Wed May 23 07:35:51 CEST 2018


Commit: 647232f7f16c9fa623a3cde92e4dfa9073c141cc
Author: Campbell Barton
Date:   Wed May 23 07:34:10 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB647232f7f16c9fa623a3cde92e4dfa9073c141cc

Multi-Object-Mode: EditCurve Select Linked

D3409 by @dgriffin91

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

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 3b2865e91c3..58fb6d50575 100644
--- a/source/blender/editors/curve/editcurve_select.c
+++ b/source/blender/editors/curve/editcurve_select.c
@@ -520,19 +520,30 @@ void CURVE_OT_select_all(wmOperatorType *ot)
 
 static int select_linked_exec(bContext *C, wmOperator *UNUSED(op))
 {
-	Object *obedit = CTX_data_edit_object(C);
-	Curve *cu = (Curve *)obedit->data;
-	EditNurb *editnurb = cu->editnurb;
-	ListBase *nurbs = &editnurb->nurbs;
-	Nurb *nu;
+	ViewLayer *view_layer = CTX_data_view_layer(C);
 
-	for (nu = nurbs->first; nu; nu = nu->next) {
-		if (ED_curve_nurb_select_check(cu, nu)) {
-			ED_curve_nurb_select_all(nu);
+	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 *cu = obedit->data;
+		EditNurb *editnurb = cu->editnurb;
+		ListBase *nurbs = &editnurb->nurbs;
+		Nurb *nu;
+		bool changed = false;
+
+		for (nu = nurbs->first; nu; nu = nu->next) {
+			if (ED_curve_nurb_select_check(cu, nu)) {
+				ED_curve_nurb_select_all(nu);
+				changed = true;
+			}
 		}
-	}
 
-	WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
+		if (changed) {
+			WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
+		}
+	}
+	MEM_freeN(objects);
 
 	return OPERATOR_FINISHED;
 }
@@ -547,7 +558,7 @@ void CURVE_OT_select_linked(wmOperatorType *ot)
 	/* identifiers */
 	ot->name = "Select Linked All";
 	ot->idname = "CURVE_OT_select_linked";
-	ot->description = "Select all control points linked to active one";
+	ot->description = "Select all control points linked to the current selection";
 
 	/* api callbacks */
 	ot->exec = select_linked_exec;



More information about the Bf-blender-cvs mailing list