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:
authorDalai Felinto <dfelinto@gmail.com>2018-11-02 18:37:23 +0300
committerDalai Felinto <dfelinto@gmail.com>2018-11-02 18:37:56 +0300
commit500ebf7348bbc9307537fa51b1600f18be83d134 (patch)
treeeef282bab89f8caf2b5e5faa05732975949c87bd /source/blender/editors/curve
parentfddf608e79f388555c5bc5d2130887aab29b1df7 (diff)
Multi-Objects: CURVE_OT_normals_make_consistent
Diffstat (limited to 'source/blender/editors/curve')
-rw-r--r--source/blender/editors/curve/editcurve.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index 13a5039f576..04daa4e9f43 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -3783,15 +3783,28 @@ void CURVE_OT_handle_type_set(wmOperatorType *ot)
static int curve_normals_make_consistent_exec(bContext *C, wmOperator *op)
{
- Object *obedit = CTX_data_edit_object(C);
- ListBase *editnurb = object_editcurve_get(obedit);
+ ViewLayer *view_layer = CTX_data_view_layer(C);
+ View3D *v3d = CTX_wm_view3d(C);
+
const bool calc_length = RNA_boolean_get(op->ptr, "calc_length");
- BKE_nurbList_handles_recalculate(editnurb, calc_length, SELECT);
+ 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 = obedit->data;
- WM_event_add_notifier(C, NC_GEOM | ND_DATA, obedit->data);
- DEG_id_tag_update(obedit->data, 0);
+ if (!ED_curve_select_check(v3d, cu->editnurb)) {
+ continue;
+ }
+
+ ListBase *editnurb = object_editcurve_get(obedit);
+ BKE_nurbList_handles_recalculate(editnurb, calc_length, SELECT);
+ WM_event_add_notifier(C, NC_GEOM | ND_DATA, obedit->data);
+ DEG_id_tag_update(obedit->data, 0);
+ }
+ MEM_freeN(objects);
return OPERATOR_FINISHED;
}