Outliner: expand view layer collections by default, revealing objects.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Mon, 31 Dec 2018 15:36:25 +0000 (16:36 +0100)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Mon, 31 Dec 2018 15:39:15 +0000 (16:39 +0100)
source/blender/editors/space_outliner/outliner_tree.c

index f7f0d441138c8b47a2da55a5b0ddca1069eeb41f..9ac96cf49294d887556bbda20874df311df2aabf 100644 (file)
@@ -1313,6 +1313,12 @@ static void outliner_add_layer_collections_recursive(
                ten->name = id->name + 2;
                ten->directdata = lc;
 
+               /* Open by default. */
+               TreeStoreElem *tselem = TREESTORE(ten);
+               if (!tselem->used) {
+                       tselem->flag &= ~TSE_CLOSED;
+               }
+
                const bool exclude = (lc->flag & LAYER_COLLECTION_EXCLUDE) != 0;
                if (exclude ||
                    ((layer->runtime_flag & VIEW_LAYER_HAS_HIDE) &&