# Critique round 2 (read-only, never saves): close-ups the review needs, with the Coder's own lighting setups # blender -b Tender_Grouper.blend --python critique/round2/cr2_render.py -- SAMPLES SHOT [SHOT ...] # SHOT: windows (the concept camera, 3x, cropped to the cabin windows, dark water light as concept_render.png) # seats (studio light, inside the nose looking aft at the seat fronts, the nose cut away by the camera's clip) # mount (studio light, the drum mount from the starboard side, low, and from below) import bpy, os, sys, json, math from mathutils import Vector, Euler ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) OUT = os.path.join(ROOT, "critique", "round2") args = sys.argv[sys.argv.index("--") + 1:] SAMPLES = args[0] SHOTS = args[1:] sys.argv = [sys.argv[0], "--", "cr2", SAMPLES, "none"] NS = {"__file__": os.path.join(ROOT, "build", "gr_render.py"), "__name__": "gr_render_cr2"} exec(open(os.path.join(ROOT, "build", "gr_render.py"), encoding="utf-8").read(), NS) sc, cam, D = NS["sc"], NS["cam"], NS["D"] if "windows" in SHOTS: NS["water"]() c = json.load(open(os.path.join(ROOT, "build", "checks", "concept_cam.json"))) cam.data.type = 'PERSP' cam.location = c["location"] cam.rotation_euler = Euler(c["rotation_euler_xyz_rad"], 'XYZ') cam.data.sensor_fit = 'HORIZONTAL' cam.data.sensor_width = 36.0 cam.data.lens = c["lens_mm_36mm_sensor_horizontal"] W, H = c["resolution"] sc.render.resolution_percentage = 300 sc.render.use_border = True sc.render.use_crop_to_border = True # concept_render.png px: windows x 450-690, y 150-300 (y from the top) sc.render.border_min_x, sc.render.border_max_x = 440 / W, 700 / W sc.render.border_min_y, sc.render.border_max_y = 1 - 310 / H, 1 - 140 / H sc.render.resolution_x, sc.render.resolution_y = W, H sc.render.filepath = os.path.join(OUT, "cr2_concept_windows_3x.png") bpy.ops.render.render(write_still=True) sc.render.use_border = False sc.render.resolution_percentage = 100 if "seats" in SHOTS: NS["studio"]() NS["aim"]((0.0, -2.05, 0.15), Vector((0.0, -0.4, -0.35)), 16) cam.data.clip_start = 0.05 sc.render.filepath = os.path.join(OUT, "cr2_seats_from_nose.png") sc.render.resolution_x, sc.render.resolution_y = 1400, 1000 bpy.ops.render.render(write_still=True) if "mount" in SHOTS: NS["studio"]() NS["aim"]((-4.2, -3.0, -0.9), Vector((0.0, -3.0, -0.85)), 50) sc.render.filepath = os.path.join(OUT, "cr2_mount_side.png") sc.render.resolution_x, sc.render.resolution_y = 1400, 1000 bpy.ops.render.render(write_still=True) NS["aim"]((-2.6, -5.6, -2.4), Vector((0.0, -2.9, -0.8)), 45) sc.render.filepath = os.path.join(OUT, "cr2_mount_low_front.png") bpy.ops.render.render(write_still=True) print("CR2 RENDERS OK", SHOTS) if "pocket" in SHOTS: NS["studio"]() import math as _m for k, ang in enumerate((45, 135, 225, 315)): a = _m.radians(ang) px, py = 0.53 * _m.cos(a), -0.09 + 0.53 * _m.sin(a) NS["aim"]((px * 3.2, -0.09 + (py + 0.09) * 3.2, 2.35), Vector((px, py, 1.15)), 45) sc.render.filepath = os.path.join(OUT, "cr2_pocket_%03d.png" % ang) sc.render.resolution_x, sc.render.resolution_y = 1000, 750 bpy.ops.render.render(write_still=True) print("CR2 POCKETS OK")