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-03-05 09:01:23 +0300
committerNathan Craddock <nzcraddock@gmail.com>2020-03-05 17:40:29 +0300
commitfe7528ee919ba75a1216aad3257faede33cbac14 (patch)
treeac7cb10694f63cfc106a77f0df094e7c5ebac687 /source/blender/editors
parent60c208e2d604aae033ff3324f4fe7ee7c1364b58 (diff)
Fix T74332: selection sync replacing parent selection
Selecting certain child datablocks also selects the parent (e.g. selecting a pose bone selects the armature). The base was selected, but the outliner tree element was left unselected. The subsequent selection sync would then deselect the parent base because it was not flagged as selected in the outliner. This led to issues like T74332 where selecting a pose bone in the outliner did not show drivers in the driver editor unless the armature was explicitly added to the selection afterwards. The solution is to also flag the outliner elements as selected when selecting parent bases. Differential Revision: https://developer.blender.org/D7029
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/space_outliner/outliner_select.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c
index fd0dbd63c89..715b554b154 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -308,6 +308,7 @@ static eOLDrawState tree_element_set_active_object(bContext *C,
bool recursive)
{
TreeStoreElem *tselem = TREESTORE(te);
+ TreeStoreElem *parent_tselem;
Scene *sce;
Base *base;
Object *ob = NULL;
@@ -318,7 +319,9 @@ static eOLDrawState tree_element_set_active_object(bContext *C,
}
else {
ob = (Object *)outliner_search_back(soops, te, ID_OB);
- if (ob == OBACT(view_layer)) {
+
+ /* Don't return when activating children of the previous active object. */
+ if (ob == OBACT(view_layer) && set == OL_SETSEL_NONE) {
return OL_DRAWSEL_NONE;
}
}
@@ -352,14 +355,17 @@ static eOLDrawState tree_element_set_active_object(bContext *C,
}
}
+ parent_tselem = TREESTORE(outliner_find_id(soops, &soops->tree, (ID *)ob));
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;
}
else {
ED_object_base_select(base, BA_SELECT);
+ parent_tselem->flag |= TSE_SELECTED;
}
}
else {
@@ -375,6 +381,7 @@ 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 (recursive) {