# Editor: I want to save the scene In File

**URL:** <https://discourse.threejs.org/t/editor-i-want-to-save-the-scene-in-file/15147>\
**Category:** Questions\
**Tags:** editor\
**Created:** [May 13, 2020, 8:18am UTC](https://discourse.threejs.org/t/editor-i-want-to-save-the-scene-in-file/15147 "2020-05-13T08:18:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![zhai](https://avatars.discourse-cdn.com/v4/letter/z/7ba0ec/32.png) [@zhai](https://discourse.threejs.org/u/zhai)\
**Post date:** [May 13, 2020, 8:18am UTC](https://discourse.threejs.org/t/editor-i-want-to-save-the-scene-in-file/15147/1 "2020-05-13T08:18:10Z")

</div>

A new problem is bothering us. It’s about the data transmission of three.js. We hope to achieve the fastest speed when three.js saves the file. So if the model file in the scene changes or changes locally, what’s the best way to store it? The problem we are currently facing is that when we use the three.js editor to save the FBX model data, if we use the GLB storage method, the file will become very large, 2 times more than the FBX source file. Is there any way to minimize the scene file? It is hoped that the saved file can be smaller than the file bytes of the original FBX model. We want to use this way to quickly store and preview.

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [May 13, 2020, 8:58am UTC](https://discourse.threejs.org/t/editor-i-want-to-save-the-scene-in-file/15147/2 "2020-05-13T08:58:09Z")

</div>

> [@zhai](#):
>
> So if the model file in the scene changes or changes locally, what’s the best way to store it?

Currently, the editor saves the entire scene by serializing it to the engine’s custom JSON format. This process is not optimal since it performs bad for larger scenes. Using different 3D formats like FBX or glTF is no solution to this problem.

A similar problem was already discussed here, however there is no solution so far:

> <https://github.com/mrdoob/three.js/issues/15853>
>
> \##### Description of the problem
> 
> I drag'n'drop a 3.2 mb FBX (created in 3ds m…ax 2016), plus some 30 jpg textures with 256-2048 resolution. \*\*Every single time\*\* when I make a change in the scene, the editor freezes for several(tens of) seconds. The heavier the scene, the longer the freeze. 
> 
> \##### Browser
> 
> \- \[\] All of them
> \- \[x\] Chrome
> \- \[x\] Firefox
> \- \[\] Internet Explorer
> 
> \##### OS
> 
> \- \[\] All of them
> \- \[x\] Windows
> \- \[\] macOS
> \- \[\] Linux
> \- \[\] Android
> \- \[\] iOS
> 
> \##### Hardware Requirements (graphics card, VR Device, ...)

From my point of view, the most promising solution are change records which represent the changes to a scene per user modification (similar to the already existing history). In this way, you only have to save a small amount of data and the approach scales very well even for large scenes. However, you also have to write a more complex scene loader since it has to apply the single records incrementally until the scene is assembled.

Notice that such a specialized format is only intended for the editor. When loading an object or scene into an app, you want to use other formats like `glTF` or `three.js`’s JSON format.

---

<div class="post-metadata">

**Author:** ![zhai](https://avatars.discourse-cdn.com/v4/letter/z/7ba0ec/32.png) [@zhai](https://discourse.threejs.org/u/zhai)\
**Post date:** [May 13, 2020, 9:12am UTC](https://discourse.threejs.org/t/editor-i-want-to-save-the-scene-in-file/15147/3 "2020-05-13T09:12:25Z")

</div>

Okay, thank you very much for your answers.

I looked at other websites like three.js editors, and they are the same things that are saved like records. I have some doubts about this and don’t know how to save them. Do you have a similar case? I want to see how they do it.

---

<div class="post-metadata">

**Author:** ![zhai](https://avatars.discourse-cdn.com/v4/letter/z/7ba0ec/32.png) [@zhai](https://discourse.threejs.org/u/zhai)\
**Post date:** [May 13, 2020, 9:52am UTC](https://discourse.threejs.org/t/editor-i-want-to-save-the-scene-in-file/15147/4 "2020-05-13T09:52:25Z")

</div>

May I ask if it is a 50MB FBX model file, can GLB compress it to a smaller extent?

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [May 13, 2020, 11:21am UTC](https://discourse.threejs.org/t/editor-i-want-to-save-the-scene-in-file/15147/5 "2020-05-13T11:21:37Z")

</div>

When converting FBX to glTF, you might want to use [glTF Pipeline](https://github.com/CesiumGS/gltf-pipeline) to further optimized your asset (e.g. add Draco compression).
