diff options
Diffstat (limited to 'source/blender/editors/curve')
-rw-r--r-- | source/blender/editors/curve/editcurve_paint.c | 10 | ||||
-rw-r--r-- | source/blender/editors/curve/editcurve_select.c | 9 |
2 files changed, 18 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; |