question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Proposal: nodes + material lookup tables for GLTFLoader

See original GitHub issue
Description 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:

Screenshot 2020-02-01 at 18 35 42

would it be possible to add these two collections officially to the gltf result?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:15 (9 by maintainers)

github_iconTop GitHub Comments

3reactions
drcmdacommented, Nov 1, 2020

@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.

1reaction
donmccurdycommented, Feb 10, 2020

Agreed, thanks for the PR!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found