sorry!That said is not what I mean, I mean your examples, in scenes I use and the results have a problem, I don’t know if this problem is normal, my scene model is composed of a roof and wall, that is to say, when I click on the wall, he should also put all of the above models are hidden, but I try to do, he did not give my top to hidden, that is to say, he always have a layer of grid not hide, I don’t know why is this
Issue 1 In a playground urls cannot have relative addresses to external files but must be absolute addresses on a cors compliant server using https lines 54, 81, 113
Issue 2 Are all objects on different floors? There are 8 JSONObjects to load id 10 to id 18. This line 135 MeshMap[JsonObject[i].id].parent=floor[i]; puts each object on a new floor
Currently all mesh are separate, not a whole, ground – top – wall – top – wall in sequence from bottom to top. As for this level, why there are eight jsonobjects loading ID to Id18,I personally think it is my circulation problem, but he did not report an error, so I don’t know how to correct it
There is more than one mesh in each file, hence you set a floor for each mesh in the file though you only need to do so for result.meshes[1]
Provided each file contains only two meshes then using meshes[1] is good. When there are different numbers of meshes in each file you need to make sure you know which one you want.
Thank you very much!I see you send my example, I had certain changes in their own projects, but I don’t know whether the father-son relationship problems, I put the two pictures below, the first one is I use BabylonJS inspector, modified, so it should be normal, click on metope, can hide, all the above grid, then the second picture is me in the scene test, the effect of top surface, not been hidden, he seems to be skipped this surface, and the inspector tree node as you can see, there are still a lot of the root node
They come from the file. I changed which index to use in result.mesh[index] because I knew which index my model was in the file. You need to check the index position of your model in your files and use the correct one.
The root meshes can come from the app that created the models and exported them.
OK, friend!According to what you said I change index, indeed he succeeded, but think about it, I have hundreds of models, to import to the scene, so I don’t have a will set up a correct ID, and, according to the sequence of loading, if my model ID is random, how to do it, for example I have stored inside a resource manager is all of my models, then I can come to drag them to the scene, so other people can’t be a drag in sequence, the ID is randomly changed, so in this case, this way will not be able to realize, after all, the need to make such a visual editor,The model ids will be generated randomly
The id is not important it is the number of meshes per file and the position of the model in the file. If all models were created and exported in the same way there should not be a problem.
https://www.babylonjs-playground.com/#1HH4OJ#32
I am now in the ID order he can hide model correctly, as you say change the position in the file of the model, but this is not good, because this function does not belong to private, everybody can use, if someone changed his order, so still can appear before I had problems, this way may not be very good, I think it’s best can use collision detection, click on the above model to detect whether there is a collision, if you have the choice of the hidden model, but you said before, no collisions occur under the static model, so I am very depressed, how should I improve the function
In theory, no one will put the model in a mess, but the index and location you just said to me should be correct, but this is a bad guarantee, and if I added two buildings to the scene of the scene, would he have hidden the other building
Coding is never easy. There are always setbacks. Using what you have now learned consider each step one and a time and test it with a range of data. You will get there.
I see what you mean, but some things really hard to do it, now I am a novice, I found a problem, just seems to be the scene inspector shows that there are a lot of RootNode, when I create the TransformNode, and give me the model of the parent, can appear empty RootNode, this seems to be related to the TransformNode itself, still have even if, why my model after binding TransNode, there will be a model so far removed, another thing, can see my screenshot, some ID display is a model of the model,But some ids show names with suffixes, I don’t understand, in the same building
As well as your big project you need to do little tests. Write a separate routine that loads just one model and experiment with TransformNode and parents and child.