model/blend: compressed .blend sniffing (gzip peek, zstd up to 4 MB) so F.model.load finds them

This commit is contained in:
4DBug committed 2026-11-01 19:26:34 -06:00
1 parent 3c8d5e99d7
commit 08f3b1c5bd
3 files changed
+36 -3

No files matched your search

+16
View File
@@ -620,6 +620,22 @@ if cur then
t:check(s and s.kind == "scene", "F.load")
end
-- compressed files: by content for model loads, by extension otherwise
for _, c in Sets.cur do
if string.find(c.name, "_z%.blend$") then
local b = buffer.fromstring(c.data)
local s = F.model.load(b)
t:check(s and s.meta.source.compression == "zstd", "F.model.load of a zstd .blend")
t:eq(F.detect(b, { name = "x.blend" }), "blend", "F.detect of a zstd .blend by name")
end
end
for _, c in Sets["293"] do
if string.find(c.name, "_z%.blend$") then
local s = F.model.load(buffer.fromstring(c.data))
t:check(s and s.meta.source.compression == "gzip", "F.model.load of a gzip .blend")
end
end
-- errors
local function code(data: string): string?
local s, e = decode(data)