GLTFLoader: Add accessibility to original JSON index from THREE objects


Today I needed to determine what material in original glTF structure the converted material is.
The reason why I have to do that is, to convert materials generated from GLTFLoader to another one based on external index-property table.
But, I couldn’t get how I can access to original index of the material.

Then, I added a feature to my fork of GLTFLoader that enables me to access original index of GLTF structure.
Here’s a quick example of what I did:


And here’s a diff I did to GLTFLoader.js : FMS-Cat@acec47f

I have 100%% confidence there are so many better way to perform this but I’m rushing so here’s an issue instead of PR:
I want to access to the index of each stuff (nodes, materials, meshes…) in original glTF structure from converted THREE entities.

Author: Fantashit

2 thoughts on “GLTFLoader: Add accessibility to original JSON index from THREE objects

  1. I’m not gonna talk about our internal issues but talking of license we definitely should release that in MIT since both UniVRM and Three.js follows the way 🤗.

    We are currently thinking about how we should let the entire workflow interface, since we might rather prepare a VRM class with a handful of methods than just an “interface”.

Comments are closed.