diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2018-01-02 19:00:03 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2018-01-02 19:40:33 +0300 |
commit | a9fe94245b9727858f9175c302196a7c722f9181 (patch) | |
tree | 5c7980903c50e7ba7ba27511a67090059d87acdb /source/blender/editors/space_outliner | |
parent | e1238bccedb095389c07d729b18cd572d8f65ca3 (diff) |
Outliner: Master Collection always expanded
This is part of T53495.
This makes sure the master collection is always expanded and you don't even get
the expand/collapse icons for it.
This is only for the Collecions (currently Master Collection Tree) option, not
for active view layer.
Diffstat (limited to 'source/blender/editors/space_outliner')
-rw-r--r-- | source/blender/editors/space_outliner/outliner_draw.c | 5 | ||||
-rw-r--r-- | source/blender/editors/space_outliner/outliner_tree.c | 7 |
2 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index a3912383369..8d338347cf7 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -1411,8 +1411,11 @@ static void outliner_draw_tree_element( te->flag |= TE_ACTIVE; // for lookup in display hierarchies } + if ((soops->outlinevis == SO_COLLECTIONS) && te->parent == NULL) { + /* Master collection can't expand/collapse. */ + } + else if (te->subtree.first || (tselem->type == 0 && te->idcode == ID_SCE) || (te->flag & TE_LAZY_CLOSED)) { /* open/close icon, only when sublevels, except for scene */ - if (te->subtree.first || (tselem->type == 0 && te->idcode == ID_SCE) || (te->flag & TE_LAZY_CLOSED)) { int icon_x; if (tselem->type == 0 && ELEM(te->idcode, ID_OB, ID_SCE)) icon_x = startx; diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c index 2906e2122dd..4842b3cf789 100644 --- a/source/blender/editors/space_outliner/outliner_tree.c +++ b/source/blender/editors/space_outliner/outliner_tree.c @@ -1490,7 +1490,7 @@ static void inline outliner_add_scene_collection_objects( } } -static void outliner_add_scene_collection_recursive( +static TreeElement *outliner_add_scene_collection_recursive( SpaceOops *soops, ListBase *tree, SceneCollection *scene_collection, TreeElement *parent_ten) { TreeElement *ten = outliner_add_element(soops, tree, scene_collection, parent_ten, TSE_SCENE_COLLECTION, 0); @@ -1505,12 +1505,15 @@ static void outliner_add_scene_collection_recursive( } outliner_make_hierarchy(&ten->subtree); + return ten; } static void outliner_add_collections_master(SpaceOops *soops, Scene *scene) { SceneCollection *master_collection = BKE_collection_master(&scene->id); - outliner_add_scene_collection_recursive(soops, &soops->tree, master_collection, NULL); + TreeElement *ten = outliner_add_scene_collection_recursive(soops, &soops->tree, master_collection, NULL); + /* Master Collection should always be expanded. */ + TREESTORE(ten)->flag &= ~TSE_CLOSED; } /* ======================================================= */ |