"""Wireframe pictures of NutritionVat.blend (Workbench, a thin wireframe modifier on copies), nothing saved: blender.exe -b ../NutritionVat.blend --python nv_wire.py previews/wire_.png, the same cameras as nv_render.py's extra shots. """ import bpy, os from mathutils import Vector HERE = os.path.dirname(os.path.abspath(__file__)) FOLDER = os.path.dirname(HERE) exec(open(os.path.join(HERE, "nv_lib.py")).read()) OUTD = os.path.join(FOLDER, "previews") SHOTS = { "hero": (P(560, -60, 215), P(0, 500, 270), 50, (1600, 2000)), "front_left": (P(-520, -80, 215), P(0, 500, 270), 50, (1600, 2000)), "pipes": (P(820, -260, 60), P(0, 495, 120), 35, (1600, 2000)), "side": (P(1000, 540, 120), P(0, 540, 60), 35, (1600, 2000)), "rear": (P(560, 1120, 190), P(0, 520, 280), 50, (1600, 2000)), "tank": (P(-110, 230, 230), P(0, 470, 250), 75, (1600, 2000)), "top": (P(250, 300, -260), P(0, 495, 70), 60, (1600, 1200)), } sc = bpy.context.scene ink = bpy.data.materials.new("_wire_ink") ink.diffuse_color = (0.02, 0.02, 0.03, 1) for o in [o for o in bpy.data.objects if o.type == 'MESH' and not o.name.startswith(("UCX_", "Studio_"))]: t = o.copy() t.data = o.data.copy() t.name = "_w_" + o.name t.data.materials.clear() t.data.materials.append(ink) sc.collection.objects.link(t) md = t.modifiers.new("w", 'WIREFRAME') md.thickness = 0.0006 md.use_relative_offset = False md.use_even_offset = False for o in bpy.data.objects: if o.name.startswith(("UCX_", "Studio_")): o.hide_render = True sc.render.engine = 'BLENDER_WORKBENCH' sh = sc.display.shading sh.light = 'STUDIO' sh.color_type = 'MATERIAL' sh.show_object_outline = False sh.show_cavity = False sc.render.film_transparent = False sc.view_settings.view_transform = 'Standard' sc.render.image_settings.file_format = 'PNG' cam = bpy.data.objects.new("_wire_cam", bpy.data.cameras.new("_wire_cam")) sc.collection.objects.link(cam) sc.camera = cam done = [] for nm, (loc, tgt, lens, res) in SHOTS.items(): sc.render.resolution_x, sc.render.resolution_y = res sc.render.resolution_percentage = 100 cam.location = loc cam.rotation_euler = (tgt - loc).normalized().to_track_quat('-Z', 'Y').to_euler() cam.data.lens = lens cam.data.clip_start = 0.02 sc.render.filepath = os.path.join(OUTD, "wire_%s.png" % nm) bpy.ops.render.render(write_still=True) done.append(os.path.basename(sc.render.filepath)) print("WIRE OK", done)