diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-11-02 00:31:36 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-11-02 00:31:36 +0300 |
commit | 2959e4c72c1c021fca53887ab902a98789b98f42 (patch) | |
tree | 481d88a148980046721aedd04610ad846656ebe8 /source/blender/editors | |
parent | 93b99306d837ff99c1127be21dc022ad92aec77c (diff) |
Multi-Object-Mode: Edit curve draw (deselect all)
D3887 by @zazizizou
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/curve/editcurve_paint.c | 10 | ||||
-rw-r--r-- | source/blender/editors/curve/editcurve_select.c | 9 | ||||
-rw-r--r-- | source/blender/editors/include/ED_curve.h | 1 |
3 files changed, 19 insertions, 1 deletions
diff --git a/source/blender/editors/curve/editcurve_paint.c b/source/blender/editors/curve/editcurve_paint.c index ceebcf79650..7f8091d66a7 100644 --- a/source/blender/editors/curve/editcurve_paint.c +++ b/source/blender/editors/curve/editcurve_paint.c @@ -36,6 +36,7 @@ #include "BKE_fcurve.h" #include "BKE_main.h" #include "BKE_report.h" +#include "BKE_layer.h" #include "DEG_depsgraph.h" @@ -791,7 +792,14 @@ static int curve_draw_exec(bContext *C, wmOperator *op) stroke_len = BLI_mempool_len(cdd->stroke_elem_pool); } - ED_curve_deselect_all(cu->editnurb); + /* Deselect all existing curves. */ + { + ViewLayer *view_layer = CTX_data_view_layer(C); + uint objects_len; + Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data(view_layer, &objects_len); + ED_curve_deselect_all_multi(objects, objects_len); + MEM_freeN(objects); + } const float radius_min = cps->radius_min; const float radius_max = cps->radius_max; diff --git a/source/blender/editors/curve/editcurve_select.c b/source/blender/editors/curve/editcurve_select.c index 30c9890eb68..43ab3f2ccbc 100644 --- a/source/blender/editors/curve/editcurve_select.c +++ b/source/blender/editors/curve/editcurve_select.c @@ -239,6 +239,15 @@ void ED_curve_deselect_all(EditNurb *editnurb) } } +void ED_curve_deselect_all_multi(Object **objects, int objects_len) +{ + for (uint ob_index = 0; ob_index < objects_len; ob_index++) { + Object *obedit = objects[ob_index]; + Curve *cu = obedit->data; + ED_curve_deselect_all(cu->editnurb); + } +} + void ED_curve_select_swap(EditNurb *editnurb, bool hide_handles) { Nurb *nu; diff --git a/source/blender/editors/include/ED_curve.h b/source/blender/editors/include/ED_curve.h index 03b54487731..5133fb46dc7 100644 --- a/source/blender/editors/include/ED_curve.h +++ b/source/blender/editors/include/ED_curve.h @@ -71,6 +71,7 @@ int join_curve_exec(struct bContext *C, struct wmOperator *op); /* editcurve_select.c */ bool ED_curve_select_check(struct View3D *v3d, struct EditNurb *editnurb); void ED_curve_deselect_all(struct EditNurb *editnurb); +void ED_curve_deselect_all_multi(struct Object **objects, int objects_len); void ED_curve_select_all(struct EditNurb *editnurb); void ED_curve_select_swap(struct EditNurb *editnurb, bool hide_handles); |