[Bf-blender-cvs] [a9fe94245b9] blender2.8: Outliner: Master Collection always expanded

Dalai Felinto noreply at git.blender.org
Tue Jan 2 18:01:39 CET 2018


Commit: a9fe94245b9727858f9175c302196a7c722f9181
Author: Dalai Felinto
Date:   Tue Jan 2 14:00:03 2018 -0200
Branches: blender2.8
https://developer.blender.org/rBa9fe94245b9727858f9175c302196a7c722f9181

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.

===================================================================

M	source/blender/editors/space_outliner/outliner_draw.c
M	source/blender/editors/space_outliner/outliner_tree.c

===================================================================

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;
 }
 
 /* ======================================================= */



More information about the Bf-blender-cvs mailing list