#!/usr/bin/env python3 """Motion fingerprint of a binary FBX: the per-curve value ranges. Two exports of the same motion that differ only by a trailing hold share every curve's (min, max) pair, while genuinely different motions do not. Comparing the whole multiset is far stricter than comparing a single peak-to-peak figure, which can coincide by chance. """ import os, struct, sys, zlib SCALAR = {"Y": 2, "C": 1, "I": 4, "F": 4, "D": 8, "L": 8} ELEM = {"f": 4, "d": 8, "l": 8, "i": 4, "b": 1} FMT = {"f": "f", "d": "d", "l": "q", "i": "i", "b": "b"} def probe(path, nd=3): d = open(path, "rb").read() if d[:21] != b"Kaydara FBX Binary \x00": raise ValueError("not a binary FBX") u64 = struct.unpack("= 7500 NREC = 25 if u64 else 13 curves = [] def rd_prop(p, want): t = chr(d[p]); s = p; p += 1 if t in SCALAR: p += SCALAR[t]; return p, None if t in ELEM: n, enc, clen = struct.unpack("