ws-roblox: model/robloxmesh (.mesh 1.00-5.00, 6.00/7.00 chunked with raw COREMESH read; Draco COREMESH UNSUPPORTED; 2.00 / 4.00 write with skinning subsets and LODs) mapped to Scene; rbxm / rbxmx variant() for F.detect (rbxl / rbxlx); api tests
This commit is contained in:
1 parent
bd696dea1e
commit
3a1965486f
11 files changed
+1886
No files matched your search
@@ -0,0 +1,30 @@
|
||||
-- tools/fixtures/_robloxmesh_encode.luau: run by tools/fixtures/robloxmesh.py under the luau CLI: decodes every case of
|
||||
-- tests/gen/robloxmesh and writes it back as versions 2.00 and 4.00; prints "<case>/<version> <hex>" lines for the
|
||||
-- fixture's own reader.
|
||||
local RobloxMesh = require("@formats/model/robloxmesh")
|
||||
local Bytes = require("@formats/core/Bytes")
|
||||
local Fx = require("@tests/gen/robloxmesh")
|
||||
|
||||
local function hex(b: buffer): string
|
||||
local t = table.create(buffer.len(b))
|
||||
for i = 0, buffer.len(b) - 1 do
|
||||
t[i + 1] = string.format("%02x", buffer.readu8(b, i))
|
||||
end
|
||||
return table.concat(t)
|
||||
end
|
||||
|
||||
for _, c in Fx.cases do
|
||||
if not c.unsupported then
|
||||
local scene, err = RobloxMesh.decode(Bytes.reader(buffer.fromstring(c.data)))
|
||||
if not scene then
|
||||
error(c.name .. ": " .. tostring(err))
|
||||
end
|
||||
for _, v in { "2.00", "4.00" } do
|
||||
local out, e = RobloxMesh.encode(scene, { version = v } :: any)
|
||||
if not out then
|
||||
error(c.name .. "/" .. v .. ": " .. tostring(e))
|
||||
end
|
||||
print(c.name .. "/" .. v .. " " .. hex(out))
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user