File size: 729 Bytes
12b5ac7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env python3
"""Regenerate ../animation_prompts.json from manifests/animation_manifest.jsonl."""
import json, os
HERE = os.path.dirname(os.path.abspath(__file__))
ROOT = os.path.dirname(HERE)
mf  = os.path.join(HERE, "manifests", "animation_manifest.jsonl")
out = os.path.join(ROOT, "animation_prompts.json")
d = {}
for line in open(mf):
    line = line.strip()
    if not line: continue
    e = json.loads(line)
    ent = {"prompt": e.get("name"), "motion_id": e.get("motion_id")}
    if e.get("description") and e["description"] != e.get("name"): ent["description"] = e["description"]
    d[e["file"]] = ent
json.dump(d, open(out, "w"), indent=1, ensure_ascii=False, sort_keys=True)
print("wrote", out, "->", len(d))