I am trying to export my entire scene and save it too firebase. Then reimport it. It is an essential function for the application I am developing.
I am looking through the exporters and imports and I have yet to be able to get a round trip to work. I have been able to successfully export the scene with SceneSerilizer, but when I try to reimport that scene with SceneLoader it throws an error.
I am also willing to use gltf export/import.
I am using typescript.
Is there a guide out there already for this situation?
(I have been unsuccessful in finding one that helps me to understand what I need to do or what I have done wrong).
Unable to find a plugin to load .5,“overlaycolor”:[1,0,0],“applyfog”:true}],“particlesystems”:[]} files. Trying to use .babylon default plugin. To load from a specific filetype (eg. gltf) see
@ncarr I don’t think that there is anything wrong with the SceneLoader, I traced through the sceneloader as it serialized your JSON scene successfully. I believe that the problem is what you’re doing with the scene after its serialized.
In this, we create that serialized json string, but append it to the current scene. we can see that our object and material serialize and are populated in the active scene as expected.
The problem with the previous playgrounds are that we serialized the scene, but the engine was already told to use our empty scene with camera we created. we have 2 scenes in memory in the callback function for BABYLON.SceneLoader.Load(), but we’re only using the first one we made and returned via createScene.
The loaded actual scene sits in memory, but we don’t use it. @sebavan, do we have any samples for how to “change” the current active scene? It seems that appending is the “preferred” way to handle scene management, but I’m not sure if we have too many examples for how to properly mange multiple scenes at a time.
This will merge the scene I am trying to load from firebase into the current scene.
Logically if the current scene is nearly blank (just a camera). Then it will show the scene I am loading.
The loaded actual scene sits in memory, but we don’t use it. @sebavan, do we have any samples for how to “change” the current active scene? It seems that appending is the “preferred” way to handle scene management, but I’m not sure if we have too many examples for how to properly mange multiple scenes at a time.
Part of my confusion here is because I have worked with THREEjs in the past and I was disposing of the default scene and loading the one from DB.
In the playground (as it only deals with one scene from the createScene function), it is preferable to append, and in your own app, as you control the render loop, it is entirely up to you