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:
authorNathan Craddock <nzcraddock@gmail.com>2020-05-01 21:52:32 +0300
committerNathan Craddock <nzcraddock@gmail.com>2020-05-01 22:01:31 +0300
commitb52b5e15af682b64aeb11f4c3fc967b837590a8e (patch)
tree1863ae319f24c80597c174aba95279bf26a8c9bc
parent716638458d1517342da807aca3b382944b1fd7ba (diff)
Outliner: Fix selection extend not toggling
An unintentional side-effect of rBfe7528ee919b was that when extend-selecting a selected element in the outliner, it would be deselected and activated rather than selected and activated. This commit restores the expected toggling behavior. Consistent behavior for extend-selecting child datablocks is not resolvable without a much larger cleanup of the outliner select functions.
-rw-r--r--source/blender/editors/space_outliner/outliner_select.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c
index e87e71f0689..fa8422573ab 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -357,20 +357,24 @@ static eOLDrawState tree_element_set_active_object(bContext *C,
}
te_ob = outliner_find_id(soops, &soops->tree, (ID *)ob);
- if (te_ob != NULL) {
+ if (te_ob != NULL && te_ob != te) {
parent_tselem = TREESTORE(te_ob);
}
- if (!ELEM(NULL, parent_tselem, base)) {
+ if (base) {
if (set == OL_SETSEL_EXTEND) {
/* swap select */
if (base->flag & BASE_SELECTED) {
ED_object_base_select(base, BA_DESELECT);
- parent_tselem->flag &= ~TSE_SELECTED;
+ if (parent_tselem) {
+ parent_tselem->flag &= ~TSE_SELECTED;
+ }
}
else {
ED_object_base_select(base, BA_SELECT);
- parent_tselem->flag |= TSE_SELECTED;
+ if (parent_tselem) {
+ parent_tselem->flag |= TSE_SELECTED;
+ }
}
}
else {
@@ -386,7 +390,9 @@ static eOLDrawState tree_element_set_active_object(bContext *C,
BKE_view_layer_base_deselect_all(view_layer);
}
ED_object_base_select(base, BA_SELECT);
- parent_tselem->flag |= TSE_SELECTED;
+ if (parent_tselem) {
+ parent_tselem->flag |= TSE_SELECTED;
+ }
}
if (recursive) {