godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.05k stars 21.18k forks source link

glTF files aren't always automatically reimported #90659

Closed passivestar closed 4 months ago

passivestar commented 7 months ago

Tested versions

4.2.1 v4.3.beta.custom_build [8bf8f41fc]

System information

Godot v4.2.1.stable - macOS 14.4.0 - Vulkan (Forward+) - integrated Apple M1 Max - Apple M1 Max (10 Threads)

Issue description

Godot automatically reimports gltf if objects are added or removed, if the geometry changes in terms of number of vertices, or if the overall dimensions change. However when vertices are moved inside of the bounding box of the original model, gltf is not automatically reimported and has to be reimported manually by clicking the "Reimport" button. This quirk can be annoying when working on level blockouts in blender because sometimes you move faces without adding any new geometry

Steps to reproduce

Move some vertices in a model inside of its bounding box (you can scale the middle cube in the MRP in edit mode in blender), export gltf and see that nothing happens in godot

Minimal reproduction project (MRP)

MRPGLTF.zip

viksl commented 7 months ago

I'm in 4.3 [578d937927ea9735aa7a8e0535f57801406b0b82] and can confirm this on Windows 11, though sometimes it does update for me but most of the time it doesn't.


As a side note, I haven't been able to reproduce but godot also sometimes doesn't reimport blender (*.blend) files too, I've seen it several times on twitch stream - jotson - he is on Linux while I'm on Win 11 but it does very clearly not properly update at some points but so far haven't been able to pin point it.

passivestar commented 6 months ago

Also doesn't reimport if the animation changes

lyuma commented 4 months ago

Can you clarify how you exported the gltf? Are you using gltf separate, gltf embedded or glb binary?

is the issue that only the .bin (binary vertex data and annimation data) changes , but godot is only looking at the .gltf (overall document structure, not data)

passivestar commented 4 months ago

@lyuma yes I'm exporting gltf separate because it keeps the textures separate. If they are embedded it takes too long to import in godot

It looks like what you're saying is correct, looking at gltf diff I can see that it gets reimported if the dimensions change here:

image

Or if the size of bin changes here:

image

But if the bin changes but the size of it doesn't it doesn't get reimported

Note that even though this seems to be the problem for this particular issue, like I mentioned in https://github.com/godotengine/godot/issues/90241#issuecomment-2154155349 at some point even changing gltf stops working and only deleting the node from the scene and adding it back again works (not even clicking reimport works in that case)