tree: check joint parent order

This commit is contained in:
Zack Buhman 2026-01-04 23:28:15 -06:00
parent 32cc14106d
commit 4547fa6e9f

View File

@ -7,10 +7,16 @@ def build_tree(gltf):
if "children" not in node: if "children" not in node:
continue continue
for child_ix in node["children"]: for child_ix in node["children"]:
assert child_ix > node_ix, (child_ix, node_ix)
assert child_ix not in parents assert child_ix not in parents
parents[child_ix] = node_ix parents[child_ix] = node_ix
for skin in gltf.json["skins"]:
seen = set()
for joint in skin["joints"]:
parent = parents[joint]
assert parent in seen or parent not in skin["joints"], (parent, joint, seen)
seen.add(joint)
return parents return parents
if __name__ == "__main__": if __name__ == "__main__":