From a768aa6ec85f3ae1b4cc6c2e28cdba2ed85dd0de Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Fri, 5 Jan 2018 13:27:32 -0200 Subject: [PATCH] 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. --- source/blender/editors/space_outliner/outliner_tree.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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; }