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:
authorBastien Montagne <bastien@blender.org>2021-09-30 16:22:16 +0300
committerBastien Montagne <bastien@blender.org>2021-09-30 17:00:29 +0300
commit1a72744ddc4a34ce32f308a9011423c2099b49d3 (patch)
tree7aad8f49a71fcff1c61c456c26b6f10d28c89ca5 /source/blender/blenkernel/intern/lib_id.c
parent779ea49af785bcd7a2911cba1a929856e21f2c3c (diff)
Fix T90246: Full Copy'ing a scene confuses physics in the original scene.
Handling of RigidBody data in duplicate of scenes/collections was very wrong. This commit: - Add handling of duplication of RB collections when fully duplicating a scene. - Fix Object duplication trying to add duplicated RB objects to matching RBW collections. While the later behavior is desired when only duplicated objects, when duplicating their collections and/or scenes it is actually very bad, as it would add back new object duplicates to old (RBW) collections.
Diffstat (limited to 'source/blender/blenkernel/intern/lib_id.c')
-rw-r--r--source/blender/blenkernel/intern/lib_id.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/lib_id.c b/source/blender/blenkernel/intern/lib_id.c
index 18824e73ee5..3b2d2c5d2c3 100644
--- a/source/blender/blenkernel/intern/lib_id.c
+++ b/source/blender/blenkernel/intern/lib_id.c
@@ -674,7 +674,10 @@ ID *BKE_id_copy(Main *bmain, const ID *id)
* Invokes the appropriate copy method for the block and returns the result in
* newid, unless test. Returns true if the block can be copied.
*/
-ID *BKE_id_copy_for_duplicate(Main *bmain, ID *id, const eDupli_ID_Flags duplicate_flags)
+ID *BKE_id_copy_for_duplicate(Main *bmain,
+ ID *id,
+ const eDupli_ID_Flags duplicate_flags,
+ const int copy_flags)
{
if (id == NULL) {
return id;
@@ -685,7 +688,7 @@ ID *BKE_id_copy_for_duplicate(Main *bmain, ID *id, const eDupli_ID_Flags duplica
return id;
}
- ID *id_new = BKE_id_copy(bmain, id);
+ ID *id_new = BKE_id_copy_ex(bmain, id, NULL, copy_flags);
/* Copying add one user by default, need to get rid of that one. */
id_us_min(id_new);
ID_NEW_SET(id, id_new);