Is it possible to access original gltf properties of loaded nodes?

Hi.

I’m exploring all the glTF stuff and still don’t understand it in full.

For instance, if the asset is like:

  "nodes" : [
    {
      "name": "Foo",
      "mesh" : 0,
      "extensions": { "KHR_visibility": { visible: false }},
    },
    {
      "name": "Bar",
      "mesh" : 1,
      "extensions": { "KHR_selectability": { selectable: true }},
    }
  ]

What is a proper way to check which nodes had which extensions?
For instance, to put some visual markers there, or to add them to some UI menu, or something)

cc @bghgary

You can create a glTF loader extension and extend the loadNodeAsync function. The node property of loadNodeAsync is the original glTF object from the glTF JSON.

1 Like

Does the loader discard all original information?

Like, in a import/export cycle all data would get lost?

I’m not really sure what you mean by this. glTF/GLB files do not round trip perfectly as Babylon does not represent the glTF structure perfectly. Or maybe you mean the original glTF JSON? We keep only what’s read in the loader. Any additional fields not loaded by the loader will be dropped.