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:
authorSybren A. Stüvel <sybren@stuvel.eu>2018-06-27 18:08:58 +0300
committerSybren A. Stüvel <sybren@stuvel.eu>2018-06-28 15:20:11 +0300
commit98a0bcd4252e952fa5438e9d1b69b0204f8a8746 (patch)
treef3bf13553441e60b7097395220de9b146019135c /source/blender/blenkernel/intern/scene.c
parent9b050b736baea22547b6c6baaab37bba3356e42b (diff)
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
Diffstat (limited to 'source/blender/blenkernel/intern/scene.c')
-rw-r--r--source/blender/blenkernel/intern/scene.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 35429496662..a38384f8f2b 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -461,8 +461,7 @@ void BKE_scene_free_ex(Scene *sce, const bool do_id_user)
}
if (sce->rigidbody_world) {
- BKE_rigidbody_free_world(sce->rigidbody_world);
- sce->rigidbody_world = NULL;
+ BKE_rigidbody_free_world(sce);
}
if (sce->r.avicodecdata) {