tests/model: comments: specs only
This commit is contained in:
1 parent
5f7f6005f6
commit
fe7566cbba
37 files changed
+72
-440
No files matched your search
@@ -1,7 +1,4 @@
|
||||
-- model/md5 tests: an .md5mesh and two .md5anim files written by tools/fixtures/md5.py: the bind pose against
|
||||
-- assimp's triangle soup (positions, texture coordinates) and the writer's exact weighted positions, the joints'
|
||||
-- model-space pose through the node tree, weights, animations through opts.files / opts.resolve (every frame's
|
||||
-- parent-relative pose), a standalone .md5anim, missing animations, errors, the fuzz pass.
|
||||
-- model/md5 tests: generated .md5mesh / .md5anim files against assimp's bind-pose soup and the writer's poses.
|
||||
local T = require("@tests/T")
|
||||
local F = require("@rosetta")
|
||||
local Md5 = require("@rosetta/model/md5")
|
||||
@@ -35,7 +32,6 @@ local s, err = Md5.decode(Bytes.reader(buffer.fromstring(M.data)), { anims = { "
|
||||
t:check(s, "md5mesh: " .. tostring(err))
|
||||
t:eq(F.detect(M.data), "md5", "F.detect")
|
||||
|
||||
-- 1. geometry
|
||||
do
|
||||
local prims = s.meshes[1].primitives
|
||||
t:eq(#prims, #M.positions, "a primitive per mesh")
|
||||
@@ -63,7 +59,6 @@ do
|
||||
t:eq(matched, #M.positions, "every mesh matches assimp's bind pose")
|
||||
end
|
||||
|
||||
-- 2. skeleton: the model-space joint poses through the node tree
|
||||
do
|
||||
local skin = s.skins[1]
|
||||
t:eq(#skin.joints, #M.joints, "joints")
|
||||
@@ -87,7 +82,6 @@ do
|
||||
t:check(s.meshes[1].primitives[1].attributes.JOINTS_0 ~= nil, "skinned")
|
||||
end
|
||||
|
||||
-- 3. animations
|
||||
local function checkAnim(scene: any, a: any, anim: any, label: string)
|
||||
t:eq(anim.name, a.name, label .. ": name")
|
||||
local byNode = {}
|
||||
@@ -132,7 +126,6 @@ do
|
||||
t:check(e and e.code == Err.UNSUPPORTED, "missing animation")
|
||||
local skip = Md5.decode(Bytes.reader(buffer.fromstring(M.data)), { anims = { "run.md5anim" }, skipMissing = true }) :: any
|
||||
t:check(skip and #skip.animations == 0, "skipMissing")
|
||||
-- a standalone .md5anim
|
||||
local a = Fx.anims[2]
|
||||
local alone = Md5.decode(Bytes.reader(buffer.fromstring(a.data)), { name = "models/walk.md5anim" }) :: any
|
||||
t:check(alone and #alone.skins == 1, "md5anim alone: skeleton")
|
||||
@@ -140,7 +133,6 @@ do
|
||||
t:eq(alone.meta.source.kind, "anim", "md5anim alone: kind")
|
||||
end
|
||||
|
||||
-- 4. errors, fuzz
|
||||
do
|
||||
local _, e1 = Md5.decode(Bytes.reader(buffer.fromstring("MD5Version 11\n")))
|
||||
t:check(e1 and e1.code == Err.UNSUPPORTED, "version 11")
|
||||
|
||||
Reference in new issue
Block a user