Closed Kyozon closed 1 month ago
Hi @Kyozon! The instanced scene looks correct to me, both in Blender and in https://gltf-viewer.donmccurdy.com/. Could you confirm if you're seeing the problem both in Blender and in my viewer, and perhaps share the 'broken' copy of the model as well?
Hi @donmccurdy. Thank you for the quick reply!
Sure, here is the broken file: Instanced.zip
My filed failed to open in your viewer, here is the error message:
Hm... something is weird in the source file:
"buffers": [
{
"uri": "glTF.bin",
"byteLength": 8160
},
{
"uri": "glTF.bin",
"byteLength": 8160
},
{
"uri": "glTF.bin",
"byteLength": 8160
}
],
Three buffers, all pointing at the same thing... I'm not sure whether it's technically valid in the glTF spec, but the pygltflib authors probably didn't intend that, and it's leading to data loss here.
I'll have to think a bit about the best way to handle it, but in the meantime, you can avoid the issue by writing to .glb
instead of .gltf
:
gltf-transform instance merged.gltf instanced.glb
Fixed in #1511. With these changes glTF Transform will log a warning (Duplicate resource URI, "glTF.bin"
) but will continue to process the file. When writing to .gltf
, the additional buffers will be written as separate files with unique names. In this case:
To consolidate the binary data and avoid extra files, either write to .glb or use the unpartition()
function.
Reverting #1511 in https://github.com/donmccurdy/glTF-Transform/commit/84e77f58d321702dba486fc07ed1ce7279d4897d and reopening the issue. Original approach to fixing the issue will cause other problems.
New attempted change in #1522. Unfortunately not a "fix", but will throw a clear error if conflicting buffer URIs are going to break the file. To workaround it will still be necessary to write to .glb or use the unpartition() function.
Describe the bug The resulting .gltf scene looks off when using the
gltf-transform instance
.To Reproduce Steps to reproduce the behavior:
Download: merged.zip
Import
merged.gltf
into Blender and verify original transforms as seen in the image below:Use
gltf-transform instance merged.gltf instanced.gltf
Import
instanced.gltf
into Blender and verify the bug as seen in the image below:Expected behavior Retain the original transforms but optimize the scene to use GPU instances.
Versions: