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.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c
index 2031576190e..06710b40569 100644
--- a/source/blender/blenkernel/intern/collection.c
+++ b/source/blender/blenkernel/intern/collection.c
@@ -338,8 +338,9 @@ Collection *BKE_collection_duplicate(Main *bmain,
const bool do_obdata)
{
/* It's not allowed to copy the master collection. */
+ BLI_assert((collection->id.flag & LIB_PRIVATE_DATA) == 0);
+ BLI_assert((collection->flag & COLLECTION_IS_MASTER) == 0);
if (collection->flag & COLLECTION_IS_MASTER) {
- BLI_assert("!Master collection can't be duplicated");
return NULL;
}
@@ -368,6 +369,7 @@ Collection *BKE_collection_duplicate(Main *bmain,
Collection *BKE_collection_copy_master(Main *bmain, Collection *collection, const int flag)
{
BLI_assert(collection->flag & COLLECTION_IS_MASTER);
+ BLI_assert(collection->id.flag & LIB_PRIVATE_DATA);
Collection *collection_dst = MEM_dupallocN(collection);
BKE_collection_copy_data(bmain, collection_dst, collection, flag);
@@ -499,6 +501,7 @@ Collection *BKE_collection_master_add()
/* Not an actual datablock, but owned by scene. */
Collection *master_collection = MEM_callocN(sizeof(Collection), "Master Collection");
STRNCPY(master_collection->id.name, "GRMaster Collection");
+ master_collection->id.flag |= LIB_PRIVATE_DATA;
master_collection->flag |= COLLECTION_IS_MASTER;
return master_collection;
}