# tools/blender/render_shots.py # Renders the FBC: NIGHT SHIFT concept cameras into docs/concept/. # Run inside Blender after build_scene.py: # exec(open("/home/dandovlatov/Documents/cntrl/tools/blender/render_shots.py").read()) import os import time import bpy REPO = "/home/dandovlatov/Documents/cntrl" OUT = os.path.join(REPO, "docs", "concept") os.makedirs(OUT, exist_ok=True) SHOTS = [ ("Cam_Hero", "hero_oldest_house.png"), ("Cam_Game", "hero_game_camera.png"), ("Cam_Detail", "detail_guard_standees.png"), ] sc = bpy.context.scene t_start = time.time() for cam_name, filename in SHOTS: cam = bpy.data.objects.get(cam_name) if cam is None: print("[render] missing camera", cam_name) continue sc.camera = cam sc.render.filepath = os.path.join(OUT, filename) t0 = time.time() bpy.ops.render.render(write_still=True) print("[render] %s -> %s (%.0fs)" % (cam_name, filename, time.time() - t0)) sc.camera = bpy.data.objects.get("Cam_Hero", sc.camera) print("[render] done in %.0fs" % (time.time() - t_start))