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 <campbell@blender.org>2022-03-17 06:37:20 +0300
committerCampbell Barton <campbell@blender.org>2022-03-17 06:37:20 +0300
commit1d88aeb95fc40771be7ef3a835af4206c845aa9b (patch)
treeac7108df46d7dcc7b6cebd206b0e3448f774f456 /source/blender/editors/curve
parentea0c86e961de20d4215824d5cfd239a1f4c4cc90 (diff)
View 3D: support for select passthrough when picking selected items
Currently this isn't used in the key-map, it will eventually allow the 3D viewports tweak tool to match the behavior of other editors that support tweaking a selection without first de-selecting all other elements.
Diffstat (limited to 'source/blender/editors/curve')
-rw-r--r--source/blender/editors/curve/editcurve.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index 1c1783669c3..5ff63e767f6 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -4740,23 +4740,29 @@ bool ED_curve_editnurb_select_pick(bContext *C,
ED_view3d_viewcontext_init(C, &vc, depsgraph);
copy_v2_v2_int(vc.mval, mval);
- const bool found = ED_curve_pick_vert(&vc, 1, &nu, &bezt, &bp, &hand, &basact);
+ bool found = ED_curve_pick_vert(&vc, 1, &nu, &bezt, &bp, &hand, &basact);
- if ((params->sel_op == SEL_OP_SET) && (found || params->deselect_all)) {
- /* Deselect everything. */
- uint objects_len = 0;
- Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data(
- vc.view_layer, vc.v3d, &objects_len);
- for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
- Object *ob_iter = objects[ob_index];
+ if (params->sel_op == SEL_OP_SET) {
+ if ((found && params->select_passthrough) &&
+ (((bezt ? (&bezt->f1)[hand] : bp->f1) & SELECT) != 0)) {
+ found = false;
+ }
+ else if (found || params->deselect_all) {
+ /* Deselect everything. */
+ uint objects_len = 0;
+ Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data(
+ vc.view_layer, vc.v3d, &objects_len);
+ for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
+ Object *ob_iter = objects[ob_index];
- ED_curve_deselect_all(((Curve *)ob_iter->data)->editnurb);
+ ED_curve_deselect_all(((Curve *)ob_iter->data)->editnurb);
- DEG_id_tag_update(ob_iter->data, ID_RECALC_SELECT | ID_RECALC_COPY_ON_WRITE);
- WM_event_add_notifier(C, NC_GEOM | ND_SELECT, ob_iter->data);
+ DEG_id_tag_update(ob_iter->data, ID_RECALC_SELECT | ID_RECALC_COPY_ON_WRITE);
+ WM_event_add_notifier(C, NC_GEOM | ND_SELECT, ob_iter->data);
+ }
+ MEM_freeN(objects);
+ changed = true;
}
- MEM_freeN(objects);
- changed = true;
}
if (found) {