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/lattice/editlattice_select.c
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/lattice/editlattice_select.c')
-rw-r--r--source/blender/editors/lattice/editlattice_select.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/source/blender/editors/lattice/editlattice_select.c b/source/blender/editors/lattice/editlattice_select.c
index bc3bca248a4..ea99c6e23ff 100644
--- a/source/blender/editors/lattice/editlattice_select.c
+++ b/source/blender/editors/lattice/editlattice_select.c
@@ -623,22 +623,27 @@ bool ED_lattice_select_pick(bContext *C, const int mval[2], const struct SelectP
vc.mval[1] = mval[1];
bp = findnearestLattvert(&vc, true, &basact);
- const bool found = (bp != NULL);
+ bool found = (bp != NULL);
- 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 = objects[ob_index];
- if (ED_lattice_flags_set(ob, 0)) {
- DEG_id_tag_update(ob->data, ID_RECALC_SELECT);
- WM_event_add_notifier(C, NC_GEOM | ND_SELECT, ob->data);
+ if (params->sel_op == SEL_OP_SET) {
+ if ((found && params->select_passthrough) && (bp->f1 & SELECT)) {
+ 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 = objects[ob_index];
+ if (ED_lattice_flags_set(ob, 0)) {
+ DEG_id_tag_update(ob->data, ID_RECALC_SELECT);
+ WM_event_add_notifier(C, NC_GEOM | ND_SELECT, ob->data);
+ }
}
+ MEM_freeN(objects);
+ changed = true;
}
- MEM_freeN(objects);
- changed = true;
}
if (found) {