godot: glTF import won't update extracted texture

Godot version

4.1.2 stable

System information

Godot v4.1.2.stable - Windows 10.0.19045 - Vulkan (Forward+) - dedicated Quadro P620 () - 11th Gen Intel® Core™ i9-11900K @ 3.50GHz (16 Threads)

Issue description

The textures packed into glb exports won’t always update when the inherited glb is updated from blender. It might use an old texture, appear textureless, or sometimes just work and I simply cannot figure out what i am doing wrong.

Steps to reproduce

  • open project in godot and browse empty testcube folder
  • copy testcube-1.glb from zip root into godot_project\testcube as testcube.glb
  • switch back to godot and import glb as new inherited scene and save tscn in testcube folder. glb may appear with red “x”, but reimporting fixes it?
  • copy testcube-2.glb from zip root into godot_project\testcube as testcube.glb
  • switch back to godot, image texture should change with some errors in output log
  • copy testcube-1.glb from zip root into godot_project\testcube as testcube.glb
  • cube might appear with changed texture or appear white/textureless. it has been difficult to get this to predictably happen

white-cube-errors

errors in output log appear:

  Can't find file 'uid://w87lq3421wmi::::res://testcube/testcube_godette.png'.
  Attempt to disconnect a nonexistent connection from 'testcube:<Node3D#2317655010421>'. Signal: 'replacing_by', callable: 'EditorNode::set_edited_scene'.
  Can't find file 'uid://c5oarbyq0oygi::::res://testcube/testcube_godot.png'.
  Attempt to disconnect a nonexistent connection from 'testcube:<Node3D#2486517690152>'. Signal: 'replacing_by', callable: 'EditorNode::set_edited_scene'.

blend file notes: Blender 3.6.0, this is the default cube and default material with an image texture of a png file, the only difference between the two glb exports is which files is used. glbs are exported “limited to selected objects” with only the cube selected.

Minimal reproduction project

glb-import-issue.zip

About this issue

  • Original URL
  • State: closed
  • Created 9 months ago
  • Reactions: 4
  • Comments: 16 (5 by maintainers)

Most upvoted comments

@golddotasksquestions Thank you SO much for clarifying the reproduction steps. Using texture paint in blender and re-exporting made it more reliable to reproduce the issue.

I found three additional bugs in the import system, not including #85922 (in other words, when originally reported there were actually 4 different issues preventing the texture from updating.) and attempted to address all of them. modified textures in glb files now update reliably in the testing I did so far.

Once it compiles, feel free to give the artifact in #86504 a try, and happy holidays 🌲

I can also reproduce this in Godot 4.1.2 stable, 4.1.3 rc1 and Godot 4.2 Beta 5.

  1. Add a Material and image texture to the default cube in Blender. In the TexturePaint tab, draw something on the mesh.
  2. Export the selected cube as glb into your Godot res folder and instance the glb in a 3D scene.
  3. Go back to Blender in the Texture Paint tab and draw something else on the cube.
  4. Export the selected cube again as glb with the same name (override existing file) into your Godot res folder.
  5. Observe Godot reimporting the instanced glb, but not updating the texture anywhere.

You can also try to change the mesh by sculpting the topology for example, and the reimport will update the mesh in Godot, but not the texture.

This has been a problem ever since the early Alphas of Godot 4 and really needs to be fixed as it makes working with custom 3D art assets and and iterative work in 3D a huge pain.

Can also confirm in 4.2 beta 5

Completely agree with @golddotasksquestions regarding this being a particularly irksome problem with iterative 3d workflow for texture painting revisions.

@lyuma I still get this error in 4.3 Dev2. If I do some some small changes like move some UVs around or some of the verticies. Im not touching the image texture connected to my material at all in blender on a default cube. Hit “Save”, my .blend file gets re-imported. My model actually updates, but I get an error that it cant find the texture. Im using the texture located in my godot asset folder in blender. So should be the same: “Can’t find file ‘uid://coadexe5lmrim::::res://assets/textures/gradient.png’.”

Edit: Tried also manually exporting it as a .glb from blender (v.4.0.2). Move my UV for the model slightly. Re-import in to Godot. Same error.

Edit2: Here is a video-recording:

https://github.com/godotengine/godot/assets/122211848/400bb028-e83d-4cda-9a2f-00e8f3e0e227

In my case, this happens if I open the mesh directly as a New Inherited Scene. It looks exactly like the screenshot above.

I can confirm that this happens in 4.1.2 and 4.2. It is totally unpredictable, I had my project with all models working ok, made some changes in the scenes (no need to export from Blender, just reimported GLBs) and suddenly all textures were gone. In 4.2 never managed to have one of those models ever show anything but white material. When you open the GLB, all materials are marked as <Unnamed material> test_materials.zip