diff --git a/Client/origin-client/autoloads/ModelCache.gd b/Client/origin-client/autoloads/ModelCache.gd index 38f209f..2d4df97 100644 --- a/Client/origin-client/autoloads/ModelCache.gd +++ b/Client/origin-client/autoloads/ModelCache.gd @@ -134,11 +134,19 @@ func _download(url: String, disk: String) -> void: # Parse GLB/GLTF bytes using GLTFDocument.append_from_buffer. # Returns a PackedScene ready for instantiation, or null on failure. func _parse_gltf(data: PackedByteArray) -> PackedScene: - # Validate GLB magic bytes ("glTF"). + # Validate GLB magic bytes ("glTF" = 0x46546C67 little-endian). if data.size() >= 4: var magic := data.decode_u32(0) - if magic != 0x46546C67: # little-endian "glTF" - push_warning("ModelCache: not a GLB file (bad magic 0x%X)" % magic) + if magic != 0x46546C67: + # Try to give a human-readable diagnosis. + var preview := "" + for i in mini(20, data.size()): + var b := data[i] + preview += char(b) if b >= 0x20 and b < 0x7F else "." + push_warning( + "ModelCache: not a GLB file — expected 'glTF' magic, got 0x%X ('%s'). " \ + + "Only binary .glb format is supported at runtime. " \ + + "Re-export from Blender as glTF 2.0 Binary (.glb)." % [magic, preview]) return null var doc := GLTFDocument.new()