File size: 562 Bytes
12b5ac7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env python3
"""Regenerate ../animation_frames.json by parsing every FBX in ../animation/."""
import json, os, sys
HERE = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, HERE)
from fbx_frames import parse
ROOT = os.path.dirname(HERE)
adir = os.path.join(ROOT, "animation")
out  = os.path.join(ROOT, "animation_frames.json")
d = {}
for f in sorted(os.listdir(adir)):
    if f.endswith(".fbx"):
        d[f] = parse(os.path.join(adir, f))["keys_max"]
json.dump(d, open(out, "w"), indent=1, sort_keys=True)
print("wrote", out, "->", len(d))