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:
authorJulian Eisel <eiseljulian@gmail.com>2017-02-28 23:58:07 +0300
committerJulian Eisel <eiseljulian@gmail.com>2017-02-28 23:58:07 +0300
commitfcbae6c3b389c81777d74d6db7676de4254dbc0e (patch)
treebe37ff4054e28631507edb7d5b656d6537d590ab /source/blender/editors
parentf35907444eb433a41f586a7efe4090a954c305a0 (diff)
Outliner: Highlight active layer collection in "All Collections" mode
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/space_outliner/outliner_select.c13
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);
}