model/ase: 3ds Max ASCII Scene Export read + write (geometry, Multi/Sub-Object materials, texture channels, colours, normals, NODE_TM hierarchy, helpers, cameras, lights; checked against assimp)

This commit is contained in:
4DBug committed 2026-11-01 18:34:55 -06:00
1 parent 01c044805f
commit 0b6773db8b
12 files changed
+1814 -1

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
-- tools/fixtures/_ase_encode: run by tools/fixtures/ase.py (luau CLI, repo root): decodes every ASE case and writes it
-- back with our ASE writer, printing "<file>\t<hex>" lines for assimp to read. Files: case_<i>.ase.
local Ase = require("@rosetta/model/ase")
local Bytes = require("@rosetta/core/Bytes")
local Cases = require("@tests/gen/ase_cases")
local HEX = {}
for i = 0, 255 do
HEX[i] = string.format("%02x", i)
end
local function hex(b: buffer): string
local out = table.create(buffer.len(b))
for i = 0, buffer.len(b) - 1 do
out[i + 1] = HEX[buffer.readu8(b, i)]
end
return table.concat(out)
end
for i, c in Cases do
local scene = Ase.decode(Bytes.reader(buffer.fromstring(c.data)))
if scene then
local out, err = Ase.encode(scene)
if out then
print(string.format("case_%d.ase", i) .. "\t" .. hex(out))
else
print("encode failed " .. c.name .. ": " .. tostring(err))
end
end
end