File size: 938 Bytes
acdc230 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | import os
import tomllib
import math
scenes = ["bridge", "crane", "office_dynamic", "glass_house", "old_house", "unfinished_build", "ship"]
for scene in scenes:
os.system(
f"blender -b {scene}/{scene}.blend -P export_unordered_cams.py -- {scene}"
)
with open(f"{scene}/scene_data.toml", "rb") as f:
data = tomllib.load(f)
scene_data = data["scene_data"]
offset_dict = data['traj2offset']
offsets = offset_dict.values()
for offset in offsets:
if math.isnan(offset):
continue
indir = f"{scene}/unordered_cams/traj=proxy_surface_{offset}"
outdir = f"{scene}/cam_order/traj=proxy_surface_{offset}"
os.makedirs(outdir, exist_ok=True)
os.system(
"python tsp_solver.py " + indir + " " +
outdir + '/splatworks_cam_order.txt'
)
os.system(
f"blender -b {scene}/{scene}.blend -P render_scene.py"
)
|