Can't packing textures of exported model (glb)

Hi all,

I have a problem with packing texure using TexturePacker, i got an error like this
image

Does the packing textures function not work on the exported model?

Here my playground:
Texture | Babylon.js Playground (babylonjs-playground.com)

Thank you

As you are loading a glb file, the materials are PBR materials, so you need to pass the right texture names through the options.map parameter (also, you should remove the first mesh from the list of meshes as it is not a true mesh):

However, it still does not work because it seems the packer does not handle the case when the url of the texture is not a true url as it is for glb textures, as they are embedded in the file and are not separate files. cc @Pryme8 in case he has more inputs about this.

As a workaround, using a .gltf instead of a .glb file should work.

2 Likes

Oh lord, its been so long since I looked at this… uuuuum, I never considered glb this would honestly take me going back and looking at the code base to see how we could support that. Might be something that needs to be done if gltf is not an option.

1 Like

Hi @Evgeni_Popov @Pryme8

Thanks for the answers.

Maybe I should change my approach to optimizing textures, because for now I’m just using glb files.