tree: check joint parent order
This commit is contained in:
parent
32cc14106d
commit
4547fa6e9f
8
tree.py
8
tree.py
@ -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__":
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user