From 105ae3be9993a646615499bf793cb14549e4104d Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Tue, 16 Jul 2019 16:04:22 +0200 Subject: Fix T66944: Rigid Body Constraint in duplicated collection is not added to RigidBodyConstraints collection. We only had a very limited, specific handling of that in collection duplication code, but this has to be handled at a much more general level in Object copy code itself, since it makes no sense to duplicate rigidbody object data without adding new copy to relevant rigidbody collections... WARNING: This is a fairly risky rework of rigidbody handling logic when copying an Object data-block. It is *NOT* considered safe enough for 2.80 release. I tried to take into account copy flags to not mess with other IDs (collections) when we are copying outside of Main, and also not do deg tags when this is forbidden, but risk of something going wrong here is too high... --- source/blender/blenkernel/intern/object.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source/blender/blenkernel/intern/object.c') diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 2a66edc8d42..d7256cc9604 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -1417,8 +1417,7 @@ void BKE_object_copy_data(Main *bmain, Object *ob_dst, const Object *ob_src, con } } BKE_object_copy_softbody(ob_dst, ob_src, flag_subdata); - ob_dst->rigidbody_object = BKE_rigidbody_copy_object(ob_src, flag_subdata); - ob_dst->rigidbody_constraint = BKE_rigidbody_copy_constraint(ob_src, flag_subdata); + BKE_rigidbody_object_copy(bmain, ob_dst, ob_src, flag_subdata); BKE_object_copy_particlesystems(ob_dst, ob_src, flag_subdata); -- cgit v1.2.3