model/blend: bone / path split ends at the first unescaped '"]' (constraint paths kept whole in path)

This commit is contained in:
4DBug committed 2026-11-03 00:57:28 -06:00
1 parent 888ff212c3
commit d64adc978f
10 files changed
+475 -391

No files matched your search

+12
View File
@@ -10,6 +10,7 @@ local Bytes = require("@rosetta/core/Bytes")
local Err = require("@rosetta/core/Err")
local Types = require("@rosetta/Types")
local Mat4 = require("@rosetta/codecs/model/Mat4")
local Anim = require("@rosetta/model/blend/Anim")
local Sampler = require("@rosetta/codecs/model/Sampler")
local Versions = require("@tests/gen/blend_versions")
local Files = require("@tests/gen/blend_files")
@@ -989,6 +990,17 @@ t:eq(code("BLENDER-v279REND"), Err.TRUNCATED, "a truncated block header")
t:eq(code("BLENDERxv279" .. string.rep("\0", 24)), Err.CORRUPT, "bad pointer size")
t:eq(code("BLENDER-v279ENDB" .. string.rep("\0", 20)), Err.CORRUPT, "no DNA1 block")
for _, c in {
{ 'pose.bones["FK-RibCage"].constraints["ik_spine"].influence', "pose.bones", "FK-RibCage", 'constraints["ik_spine"].influence' },
{ 'pose.bones["Arm.L"].location', "pose.bones", "Arm.L", "location" },
{ 'key_blocks["Smile"].value', "key_blocks", "Smile", "value" },
{ 'pose.bones["a\\"b"].scale', "pose.bones", 'a"b', "scale" },
{ "location", nil, nil, "location" },
} do
local kind, who, rest = Anim.split(c[1])
t:check(kind == c[2] and who == c[3] and rest == c[4], "split " .. c[1] .. ": " .. tostring(kind) .. " " .. tostring(who) .. " " .. rest)
end
t:fuzz("decode", function(b: buffer)
return B.decode(Bytes.reader(b))
end, samples, { mutations = 24 })