I serialize a simple scene into babylon file:https://playground.babylonjs.com/#1AGCWP#37
However, when I reload it in sandbox, animation and material disappear:
That it because you serialize the scene before the materials are ready.
There are many ways of doing that, depending on your usecase. Here is the one approach that is not recommended - using setTimeout
What a quick reply!!
Babylon is the BEST community, EVER. Too much love.
After using setTimeout , I still get the same result in sandbox: https://playground.babylonjs.com/#1AGCWP#39
Sorry, missed the fact that you are trying to load it in the sandbox.
You will need to provide the images as well when dragging the file to the sandbox. Drag and drop both the .babylon file and all of the image assets into the sandbox and it will work.
Thx Raanan! It works if I drop image into sandbox.
But I am wondering if we can encode everything into babylon file?
Oh, you can force serializing the textures (lines 14 and 15)
Scene Serialization Timeout | Babylon.js Playground (babylonjs.com)