Fix T57288: Assert when deleting duplicated collection (id->us == 0).

Copying an ID also add a default user to new one (just like creating an
ID), by default...
This commit is contained in:
Bastien Montagne 2018-10-23 11:59:53 +02:00
parent 6d1fd1dc58
commit f927f388f6
Notes: blender-bot 2023-02-14 10:29:30 +01:00
Referenced by issue #57288, Assert when deleting duplicated collection (id->us == 0)
1 changed files with 1 additions and 0 deletions

View File

@ -231,6 +231,7 @@ Collection *BKE_collection_copy(Main *bmain, Collection *parent, Collection *col
Collection *collection_new;
BKE_id_copy_ex(bmain, &collection->id, (ID **)&collection_new, 0, false);
id_us_min(collection_new); /* Copying add one user by default, need to get rid of that one. */
/* Optionally add to parent. */
if (parent) {