Fix (unreported) object duplicate code wrongly duplicating linked objects.

Linked data should only be duplicated if relevant `eDupli_ID_Flags` flag
is set (`USER_DUP_LINKED_ID`), this is being taken care of by generic
`BKE_id_copy_for_duplicate` function, but for some reasons (?)
`BKE_object_duplicate` was directly using `BKE_id_copy` for itself...

Note that this had especially bad consequences when duplicating
overrides of collections...
This commit is contained in:
Bastien Montagne
2021-03-23 15:59:21 +01:00
parent 9f19d01e3c
commit 29c0b34b20

View File

@@ -2620,11 +2620,7 @@ Object *BKE_object_duplicate(Main *bmain,
Material ***matarar;
Object *obn = (Object *)BKE_id_copy(bmain, &ob->id);
id_us_min(&obn->id);
if (is_subprocess) {
ID_NEW_SET(ob, obn);
}
Object *obn = (Object *)BKE_id_copy_for_duplicate(bmain, &ob->id, dupflag);
/* 0 == full linked. */
if (dupflag == 0) {