-
-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extra Nodes get Created per object in a glb #9
Comments
I mapped each node/mesh/primitive onto SCNNode, so WaterBottleEmptyNode is mapped onto mesh. How do you think? |
What do you mean exactly? From what I understand the primitives are part of the mesh object. which point to indices and materials. but mesh[0] defines a mesh with geometry and materials. so I see it more confusing to interpret that as
than
SCNNode is capable of having the format be this way and it would be less confusing to work with the nodes this way here's a screenshot of the babylon js inspector ( __root would be what we are calling WaterBottle) and then the only child node is WaterBottle. edit: and the child nodes of these meshes could just be children of the base mesh
|
This should be in the readme as technical documentation. |
Bump on this issue because I ran into problems with the node hierarchy. The issue with the extra nodes is the duplication of names and it forces the developer to write a nasty work-around. The issue really becomes apparent when you use the This is a headache for anyone trying to do anything as simple as change a material. I have opened a PR (#37) that addresses this issue. @magicien I know you have some reservations about changing this structure so I'd like to find a resolution that works for all because as the current version stands this is a major hinderance to simple traversals for named nodes. |
Given its been almost a year since this issue has been opened without much response from @magicien ... whomever else is running into this issue, please check out my fork. I fixed the node structure issue. In the fork below, the scene graph in SceneKit is a 1:1 match of the structure of the GLB and doesn't distort the scene hierarchy with arbitrary nodes in the way this library does. |
When models are getting imported their hierarchy is getting created like above.

where the water bottle only defines one submesh called water bottle
So instead of loading the gltf like we do know.
we should do this
because to access the materials of these nodes, we right now have to do something like
node.childNodes[0].childNodes[0].geometry?.firstMaterial
The text was updated successfully, but these errors were encountered: