Autopause camera paths using script

Makes the script propagate to all nodes, as well as being recorded during session recording
This commit is contained in:
Emma Broman
2022-01-27 11:27:05 +01:00
parent c3ab68cd93
commit 6bc7d36920

View File

@@ -267,7 +267,11 @@ void PathNavigator::startPath() {
// moving. However, keep track of whether the time was running before the path
// was started, so we can reset it on finish
if (!global::timeManager->isPaused()) {
global::timeManager->setPause(true);
openspace::global::scriptEngine->queueScript(
"openspace.time.setPause(true)",
scripting::ScriptEngine::RemoteScripting::Yes
);
_startSimulationTimeOnFinish = true;
LINFO(
"Pausing time simulation during path traversal. "
@@ -337,7 +341,10 @@ void PathNavigator::handlePathEnd() {
_isPlaying = false;
if (_startSimulationTimeOnFinish) {
global::timeManager->setPause(false);
openspace::global::scriptEngine->queueScript(
"openspace.time.setPause(false)",
scripting::ScriptEngine::RemoteScripting::Yes
);
}
_startSimulationTimeOnFinish = false;
clearPath();