"""Scan GLBs: list finger joints and which animations have live (non-frozen) finger rotation tracks.""" import json, struct, sys, math from pathlib import Path FINGER_TOKENS = ("thumb", "index", "middle", "ring", "pinky", "finger") def read_glb(path): data = Path(path).read_bytes() magic, ver, length = struct.unpack_from(" 2.0 else frozen).append((nname, ang)) total = len(live) + len(frozen) if total: print(f" anim '{aname}': {total} finger rot tracks, {len(live)} live (>2deg), {len(frozen)} frozen") if live: top = sorted(live, key=lambda x: -x[1])[:4] print(" top movers:", ", ".join(f"{n} {a:.0f}deg" for n, a in top)) else: print(f" anim '{aname}': NO finger tracks") if __name__ == "__main__": for p in sys.argv[1:]: scan(p, verbose_joints="--joints" in sys.argv)