Doubled up embedded textures in GLTF Separate files in Needle with UnityGLTF

I wonder if this happened due to using an embedded GLTF file then overwriting it in Blender Export with a GLTF+Separate file, somehow keeps the embedded textures and data all there?

by user 103054507105067008

I’ll have to delete the original file and save back over it to test

by user 103054507105067008

Sounds like an export bug/setting from Blender - definitely strange / confusing that you have textures twice in your project

Explains why the build size swelled suddenly when I got a new file to overwrite it with

by user 103054507105067008

On export you wont get textures twice tho (even if they’re embedded in your original gltf) - it will only exclude them if they’re used in any of your materials or referenced from a component or asset that gets exported

What I can see is that the original file was embedded and has them all, then the export recently over the top overwriting the file it exported textures to /textures folder then there are suddenly two instances of all textures somehow referenced in the file

by user 103054507105067008

maybe you have some materials using the external textures and some materials using the embedded ones? I didnt check in depth as there are too many of them and too many objects :wink:

Just glad it highlighted a bug that some textures weren’t being compressed as otherwise I wouldn’t have noticed for a while!

by user 103054507105067008

If you can reproduce this state / what workflow lead to it that would be appreciated!

@marcel :cactus: In that repro project if you change the importer to GLTFast you see the embedded textures are not there anymore. Changing back to UnityGLTF always makes the textures embedded again. They really aren’t embedded in the file either as you can see the sizes here



image.png

by user 103054507105067008

Build sizes return to normal when using the GLTFast import

by user 103054507105067008

Ok that would be something specific to UnityGLTF then

or Gltfast

I can make an issue on the repo for Felix

by user 103054507105067008

Not sure how UnityGLTF links the external textures as embedded textures itself on an import of a GLTF+Separate file but it causes 2x every texture to export with the model in Needle at least

by user 103054507105067008

Does it reproduce with another model (gltf + 1 texture) ?

I’ll try a stripped down one now

by user 103054507105067008

It doesn’t happen when I try from a fresh file

by user 103054507105067008

I’ll strip down the original file to see if I can make a smaller repro, I assume the embedded texture locations are in the meta file

by user 103054507105067008

I have a repro here for UnityGLTF, this file is a GLTF+separate export but in Unity using UnityGLTF the textures pull in as embedded and double up in Needle exports

by user 103054507105067008