[Bf-blender-cvs] [a768aa6ec85] blender2.8: Fix drag and drop in outliner for scene collections

Dalai Felinto noreply at git.blender.org
Fri Jan 5 17:01:12 CET 2018


Commit: a768aa6ec85f3ae1b4cc6c2e28cdba2ed85dd0de
Author: Dalai Felinto
Date:   Fri Jan 5 13:27:32 2018 -0200
Branches: blender2.8
https://developer.blender.org/rBa768aa6ec85f3ae1b4cc6c2e28cdba2ed85dd0de

Fix drag and drop in outliner for scene collections

This technically reverts 176698b2eb7f.

Drag and drop for scene collections requires id for its poll function. However
we were passing the collection as id pointer for outliner_add_element
(which is ok since the function doesn't require a real ID).

I couldn't reproduce the original issue tackled by the forementioned commit so
I'm going ahead and bringing drag and drop back for scene collections.

Note: We already pass the ID for view layer collections as well since we brought
collections into groups.

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

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

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

diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c
index 22ce112f466..5ea83515f51 100644
--- a/source/blender/editors/space_outliner/outliner_tree.c
+++ b/source/blender/editors/space_outliner/outliner_tree.c
@@ -1491,9 +1491,9 @@ BLI_INLINE void outliner_add_scene_collection_objects(
 }
 
 static TreeElement *outliner_add_scene_collection_recursive(
-        SpaceOops *soops, ListBase *tree, SceneCollection *scene_collection, TreeElement *parent_ten)
+        SpaceOops *soops, ListBase *tree, ID *id, SceneCollection *scene_collection, TreeElement *parent_ten)
 {
-	TreeElement *ten = outliner_add_element(soops, tree, scene_collection, parent_ten, TSE_SCENE_COLLECTION, 0);
+	TreeElement *ten = outliner_add_element(soops, tree, id, parent_ten, TSE_SCENE_COLLECTION, 0);
 	outliner_add_scene_collection_init(ten, scene_collection);
 	outliner_add_scene_collection_objects(soops, &ten->subtree, scene_collection, ten);
 
@@ -1501,7 +1501,7 @@ static TreeElement *outliner_add_scene_collection_recursive(
 	     scene_collection_nested != NULL;
 	     scene_collection_nested = scene_collection_nested->next)
 	{
-		outliner_add_scene_collection_recursive(soops, &ten->subtree, scene_collection_nested, ten);
+		outliner_add_scene_collection_recursive(soops, &ten->subtree, id, scene_collection_nested, ten);
 	}
 
 	outliner_make_hierarchy(&ten->subtree);
@@ -1511,7 +1511,7 @@ static TreeElement *outliner_add_scene_collection_recursive(
 static void outliner_add_collections_master(SpaceOops *soops, Scene *scene)
 {
 	SceneCollection *master_collection = BKE_collection_master(&scene->id);
-	TreeElement *ten = outliner_add_scene_collection_recursive(soops, &soops->tree, master_collection, NULL);
+	TreeElement *ten = outliner_add_scene_collection_recursive(soops, &soops->tree, &scene->id, master_collection, NULL);
 	/* Master Collection should always be expanded. */
 	TREESTORE(ten)->flag &= ~TSE_CLOSED;
 }



More information about the Bf-blender-cvs mailing list