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:
Diffstat (limited to 'source/blender/blenkernel/intern/collection.c')
-rw-r--r--source/blender/blenkernel/intern/collection.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c
index 729be02bfc7..69168c4dd3d 100644
--- a/source/blender/blenkernel/intern/collection.c
+++ b/source/blender/blenkernel/intern/collection.c
@@ -111,6 +111,10 @@ static SceneCollection *collection_add(ID *owner_id, SceneCollection *sc_parent,
*/
SceneCollection *BKE_collection_add(ID *owner_id, SceneCollection *sc_parent, const int type, const char *name_custom)
{
+ if (sc_parent == NULL) {
+ sc_parent = BKE_collection_master(owner_id);
+ }
+
SceneCollection *scene_collection = collection_add(owner_id, sc_parent, type, name_custom);
BKE_layer_sync_new_scene_collection(owner_id, sc_parent, scene_collection);
return scene_collection;