-- 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 "\t" lines for assimp to read. Files: case_.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