# Scene saving problem

**URL:** <https://forum.babylonjs.com/t/scene-saving-problem/4670>\
**Category:** Questions\
**Created:** [July 23, 2019, 8:07am UTC](https://forum.babylonjs.com/t/scene-saving-problem/4670 "2019-07-23T08:07:18Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![ranwei-001](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ranwei-001/32/1656_2.png) [@ranwei-001](https://forum.babylonjs.com/u/ranwei-001)\
**Post date:** [July 23, 2019, 8:07am UTC](https://forum.babylonjs.com/t/scene-saving-problem/4670/1 "2019-07-23T08:07:18Z")

</div>

![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/c/ce78b4e70fe08cb17281cb29c5e3005c9311d746.png)  
I want to know the difference between GltfExport and scene serializer. They seem to be able to export the scene. I have tested it. It seems that download is to export the entire scene, and gltf2export just exports the graphics in the scene.

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [July 23, 2019, 8:52am UTC](https://forum.babylonjs.com/t/scene-saving-problem/4670/2 "2019-07-23T08:52:25Z")

</div>

Simply explained - GLTF is a 3D Object format, that exports meshes (and their metadata).  
Scene serializer exports the Babylon scene in the babylon format (so you can open it with the scene loader) with everything babylon supports (lights, camera and camera type, physics, collisions etc’).

---

<div class="post-metadata">

**Author:** ![ranwei-001](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ranwei-001/32/1656_2.png) [@ranwei-001](https://forum.babylonjs.com/u/ranwei-001)\
**Post date:** [July 23, 2019, 8:53am UTC](https://forum.babylonjs.com/t/scene-saving-problem/4670/3 "2019-07-23T08:53:36Z")

</div>

I don’t know if my scene is too big. I use the scene sequencer to download the scene. The gltf format can’t open the file. There is 54M

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [July 23, 2019, 8:55am UTC](https://forum.babylonjs.com/t/scene-saving-problem/4670/4 "2019-07-23T08:55:23Z")

</div>

Playground will be very helpful here as well. There is no good single answer, we need to see what’s up

---

<div class="post-metadata">

**Author:** ![ranwei-001](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ranwei-001/32/1656_2.png) [@ranwei-001](https://forum.babylonjs.com/u/ranwei-001)\
**Post date:** [July 23, 2019, 8:57am UTC](https://forum.babylonjs.com/t/scene-saving-problem/4670/5 "2019-07-23T08:57:09Z")

</div>

what I mean is that the scene I saved in the project is in GLTF format, and then I can’t open it with vcode, whose memory is 54M. I guess it’s because the scene is too big to read vcode

---

<div class="post-metadata">

**Author:** ![ranwei-001](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ranwei-001/32/1656_2.png) [@ranwei-001](https://forum.babylonjs.com/u/ranwei-001)\
**Post date:** [July 23, 2019, 8:58am UTC](https://forum.babylonjs.com/t/scene-saving-problem/4670/6 "2019-07-23T08:58:48Z")

</div>

@ [Deltakosh](https://forum.babylonjs.com/u/Deltakosh)  
Sorry！I need you help!  
There are two sets of models in my PG. When I select a set of models, they will be hidden together with the second set of models. This is not what I want. My purpose is to select which set of models to hide only the top of the selected model. model  
[https://playground.babylonjs.com/#U8MEB0#59](https://playground.babylonjs.com/#U8MEB0#59)

---

<div class="post-metadata">

**Author:** ![ranwei-001](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ranwei-001/32/1656_2.png) [@ranwei-001](https://forum.babylonjs.com/u/ranwei-001)\
**Post date:** [July 23, 2019, 8:59am UTC](https://forum.babylonjs.com/t/scene-saving-problem/4670/7 "2019-07-23T08:59:49Z")

</div>

I just want to hide the top model when I click on the model, and the other set of models (rabbits) I don’t want to hide it

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [July 23, 2019, 9:01am UTC](https://forum.babylonjs.com/t/scene-saving-problem/4670/8 "2019-07-23T09:01:54Z")

</div>

Seems like a data structure problem. When clicked on row, hide row -1

---

<div class="post-metadata">

**Author:** ![ranwei-001](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ranwei-001/32/1656_2.png) [@ranwei-001](https://forum.babylonjs.com/u/ranwei-001)\
**Post date:** [July 23, 2019, 9:02am UTC](https://forum.babylonjs.com/t/scene-saving-problem/4670/9 "2019-07-23T09:02:52Z")

</div>

Sorry, but  
How should I solve it?

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [July 23, 2019, 9:14am UTC](https://forum.babylonjs.com/t/scene-saving-problem/4670/10 "2019-07-23T09:14:48Z")

</div>

First, I would not use the parenting system (personally) but would set the positions according to the height of the object.  
Second - I would store the meshes in column and rows arrays (which is used to simplify the data structure. You can, technically, always calculate the position of the current object in the grid).  
Then - when clicked on an object, check its index in the rows array and check if there is an object in rows[index-1]. Something like this:

```javascript
let meshes = [
  [mesh1, mesh2, mesh3],
  [mesh4, mesh5, mesh6]
];

// function that triggers when mesh is selected
meshSelected(mesh) {
  meshes.forEach(row => {
    const index = row.indexOf(mesh);
    if(index !== -1) {
      let rowIndex = index;
      while(rowIndex >=0) {
        row.shift().destroy();
        rowIndex--;
      }
    }
  }
}

```

you can also store column and row as metadata in the mesh object (JavaScript FTW). There are many ways to solve this.  
The playground is, honestly, a bit unstructured, so it is a bit hard for me to show you on your playground. Sorry…

---

<div class="post-metadata">

**Author:** ![ranwei-001](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ranwei-001/32/1656_2.png) [@ranwei-001](https://forum.babylonjs.com/u/ranwei-001)\
**Post date:** [July 23, 2019, 10:11am UTC](https://forum.babylonjs.com/t/scene-saving-problem/4670/11 "2019-07-23T10:11:03Z")

</div>

Then I will send you the scene, can you help me? This function I solved for a long time, tried the bounding box and the ray, but I can’t always do this effect, but now I use the floor array to give each model a Parent node, but it contains all the grids, so there are other problems with hiding

---

<div class="post-metadata">

**Author:** ![ranwei-001](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ranwei-001/32/1656_2.png) [@ranwei-001](https://forum.babylonjs.com/u/ranwei-001)\
**Post date:** [July 23, 2019, 10:42am UTC](https://forum.babylonjs.com/t/scene-saving-problem/4670/12 "2019-07-23T10:42:47Z")

</div>

[http://120.78.84.216/](http://120.78.84.216/)  
This is my example on the server, could you please help me look at it, I don’t know how to start

---

<div class="post-metadata">

**Author:** ![ranwei-001](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ranwei-001/32/1656_2.png) [@ranwei-001](https://forum.babylonjs.com/u/ranwei-001)\
**Post date:** [July 23, 2019, 11:00am UTC](https://forum.babylonjs.com/t/scene-saving-problem/4670/13 "2019-07-23T11:00:47Z")

</div>

> **[ranwei-001/BabylonJS](https://github.com/ranwei-001/BabylonJS)**
>
> test. Contribute to ranwei-001/BabylonJS development by creating an account on GitHub.

- This is my GIT, a little more convenient

---

<div class="post-metadata">

**Author:** ![ranwei-001](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ranwei-001/32/1656_2.png) [@ranwei-001](https://forum.babylonjs.com/u/ranwei-001)\
**Post date:** [July 24, 2019, 1:24am UTC](https://forum.babylonjs.com/t/scene-saving-problem/4670/14 "2019-07-24T01:24:31Z")

</div>

Ok, if it is not convenient for you, could you please explain the process to me again? I still don’t understand many things

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [July 24, 2019, 6:47am UTC](https://forum.babylonjs.com/t/scene-saving-problem/4670/15 "2019-07-24T06:47:19Z")

</div>

Hi,

This is not about convenience. I am always happy to help and happy to explain, but most should come from you. The explanation I and others provided should be enough for you to sit down, experiment, and eventually get the right answer.  
This forum has one of the nicest community I know. Those guys will answer any question you ask patiently and thoroughly, even if the question is not really related to Babylon. But without the other person’s input (hence - you) we can’t really help.

What didn’t you understand, what did you do so far, how did you correct your code, and why didn’t it work?

---

<div class="post-metadata">

**Author:** ![ranwei-001](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ranwei-001/32/1656_2.png) [@ranwei-001](https://forum.babylonjs.com/u/ranwei-001)\
**Post date:** [July 24, 2019, 7:29am UTC](https://forum.babylonjs.com/t/scene-saving-problem/4670/16 "2019-07-24T07:29:19Z")

</div>

So far, I still use floor as the parent node in my scene, but what you said to me yesterday is not to use the parent node, I don’t know how to start, or how can I use it in the project

---

<div class="post-metadata">

**Author:** ![ranwei-001](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ranwei-001/32/1656_2.png) [@ranwei-001](https://forum.babylonjs.com/u/ranwei-001)\
**Post date:** [July 24, 2019, 7:35am UTC](https://forum.babylonjs.com/t/scene-saving-problem/4670/17 "2019-07-24T07:35:52Z")

</div>

and I have been asking questions for several days, and now you are@johnk answering me

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [July 24, 2019, 10:48am UTC](https://forum.babylonjs.com/t/scene-saving-problem/4670/18 "2019-07-24T10:48:28Z")

</div>

John is a very important part of this community 😁

The offending system is very helpful if you want to do something with a group of meshes together as one at the same time. Other than that, simply create your floor and create your meshes, calculating their positions and positioning them correctly. And demo in the playground uses the same mechanism - create a floor, create meshes, do something with them all

---

<div class="post-metadata">

**Author:** ![ranwei-001](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ranwei-001/32/1656_2.png) [@ranwei-001](https://forum.babylonjs.com/u/ranwei-001)\
**Post date:** [July 24, 2019, 10:50am UTC](https://forum.babylonjs.com/t/scene-saving-problem/4670/19 "2019-07-24T10:50:00Z")

</div>

Sorry!Isn’t that what I’m doing now？

---

<div class="post-metadata">

**Author:** ![ranwei-001](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ranwei-001/32/1656_2.png) [@ranwei-001](https://forum.babylonjs.com/u/ranwei-001)\
**Post date:** [July 24, 2019, 10:51am UTC](https://forum.babylonjs.com/t/scene-saving-problem/4670/20 "2019-07-24T10:51:02Z")

</div>

ooks like what I’m doing right now

[Next page](https://forum.babylonjs.com/t/scene-saving-problem/4670.md?page=2)
