Scene saving problem


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.

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’).

2 Likes

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

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

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

@ 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

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

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

Sorry, but
How should I solve it?

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:

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…

1 Like

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

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

  • This is my GIT, a little more convenient

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

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?

1 Like

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

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

John is a very important part of this community :grin:

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

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

ooks like what I’m doing right now