simrepairbench / scripts /build_broken_objects.py
chrisvoncsefalvay's picture
Add CASTAIGNE25 damaged OpenUSD objects and typed case viewer
fa41a2a verified
Raw History Blame Contribute Delete
716 Bytes
"""Build damaged USD objects from the pinned CASTAIGNE25 source files."""
import argparse
import json
from pathlib import Path
from simrepairbench.common import roster
from simrepairbench.damage import build
def main():
p = argparse.ArgumentParser(description=__doc__)
p.add_argument('--root', type=Path, default=Path.cwd())
p.add_argument('--case', default='all')
args = p.parse_args()
for case in roster(args.root):
if args.case not in ('all', case['case_id']):
continue
r = build(case, args.root)
print(json.dumps({'case_id': r['case_id'], 'authored_faults': r['defect_count'], 'passed': r['passed']}), flush=True)
if __name__ == '__main__':
main()