GLTFLoader: availability of original node info of parsed Object3D (feature request)
See original GitHub issueglTF handles nodes with their indices (nodeIndex
or nodeId
in GLTFParser
). So some extension data in glTF-based file formats (e.g. bone mapping in VRM) depend on node indices.
However, it seems that objects loaded by current GLTFLoader
don’t have any indices info. We can get complete node data from data.parser.json.nodes
, but cannot link them with parsed objects in data.scene
one to one.
I suggest adding original node info to Object3D.userData
or adding an array of nodes with Object3D
references to somewhere.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
GLTFLoader – three.js docs
A loader for glTF 2.0 resources. glTF (GL Transmission Format) is an open format specification for efficient delivery and loading of 3D content....
Read more >Three. js and TypeScript | Sean Bradley - Skillshare
Welcome to my course on Three. js and Typescript. Three. js is a cross-browser JavaScript library and Application Programming Interface used to create...
Read more >GLTFLoader - Babylon.js Documentation
Loads the alpha properties from a glTF material into a Babylon material. Must be called after the setting the albedo texture of the...
Read more >Three.js Loading a .GLTF File
OBJ file format is very old and fairly simple. It provides no scene graph so everything loaded is one large mesh. It was...
Read more >Load 3D Models in glTF Format - Discover three.js!
If these are new to you, or you need a refresher, head over to the Asynchronous JavaScript. The GLTFLoader Plugin#. To load glTF...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Now, #15418 seems to be helpfull for me! I love three.js and its contributors.
I should point out that glTF nodes do not necessarily map 1:1 with three.js nodes — in this example…
… we attempt to flatten things as much as possible. The first node will result in a single THREE.Mesh, where the second may become a Group containing one or more meshes, or a single mesh, depending on whether the primitives can be merged safely. So unfortunately, even with userData, the mapping you suggest is not trivial.
Do you mind saying a bit more about how you would want to use these indices? If you ensure your objects have unique names, using node names and
scene.getObjectByName(...)
may be more robust. Or accessingparser.getDependency( 'node', index )
directly, combined with https://github.com/mrdoob/three.js/pull/14492, may be an option.