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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2018-06-06 12:08:56 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-06-06 12:22:17 +0300
commitc4ce4034e67b8d7030e6ec932b264984e007e371 (patch)
treee95bd9d8d9daa7ff0ae0fa87f9fbe4fe22cde414 /source/blender
parent3e87c039ba1a76d614c5a934717b386fac2058d6 (diff)
Fix T55344: linked collection instance has user count 0.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenloader/intern/readfile.c1
-rw-r--r--source/blender/editors/object/object_group.c2
2 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 4afde29d538..a9f93dff9e6 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -10064,6 +10064,7 @@ static void add_collections_to_scene(
/* Assign the collection. */
ob->dup_group = collection;
+ id_us_plus(&collection->id);
ob->transflag |= OB_DUPLICOLLECTION;
copy_v3_v3(ob->loc, scene->cursor.location);
}
diff --git a/source/blender/editors/object/object_group.c b/source/blender/editors/object/object_group.c
index debbe4bd379..8a52b6c5ef5 100644
--- a/source/blender/editors/object/object_group.c
+++ b/source/blender/editors/object/object_group.c
@@ -361,6 +361,7 @@ static int collection_create_exec(bContext *C, wmOperator *op)
RNA_string_get(op->ptr, "name", name);
Collection *collection = BKE_collection_add(bmain, NULL, name);
+ id_fake_user_set(&collection->id);
CTX_DATA_BEGIN (C, Base *, base, selected_bases)
{
@@ -402,6 +403,7 @@ static int collection_add_exec(bContext *C, wmOperator *UNUSED(op))
return OPERATOR_CANCELLED;
Collection *collection = BKE_collection_add(bmain, NULL, "Collection");
+ id_fake_user_set(&collection->id);
BKE_collection_object_add(bmain, collection, ob);
WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob);