From 98a0bcd4252e952fa5438e9d1b69b0204f8a8746 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Wed, 27 Jun 2018 17:08:58 +0200 Subject: Prevent copying too much in the Rigid Body simulation To prevent the pointcache from being copied-on-write too (and requiring copying back), the cache is now shared between the original and evaluated scenes. Reading from the cache is always allowed; running the sim and writing to the cache is only allowed when the depsgraph is active. Some pointers have moved from RigidBodyWorld (RBO) to RigidBodyWorldShared (RBOS). writefile.c copies some pointers back from RBOS to RBO so that the file can still be opened on older Blenders without crashing on a segfault. The RigidBodyWorldShared struct is written to the blend file, because it refers to the PointCache ID block. The RigidObjectShared struct is runtime-only, and thus not saved to the blend file. An RNA getter-function is used to hide the new 'shared' pointer. As a result the Python API hasn't changed. Reviewed by: campbellbarton Differential Revision: https://developer.blender.org/D3508 --- source/blender/blenkernel/BKE_rigidbody.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/blenkernel/BKE_rigidbody.h') diff --git a/source/blender/blenkernel/BKE_rigidbody.h b/source/blender/blenkernel/BKE_rigidbody.h index b7d27cc7101..1fa8106d63b 100644 --- a/source/blender/blenkernel/BKE_rigidbody.h +++ b/source/blender/blenkernel/BKE_rigidbody.h @@ -44,8 +44,8 @@ struct Object; /* -------------- */ /* Memory Management */ -void BKE_rigidbody_free_world(struct RigidBodyWorld *rbw); -void BKE_rigidbody_free_object(struct Object *ob); +void BKE_rigidbody_free_world(struct Scene *scene); +void BKE_rigidbody_free_object(struct Object *ob, struct RigidBodyWorld *rbw); void BKE_rigidbody_free_constraint(struct Object *ob); /* ...... */ -- cgit v1.2.3