Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2018-02-09 14:04:00 +0300
committerDalai Felinto <dfelinto@gmail.com>2018-02-09 14:05:27 +0300
commit25074be697cb5726328aa5d064a60788c1da6aeb (patch)
treee75abc47e1d5c0db7ab4fe4db1d5989f7015c101 /source/blender/editors
parent37e53ca5f3496f9a09f46afd1e4ff2f1d2d153df (diff)
Fix collection syncing when creating new collections from the outliner
We were not passing a scene collection parent to the BKE_collection_add function, which in turn made syncing not work. Right now we: * Explicitly pass the master collection in this case * Fallback to the master collection in other cases With unittest.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/space_outliner/outliner_collections.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/editors/space_outliner/outliner_collections.c b/source/blender/editors/space_outliner/outliner_collections.c
index be4c8f62085..3d5f12a94fd 100644
--- a/source/blender/editors/space_outliner/outliner_collections.c
+++ b/source/blender/editors/space_outliner/outliner_collections.c
@@ -342,7 +342,8 @@ static int collection_new_exec(bContext *C, wmOperator *UNUSED(op))
Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
ViewLayer *view_layer = CTX_data_view_layer(C);
- SceneCollection *scene_collection = BKE_collection_add(&scene->id, NULL, COLLECTION_TYPE_NONE, NULL);
+ SceneCollection *scene_collection_parent = BKE_collection_master(&scene->id);
+ SceneCollection *scene_collection = BKE_collection_add(&scene->id, scene_collection_parent, COLLECTION_TYPE_NONE, NULL);
BKE_collection_link(view_layer, scene_collection);
DEG_relations_tag_update(bmain);