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:
@@ -2620,11 +2620,7 @@ Object *BKE_object_duplicate(Main *bmain,
|
|||||||
|
|
||||||
Material ***matarar;
|
Material ***matarar;
|
||||||
|
|
||||||
Object *obn = (Object *)BKE_id_copy(bmain, &ob->id);
|
Object *obn = (Object *)BKE_id_copy_for_duplicate(bmain, &ob->id, dupflag);
|
||||||
id_us_min(&obn->id);
|
|
||||||
if (is_subprocess) {
|
|
||||||
ID_NEW_SET(ob, obn);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 0 == full linked. */
|
/* 0 == full linked. */
|
||||||
if (dupflag == 0) {
|
if (dupflag == 0) {
|
||||||
|
Reference in New Issue
Block a user