"wecube-portal/git@git.gitsec.cn:yecl/wecube.git" did not exist on "e1613e87f32ce034fe8dd3683079ad9199727c68"
Commit df56cdb6 authored by Emma Broman's avatar Emma Broman
Browse files

Move scriptscheduler time update to function that handles time progression

To avoid potential future problems with scriptscheduler time progressing when simulation time doesn't
parent 7714acf3
Showing with 5 additions and 1 deletion
+5 -1
...@@ -256,6 +256,10 @@ void TimeManager::progressTime(double dt) { ...@@ -256,6 +256,10 @@ void TimeManager::progressTime(double dt) {
// will override any timeline operations. // will override any timeline operations.
_currentTime.data().setTime(_timeNextFrame.j2000Seconds()); _currentTime.data().setTime(_timeNextFrame.j2000Seconds());
_integrateFromTime.data().setTime(_timeNextFrame.j2000Seconds()); _integrateFromTime.data().setTime(_timeNextFrame.j2000Seconds());
// Also make sure the script scheduler is up to date
global::scriptScheduler->setCurrentTime(_timeNextFrame.j2000Seconds());
_shouldSetTime = false; _shouldSetTime = false;
using K = CallbackHandle; using K = CallbackHandle;
...@@ -272,6 +276,7 @@ void TimeManager::progressTime(double dt) { ...@@ -272,6 +276,7 @@ void TimeManager::progressTime(double dt) {
std::function<bool(const KeyframeBase&, double)> comparisonFunc = std::function<bool(const KeyframeBase&, double)> comparisonFunc =
(global::sessionRecording->isPlayingBack()) ? (global::sessionRecording->isPlayingBack()) ?
&compareKeyframeTimeWithTime_playbackWithFrames : &compareKeyframeTimeWithTime; &compareKeyframeTimeWithTime_playbackWithFrames : &compareKeyframeTimeWithTime;
auto firstFutureKeyframe = std::lower_bound( auto firstFutureKeyframe = std::lower_bound(
keyframes.begin(), keyframes.begin(),
keyframes.end(), keyframes.end(),
...@@ -406,7 +411,6 @@ void TimeManager::setTimeNextFrame(Time t) { ...@@ -406,7 +411,6 @@ void TimeManager::setTimeNextFrame(Time t) {
_shouldSetTime = true; _shouldSetTime = true;
_timeNextFrame = std::move(t); _timeNextFrame = std::move(t);
clearKeyframes(); clearKeyframes();
global::scriptScheduler->setCurrentTime(t.j2000Seconds());
} }
void TimeManager::setDeltaTime(double deltaTime) { void TimeManager::setDeltaTime(double deltaTime) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment