diff options
author | Bastien Montagne <bastien@blender.org> | 2021-03-23 17:59:21 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2021-03-23 18:03:12 +0300 |
commit | 29c0b34b209e4fa0548a1ff0716751f1fcfb51d5 (patch) | |
tree | e93e95247ad971c3b57a6209541673b08469685b /source/blender/blenkernel | |
parent | 9f19d01e3ccbcce819e8115182b3522c904f8bf4 (diff) |
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...
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 76c96ec9603..00e99f193a2 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -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) { |