diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2017-02-28 23:58:07 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2017-02-28 23:58:07 +0300 |
commit | fcbae6c3b389c81777d74d6db7676de4254dbc0e (patch) | |
tree | be37ff4054e28631507edb7d5b656d6537d590ab | |
parent | f35907444eb433a41f586a7efe4090a954c305a0 (diff) |
Outliner: Highlight active layer collection in "All Collections" mode
-rw-r--r-- | source/blender/editors/space_outliner/outliner_select.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c index cb4d5e9255b..dd89a36fe9c 100644 --- a/source/blender/editors/space_outliner/outliner_select.c +++ b/source/blender/editors/space_outliner/outliner_select.c @@ -755,14 +755,20 @@ static eOLDrawState tree_element_active_keymap_item( } static eOLDrawState tree_element_active_collection( - bContext *C, TreeElement *te, TreeStoreElem *UNUSED(tselem), const eOLSetState set) + bContext *C, TreeElement *te, TreeStoreElem *tselem, const eOLSetState set) { if (set == OL_SETSEL_NONE) { - if (CTX_data_layer_collection(C) == te->directdata) { + LayerCollection *active = CTX_data_layer_collection(C); + + if ((tselem->type == TSE_SCENE_COLLECTION && active->scene_collection == te->directdata) || + (tselem->type == TSE_LAYER_COLLECTION && active == te->directdata)) + { return OL_DRAWSEL_NORMAL; } } - else { + /* don't allow selecting a scene collection, it can have multiple layer collection + * instances (which one would the user want to be selected then?) */ + else if (tselem->type == TSE_LAYER_COLLECTION) { SceneLayer *sl = CTX_data_scene_layer(C); LayerCollection *lc = te->directdata; const int collection_index = BKE_layer_collection_findindex(sl, lc); @@ -850,6 +856,7 @@ eOLDrawState tree_element_type_active( case TSE_GP_LAYER: //return tree_element_active_gplayer(C, scene, s, te, tselem, set); break; + case TSE_SCENE_COLLECTION: case TSE_LAYER_COLLECTION: return tree_element_active_collection(C, te, tselem, set); } |