Saving the scene and position values of objects

Hi everybody,
I created a scene where I can move the objects. What I want is to save all the modifications made on the scene and download latest transformation values with mesh names in csv format. What I found is to save the scene and download as .babylon file. Playground example:

https://playground.babylonjs.com/#279FW9#53

As .babylon is JSON, I can get the values from that file but is there any way I can download directly from the scene?

What do you mean by “download directly from the scene” ?

If you meant generating a json, the answer is yes :wink:

var serializedJson = JSON.stringify(BABYLON.sceneserializer.Serialize(scene));
1 Like

Thank you for the answer. I mean instead of generating JSON, I will be able to generate and download .txt file with meshname and transformation values of the corresponding mesh. Is it possible?

Anything you can do with javascript is possible, so yes :slight_smile:

1 Like

yes everything is possible

When I generate json from the scene, I pass it to the database. Next time I want to use this json data to generate the scene, what should I do? How can I turn this json data into a scene

You could use the scene loader to load it ?

  • Is there any code like that? I want to look at it

https://doc.babylonjs.com/how_to/load_from_any_file_type

1 Like