From e8750b4c785093527c9e8e7754fce34cc004d517 Mon Sep 17 00:00:00 2001 From: epernod Date: Mon, 11 May 2026 16:10:49 +0200 Subject: [PATCH] [src] Fix problem of wrong dt and gravity values applied when reconnecting scenes --- Core/Scripts/SofaContext.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Core/Scripts/SofaContext.cs b/Core/Scripts/SofaContext.cs index 498744ed..9ff0a961 100644 --- a/Core/Scripts/SofaContext.cs +++ b/Core/Scripts/SofaContext.cs @@ -662,7 +662,9 @@ protected void ReconnectSofaScene() m_impl.loadScene(m_sceneFileMgr.AbsoluteFilename()); } - // Do not retrieve timestep of gravity in case it has been changed in editor + // This is cause of error. TODO: find a way to not retrieve those values only if they have been changed intentionnaly in the editor + m_timeStep = m_impl.timeStep; + m_gravity = m_impl.getGravity(); // re-create objects after scene loading and before graph reconnection foreach (SofaBaseObject obj in m_objects)