When I change the scene settings in the editor (disable physics 2D, change gravity, ...) and then save the file. If I open those settings again, the modified values are still there, but they are reset to default if I close the file and open it again. So those modifications are not saved to the file.
If I force change the binary scene file (e.g. hexedit) and load it in the editor, the modified values are correctly displayed, but saving the file (even with no modifications) puts scene settings back to default.
Version
This happens on 34.1 and on Fyrox nightly commit 77e0a89a.
Analysis
The problem seems to come from make_purified_scene (editor/src/scene/mod.rs) which calls Graph::clone (fyrox-impl/src/scene/graph/mod.rs),
but this method doesn't clone the PhysicsWorld (2D and 3D).
Sadly PhysicsWorld doesn't implement clone and I don't know your code enough nor how much purification was intended to directly create a PR for you.
There might also be other non-cloned properties that should be saved as well.
Good evening,
Problem
When I change the scene settings in the editor (disable physics 2D, change gravity, ...) and then save the file. If I open those settings again, the modified values are still there, but they are reset to default if I close the file and open it again. So those modifications are not saved to the file. If I force change the binary scene file (e.g. hexedit) and load it in the editor, the modified values are correctly displayed, but saving the file (even with no modifications) puts scene settings back to default.
Version
This happens on 34.1 and on Fyrox nightly commit 77e0a89a.
Analysis
The problem seems to come from
make_purified_scene
(editor/src/scene/mod.rs
) which callsGraph::clone
(fyrox-impl/src/scene/graph/mod.rs
), but this method doesn't clone the PhysicsWorld (2D and 3D). Sadly PhysicsWorld doesn't implement clone and I don't know your code enough nor how much purification was intended to directly create a PR for you.There might also be other non-cloned properties that should be saved as well.
Temporary workaround
Doing it programmatically in
on_scene_loaded
.