How can I get a texture from a .glb (GLTF) when that texture is not referenced by any mesh or material?

I had a quick look a the glTFLoader source code and it seems it loads only textures which are bind to a material.

However you could create a dummy material and try:

    BABYLON.SceneLoader.OnPluginActivatedObservable.add((plugin) => {
        plugin.loadAllMaterials = true;
    });

this should load the material even if it’s not assigned to the mesh.

I believe loadAllTextures property would be handy as well.

1 Like