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:
authorSergey Sharybin <sergey.vfx@gmail.com>2019-06-12 13:11:49 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2019-06-12 13:11:49 +0300
commit27441c75573874c91a4fb71da993e7c7fb306a2c (patch)
tree35d7fb29c80fb1d1e4877449bb9cd6129d974821 /source/blender/depsgraph
parent75958326ade000bc391be90734aac1a28dde3ae2 (diff)
Fix T64710: Rigid body stops simulating when an object is selected
Need to preserve last evaluated time through copy-on-write process.
Diffstat (limited to 'source/blender/depsgraph')
-rw-r--r--source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
index 04d069af96d..be78eee91cc 100644
--- a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
+++ b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
@@ -63,6 +63,7 @@ extern "C" {
#include "DNA_sound_types.h"
#include "DNA_object_types.h"
#include "DNA_particle_types.h"
+#include "DNA_rigidbody_types.h"
#include "DRW_engine.h"
@@ -1010,6 +1011,7 @@ class SceneBackup {
void *playback_handle;
void *sound_scrub_handle;
void *speaker_handles;
+ float rigidbody_last_time;
SequencerBackup sequencer_backup;
};
@@ -1025,6 +1027,7 @@ void SceneBackup::reset()
playback_handle = NULL;
sound_scrub_handle = NULL;
speaker_handles = NULL;
+ rigidbody_last_time = -1;
}
void SceneBackup::init_from_scene(Scene *scene)
@@ -1034,6 +1037,10 @@ void SceneBackup::init_from_scene(Scene *scene)
sound_scrub_handle = scene->sound_scrub_handle;
speaker_handles = scene->speaker_handles;
+ if (scene->rigidbody_world != NULL) {
+ rigidbody_last_time = scene->rigidbody_world->ltime;
+ }
+
/* Clear pointers stored in the scene, so they are not freed when copied-on-written datablock
* is freed for re-allocation. */
scene->sound_scene = NULL;
@@ -1051,6 +1058,10 @@ void SceneBackup::restore_to_scene(Scene *scene)
scene->sound_scrub_handle = sound_scrub_handle;
scene->speaker_handles = speaker_handles;
+ if (scene->rigidbody_world != NULL) {
+ scene->rigidbody_world->ltime = rigidbody_last_time;
+ }
+
sequencer_backup.restore_to_scene(scene);
reset();