# Grouper: close-up pictures for the critique's round 2 items (read-only, never saves), after the Critique's cr2_render.py, # with gr_render.py's own light set-ups: # blender -b Tender_Grouper.blend --python build/gr_closeups.py -- TAG SAMPLES SHOT [SHOT ...] -> previews/_cu_*.png # SHOT: windows (the concept camera, 3x, cropped to the cabin windows, dark water light) # seats (studio light, inside the nose looking aft at the seat fronts) # mount (studio light, the drum mount from the starboard side, low, and from below) # pocket (studio light, the four claw pockets round the collar) # pod (studio light, the pod's junction with the hull and its vents, from the side and from fore-above) # flag (studio light, the flank's markings, flag and seal) import bpy, os, sys, json, math from mathutils import Vector, Euler ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) OUT = os.path.join(ROOT, "previews") args = sys.argv[sys.argv.index("--") + 1:] TAG, SAMPLES = args[0], args[1] SHOTS = args[2:] sys.argv = [sys.argv[0], "--", TAG, SAMPLES, "none"] NS = {"__file__": os.path.join(ROOT, "build", "gr_render.py"), "__name__": "gr_render_cu"} exec(open(os.path.join(ROOT, "build", "gr_render.py"), encoding="utf-8").read(), NS) sc, cam, D = NS["sc"], NS["cam"], NS["D"] def shot(name, w=1400, h=1000): sc.render.filepath = os.path.join(OUT, "%s_cu_%s.png" % (TAG, name)) sc.render.resolution_x, sc.render.resolution_y = w, h bpy.ops.render.render(write_still=True) 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 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, "%s_cu_concept_windows_3x.png" % TAG) 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 shot("seats_from_nose") cam.data.clip_start = 0.02 if "mount" in SHOTS: NS["studio"]() NS["aim"]((-4.2, -3.0, -0.9), Vector((0.0, -3.0, -0.85)), 50) shot("mount_side") NS["aim"]((-2.6, -5.6, -2.4), Vector((0.0, -2.9, -0.8)), 45) shot("mount_low_front") NS["aim"]((-3.0, -5.2, 0.2), Vector((0.0, -3.0, -0.8)), 45) shot("mount_q_fore") if "pocket" in SHOTS: NS["studio"]() for ang in (45, 135, 225, 315): a = math.radians(ang) px, py = 0.53 * math.cos(a), -0.09 + 0.53 * math.sin(a) NS["aim"]((px * 3.2, -0.09 + (py + 0.09) * 3.2, 2.35), Vector((px, py, 1.15)), 45) shot("pocket_%03d" % ang, 1000, 750) NS["aim"]((-2.6, 1.4, 2.6), Vector((0.0, -0.09, 1.2)), 50) shot("collar_q_aft", 1000, 750) if "pod" in SHOTS: NS["studio"]() NS["aim"]((-5.0, -1.2, -1.0), Vector((-1.0, -1.25, -1.15)), 60) shot("pod_side") NS["aim"]((-2.8, -3.6, 0.4), Vector((-1.0, -1.1, -1.2)), 55) shot("pod_q_fore") if "drum" in SHOTS: NS["studio"]() NS["aim"]((-2.4, -5.0, -0.4), Vector((0.0, -3.2, -0.85)), 50) shot("drum_q_fore") if "flag" in SHOTS: NS["studio"]() NS["aim"]((-4.5, 0.5, 0.6), Vector((-1.0, 0.45, 0.55)), 70) shot("flag_side") print("CLOSEUPS OK", SHOTS)