Seperate texture from glb using gltf-tranform package

Does anyone have an idea how can I seperate the textures from glb model using gltf-tranform package? I wanna remove the textures from glb model and set the texture images url pointing to hosted images so it can reduce model size. Gltf-pipeline does same sorta thing where it seperated the texture from model when you run the command with “-t” flag.

Adding @bghgary for this one.

Seems the simplest way is to save GLB as GLTF.

Yeah, but I want to embed the texture which are hosted on CDN. I wanna just embed the texture url. But unfortunately that is not working. Even if I seperate the texture it needs those texture to be in same folder as gltf file. I was hoping to create a texture while loading it from cdn in gltf loader

You can use GLTF extras to create pointers to your textures.

You should be able to use an absolute path ??? cc @bghgary

If gltf-transform does not support it, you should be able to check with them to introduce it ?

The glTF loader explicitly disallows absolute paths for security reasons. We can probably add an option to make it work. IIRC, this isn’t the first time someone asked about this.

1 Like

Yeah, that would be super nice and useful. I going to try patch babylon’s gltf loader, since I was able to replace the url with absolute path and remove the resources as I was intending to do but babylon was’t loading model.