Proposal: nodes + material lookup tables for GLTFLoader
See original GitHub issueDescription of the problem
Currently when we want to change things inside a GLTF, for instance making meshes drop shadows, material props, etc, we have to do messy deep traversals.
GLTF loader already returns scenes, cameras and assets, but looking though the source it still knows about nodes and materials internally. If this could be exposed it would be very efficient for us to make changes:
new GLTFLoader().load(url, gltf => {
gltf.materials["base"].roughness = 0.5
gltf.nodes["plane"].castShadow = true
})
i have made a tool for gltf-jsx exports that does something similar, and i’ve started implementing the above variant in a test, it looks like this now:
would it be possible to add these two collections officially to the gltf result?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:15 (9 by maintainers)
Top Results From Across the Web
GLTFLoader – three.js docs
A glTF asset may deliver one or more scenes, including meshes, materials, textures, skins, skeletons, morph targets, animations, lights, and/or cameras.
Read more >GLTFLoaderPlugin | xeokit-sdk
Viewer plugin that loads models from glTF. Loads all glTF formats, including embedded and binary formats. Loads physically-based materials and textures.
Read more >GLTF Model Loader - Three.js Tutorials - sbcode.net
A loader for loading glTF models into the Threejs scene. glTF is a specification for the efficient transmission and loading of 3D scenes...
Read more >npm - Snyk
... @babel/plugin-proposal-export-namespace-from ... angular-masonry · angular-material · angular-material-clock-time-picker · angular-material-data-table ...
Read more >node packages | Corvid by Wix
node -pay. 2.0.1. available. 12/05/2022. puppeteer-extra-plugin-stealth. 2.10.0. available ... country-code-lookup. 0.0.20. available ... @angular/material.
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
@donmccurdy @mrdoob now that threejs dedupes names and there are no unnamed objects, could we look at this proposal again? we’ve been working with this for a long while now, as an extension, and it has proven very useful. i would prefer if this were official. again, having look-up tables removes the need for traversal once and for all.
Agreed, thanks for the PR!