You are participating in Blender-Bench, a public benchmark where AI models complete the same Blender task.

Your result will be compared head-to-head with another model. Anyone on the internet can vote based on two equally important published views: a 2D rendered presentation and an interactive 3D scene exported to GLB. Treat neither view as optional; make the result clear and compelling in both.

Complete the request as well as you can. The benchmark does not prescribe a workflow or visual style; use whichever Blender techniques you consider appropriate. Make the important requirements evident in the published result, save a complete scene, and present the work clearly in every requested output.

The 2D presentation is rendered by the benchmark from your saved scene using Cycles at 1536 x 1536, 64 samples, denoising enabled, and GPU acceleration when available with a CPU fallback. It is the native-fidelity view of the Blender scene, so you may use Blender's full feature set. Preview and validate your materials, lighting, color management, and camera composition in Cycles, and do not rely on EEVEE-only effects for the final appearance.

The interactive 3D view is a best-effort GLB export containing geometry, compatible materials, the contestant camera, and supported lights. Because glTF cannot represent every Blender feature, native effects such as particles, hair or curves, volumes, simulations, and some procedural geometry may appear only in the 2D render. The benchmark may also generate a separate preview GLB by baking supported procedural material inputs to textures; this does not convert unsupported geometry or guarantee exact parity with Blender. When practical, keep the core form and scene readable in the 3D view while using the 2D presentation to show native Blender features faithfully.

## Harness Instructions

You are writing a single Python script for Blender 5.1 using the bpy API. The scene starts empty. Your script must build everything the user's prompt asks for.

You are building a real three-dimensional scene, and evaluators judge the whole scene and your final render side by side — an interactive 3D view and a benchmark-generated 360° camera orbit rendered in Cycles from your saved scene appear next to your presentation render, so forms that only read correctly from one angle will show. Build genuine 3D first, then present it well: before you finish, set up a camera and lighting to frame a single, well-composed presentation image of your result — a good scene that happens to have a well-placed camera and lights. The final benchmark capture overrides the scene render settings and renders in Cycles at 1536x1536, 64 samples, with denoising and GPU acceleration (CPU fallback). Preview and validate materials, lighting, color management, and composition in Cycles; do not rely on EEVEE-only effects. Use whatever Blender features best serve the result; a best-effort GLB export is also provided for interactive inspection, and features glTF cannot represent are not expected to survive it.

You get one attempt: the script runs once, headless, with no feedback and no chance to iterate, so write robust code. Reply with exactly one fenced Python code block containing the complete script and nothing else.


## Task

Complete the following Blender task:

<task>

An abandoned village slowly reclaimed by nature. Weathered houses with rusted, corroded metal roofs; overgrown foliage creeping up the walls and through broken windows; moss, grass, and vines spreading across the ground and over the rooftops. Convey age, decay, and the quiet return of the wild.

</task>


```python
import bpy
import math
import random
from mathutils import Vector, Euler

rng = random.Random(20250414)

scene = bpy.context.scene
root_collection = scene.collection

def link(obj):
    if obj.name not in root_collection.objects:
        root_collection.objects.link(obj)

def mesh_from(name, verts, faces):
    me = bpy.data.meshes.new(name)
    me.from_pydata(verts, [], faces)
    me.update()
    return me

def new_object(name, me, material=None, location=None, rotation=None, scale=None):
    obj = bpy.data.objects.new(name, me)
    link(obj)
    if material is not None:
        if material not in me.materials:
            me.materials.append(material)
    if location is not None:
        obj.location = Vector(location)
    if rotation is not None:
        obj.rotation_euler = Euler(rotation, 'XYZ')
    if scale is not None:
        obj.scale = Vector(scale)
    return obj

def box_mesh(size, center=(0.0, 0.0, 0.0)):
    w, d, h = size
    cx, cy, cz = center
    verts = [
        (cx - w / 2, cy - d / 2, cz - h / 2),
        (cx + w / 2, cy - d / 2, cz - h / 2),
        (cx + w / 2, cy + d / 2, cz - h / 2),
        (cx - w / 2, cy + d / 2, cz - h / 2),
        (cx - w / 2, cy - d / 2, cz + h / 2),
        (cx + w / 2, cy - d / 2, cz + h / 2),
        (cx + w / 2, cy + d / 2, cz + h / 2),
        (cx - w / 2, cy + d / 2, cz + h / 2),
    ]
    faces = [
        (0, 1, 2, 3),
        (4, 7, 6, 5),
        (0, 4, 5, 1),
        (1, 5, 6, 2),
        (2, 6, 7, 3),
        (3, 7, 4, 0),
    ]
    return mesh_from("BoxMesh", verts, faces)

def make_box_obj(name, size, center, material=None):
    me = box_mesh(size)
    obj = new_object(name, me, material, location=center)
    return obj

def make_local_box_obj(name, size, center, material=None):
    me = box_mesh(size, center)
    obj = new_object(name, me, material)
    return obj

def subtract_rect(rect, hole):
    rx0, rz0, rx1, rz1 = rect
    hx0, hz0, hx1, hz1 = hole
    if hx1 <= rx0 or hx0 >= rx1 or hz1 <= rz0 or hz0 >= rz1:
        return [rect]
    ix0 = max(rx0, hx0)
    ix1 = min(rx1, hx1)
    iz0 = max(rz0, hz0)
    iz1 = min(rz1, hz1)
    if ix0 >= ix1 or iz0 >= iz1:
        return [rect]
    out = []
    if rx0 < ix0:
        out.append((rx0, rz0, ix0, rz1))
    if ix1 < rx1:
        out.append((ix1, rz0, rx1, rz1))
    if rz0 < iz0:
        out.append((ix0, rz0, ix1, iz0))
    if iz1 < rz1:
        out.append((ix0, iz1, ix1, rz1))
    return out

def make_wall_pieces(name, rects, y_center, thickness, material):
    objs = []
    for i, rect in enumerate(rects):
        x0, z0, x1, z1 = rect
        size = (x1 - x0, thickness, z1 - z0)
        center = ((x0 + x1) / 2.0, y_center, (z0 + z1) / 2.0)
        objs.append(make_local_box_obj(f"{name}_{i}", size, center, material))
    return objs

def make_gable_triangle(name, sign, w, d, wall_h, roof_h, material):
    x = sign * w / 2.0
    verts = [(x, -d / 2.0, wall_h), (x, d / 2.0, wall_h), (x, 0.0, roof_h)]
    if sign > 0:
        faces = [(0, 1, 2), (2, 1, 0)]
    else:
        faces = [(0, 2, 1), (1, 2, 0)]
    me = mesh_from(name, verts, faces)
    return new_object(name, me, material)

def make_roof_panel(name, sign, w, eave, wall_h, roof_h, material,
                    corr_freq=14.0, corr_amp=0.022, nx=26, ny=12):
    verts = []
    for ix in range(nx):
        x = -w / 2.0 + ix * w / (nx - 1)
        for iy in range(ny):
            t = iy / (ny - 1)
            y = sign * t * eave
            z = roof_h - (roof_h - wall_h) * t
            z += math.sin(x * corr_freq) * corr_amp * (0.4 + 0.6 * t)
            verts.append((x, y, z))
    faces = []
    for ix in range(nx - 1):
        for iy in range(ny - 1):
            i0 = ix * ny + iy
            i1 = (ix + 1) * ny + iy
            i2 = (ix + 1) * ny + iy + 1
            i3 = ix * ny + iy + 1
            if sign > 0:
                faces.append((i0, i1, i2, i3))
            else:
                faces.append((i0, i3, i2, i1))
    me = mesh_from(name, verts, faces)
    return new_object(name, me, material)

def add_glass_shards(name, center, ww, wh, y, material, count=6):
    verts = []
    faces = []
    for _ in range(count):
        base = len(verts)
        for _ in range(3):
            px = center[0] + rng.uniform(-ww / 2.0, ww / 2.0)
            pz = center[2] + rng.uniform(-wh / 2.0, wh / 2.0)
            verts.append((px, y, pz))
        faces.append((base, base + 1, base + 2))
    me = mesh_from(name, verts, faces)
    return new_object(name, me, material)

def build_house(name, loc, rot, w, d, wall_h, roof_rise,
                door=True, windows="auto"):
    roof_h = wall_h + roof_rise
    thickness = 0.22
    front_y = -d / 2.0
    back_y = d / 2.0

    door_w = 0.95
    door_h = 2.0
    win_w = 1.0
    sill = 1.0
    win_h = 1.25

    front_holes = []
    if door:
        front_holes.append((-door_w / 2.0, 0.0, door_w / 2.0, door_h))
    if windows == "auto":
        if w >= 6.0:
            win_positions = [-2.1, 2.1]
        elif w >= 4.0:
            win_positions = [-1.15, 1.15]
        else:
            win_positions = [-0.5]
    else:
        win_positions = windows
    for wx in win_positions:
        front_holes.append((wx - win_w / 2.0, sill, wx + win_w / 2.0, sill + win_h))

    rects = [(-w / 2.0, 0.0, w / 2.0, wall_h)]
    for hole in front_holes:
        new_rects = []
        for rect in rects:
            new_rects.extend(subtract_rect(rect, hole))
        rects = new_rects
    objs = make_wall_pieces(f"{name}_front", rects, front_y, thickness, wall_mat)

    back_holes = [(-0.45, 1.1, 0.45, 2.2)]
    back_rects = [(-w / 2.0, 0.0, w / 2.0, wall_h)]
    for hole in back_holes:
        new_rects = []
        for rect in back_rects:
            new_rects.extend(subtract_rect(rect, hole))
        back_rects = new_rects
    objs += make_wall_pieces(f"{name}_back", back_rects, back_y, thickness, wall_mat)

    for sign in (-1, 1):
        objs.append(make_gable_triangle(f"{name}_gable_{sign}", sign, w, d, wall_h, roof_h, wall_mat))

    eave = d / 2.0 + 0.35
    for sign in (-1, 1):
        objs.append(make_roof_panel(f"{name}_roof_{sign}", sign, w, eave, wall_h, roof_h, roof_mat))

    if w >= 4.0:
        chimney_center = (w * 0.3, 0.0, roof_h + 0.45)
        objs.append(make_local_box_obj(f"{name}_chimney", (0.65, 0.65, 0.95), chimney_center, brick_mat))

    for wx in win_positions:
        cx = wx
        cz = sill + win_h / 2.0
        objs.append(make_local_box_obj(f"{name}_frame_l", (0.08, 0.1, win_h + 0.1),
                                       (cx - win_w / 2.0 - 0.04, front_y, cz), wood_mat))
        objs.append(make_local_box_obj(f"{name}_frame_r", (0.08, 0.1, win_h + 0.1),
                                       (cx + win_w / 2.0 + 0.04, front_y, cz), wood_mat))
        objs.append(make_local_box_obj(f"{name}_frame_t", (win_w + 0.2, 0.1, 0.08),
                                       (cx, front_y, cz + win_h / 2.0 + 0.04), wood_mat))
        objs.append(make_local_box_obj(f"{name}_frame_b", (win_w + 0.2, 0.1, 0.08),
                                       (cx, front_y, cz - win_h / 2.0 - 0.04), wood_mat))
        objs.append(add_glass_shards(f"{name}_glass", (cx, front_y, cz), win_w, win_h,
                                     front_y - 0.02, glass_mat))

    for obj in objs:
        obj.location = Vector(loc)
        obj.rotation_euler = Euler((0.0, 0.0, rot), 'XYZ')

    return {
        "objects": objs,
        "loc": Vector(loc),
        "rot": rot,
        "w": w,
        "d": d,
        "h": wall_h,
        "roof_h": roof_h,
    }

def build_ruin(loc, rot):
    objs = []
    rect = [(-1.8, 0.0, 1.8, 1.5)]
    objs += make_wall_pieces("ruin_wall", rect, -0.8, 0.25, wall_mat)
    objs += make_wall_pieces("ruin_wall2", [(-1.2, 0.0, 1.2, 0.9)], 0.9, 0.22, wall_mat)
    objs.append(make_local_box_obj("ruin_frag1", (1.2, 0.25, 0.45), (-0.5, 0.2, 0.2), wall_mat))
    objs.append(make_local_box_obj("ruin_frag2", (1.0, 0.22, 0.35), (0.7, -0.3, 0.1), wall_mat))
    sheet = make_local_box_obj("ruin_roof_sheet", (3.0, 0.08, 2.0), (0.3, 0.0, 0.12), roof_mat)
    objs.append(sheet)

    for obj in objs:
        obj.location = Vector(loc)
        obj.rotation_euler = Euler((0.0, 0.0, rot), 'XYZ')

    sheet.location = Vector(loc) + Vector((0.6, 0.2, 0.08))
    sheet.rotation_euler = Euler((0.12, 0.08, rot + 0.65), 'XYZ')
    return objs

def make_cylinder_mesh(name, r1, r2, height, segs=8):
    verts = []
    for i in range(segs):
        a = 2 * math.pi * i / segs
        verts.append((r1 * math.cos(a), r1 * math.sin(a), 0.0))
        verts.append((r2 * math.cos(a), r2 * math.sin(a), height))
    bottom = len(verts)
    verts.append((0.0, 0.0, 0.0))
    top = len(verts)
    verts.append((0.0, 0.0, height))
    faces = []
    for i in range(segs):
        i0 = i * 2
        i1 = i * 2 + 1
        i2 = ((i + 1) % segs) * 2 + 1
        i3 = ((i + 1) % segs) * 2
        faces.append((i0, i1, i2, i3))
    for i in range(segs):
        a = i * 2
        b = ((i + 1) % segs) * 2
        faces.append((bottom, b, a))
    for i in range(segs):
        a = i * 2 + 1
        b = ((i + 1) % segs) * 2 + 1
        faces.append((top, a, b))
    return mesh_from(name, verts, faces)

def make_foliage_mesh(name, material, leaf_count=55, radius=0.28):
    verts = []
    faces = []
    for _ in range(leaf_count):
        cx, cy, cz = (rng.uniform(-radius, radius),
                      rng.uniform(-radius, radius),
                      rng.uniform(-radius * 0.4, radius * 0.6))
        a = Vector((rng.uniform(-1.0, 1.0), rng.uniform(-1.0, 1.0), rng.uniform(-1.0, 1.0)))
        if a.length < 1e-6:
            a = Vector((1.0, 0.0, 0.0))
        a.normalize()
        ref = Vector((0.0, 0.0, 1.0))
        if abs(a.z) > 0.9:
            ref = Vector((1.0, 0.0, 0.0))
        bdir = a.cross(ref)
        if bdir.length < 1e-6:
            bdir = Vector((0.0, 1.0, 0.0))
        bdir.normalize()
        la = rng.uniform(0.08, 0.16)
        lb = rng.uniform(0.07, 0.14)
        a0 = a * la
        b0 = bdir * lb
        c = Vector((cx, cy, cz))
        base = len(verts)
        verts.extend([c - a0 - b0, c + a0 - b0, c + a0 + b0, c - a0 + b0])
        faces.append((base, base + 1, base + 2, base + 3))
    me = mesh_from(name, verts, faces)
    if material is not None:
        me.materials.append(material)
    return me

def new_foliage_obj(pos, mesh, scale):
    obj = bpy.data.objects.new("foliage", mesh)
    link(obj)
    obj.location = Vector(pos)
    obj.scale = (scale, scale, scale)
    obj.rotation_euler = Euler((rng.uniform(-0.3, 0.3),
                                rng.uniform(-0.3, 0.3),
                                rng.uniform(0.0, math.tau)), 'XYZ')
    return obj

def scatter_house_foliage(house, wall_count=18, roof_count=12):
    loc = house["loc"]
    rot = house["rot"]
    m = Euler((0.0, 0.0, rot), 'XYZ').to_matrix()
    w = house["w"]
    d = house["d"]
    h = house["h"]
    roof_h = house["roof_h"]

    for _ in range(wall_count):
        side = rng.randrange(4)
        if side == 0:
            local = (rng.uniform(-w / 2.0, w / 2.0),
                     -d / 2.0 - rng.uniform(0.0, 0.4),
                     rng.uniform(0.0, h + 0.25))
        elif side == 1:
            local = (rng.uniform(-w / 2.0, w / 2.0),
                     d / 2.0 + rng.uniform(0.0, 0.4),
                     rng.uniform(0.0, h + 0.25))
        elif side == 2:
            local = (-w / 2.0 - rng.uniform(0.0, 0.4),
                     rng.uniform(-d / 2.0, d / 2.0),
                     rng.uniform(0.0, h + 0.2))
        else:
            local = (w / 2.0 + rng.uniform(0.0, 0.4),
                     rng.uniform(-d / 2.0, d / 2.0),
                     rng.uniform(0.0, h + 0.2))
        world = Vector(loc) + m @ Vector(local)
        new_foliage_obj(world, leaf_mesh, rng.uniform(0.25, 0.85))

    for _ in range(roof_count):
        sign = rng.choice((-1.0, 1.0))
        tt = rng.uniform(0.05, 0.95)
        eave = d / 2.0 + 0.35
        y = sign * tt * eave
        z = roof_h - (roof_h - h) * tt + rng.uniform(0.02, 0.18)
        x = rng.uniform(-w / 2.0, w / 2.0)
        local = (x, y, z)
        world = Vector(loc) + m @ Vector(local)
        new_foliage_obj(world, moss_mesh, rng.uniform(0.3, 0.85))

def add_tree(x, y, base_z, scale=1.0):
    trunk = new_object("trunk", make_cylinder_mesh("trunk_mesh", 0.14 * scale, 0.06 * scale, 2.4 * scale),
                       wood_mat, location=(x, y, base_z))
    trunk.rotation_euler = Euler((rng.uniform(-0.12, 0.12),
                                  rng.uniform(-0.12, 0.12),
                                  rng.uniform(0.0, math.tau)), 'XYZ')
    for _ in range(3):
        px = x + rng.uniform(-0.9, 0.9) * scale
        py = y + rng.uniform(-0.9, 0.9) * scale
        pz = base_z + 2.2 * scale + rng.uniform(-0.4, 0.8) * scale
        new_foliage_obj((px, py, pz), leaf_mesh, rng.uniform(1.2, 1.9) * scale)

# ---------- materials ----------
def base_mat(name, color, rough=0.6, metal=0.0):
    mat = bpy.data.materials.new(name)
    mat.use_nodes = True
    nt = mat.node_tree
    nt.nodes.clear()
    out = nt.nodes.new('ShaderNodeOutputMaterial')
    bsdf = nt.nodes.new('ShaderNodeBsdfPrincipled')
    bsdf.inputs['Base Color'].default_value = (*color, 1.0)
    bsdf.inputs['Roughness'].default_value = rough
    bsdf.inputs['Metallic'].default_value = metal
    nt.links.new(bsdf.outputs[0], out.inputs['Surface'])
    return mat

wall_mat = base_mat("WeatheredWall", (0.72, 0.68, 0.58), rough=1.0)
roof_mat = base_mat("RustedMetal", (0.35, 0.22, 0.12), rough=0.55, metal=0.7)
wood_mat = base_mat("OldWood", (0.20, 0.13, 0.07), rough=0.9)
brick_mat = base_mat("OldBrick", (0.42, 0.18, 0.12), rough=1.0)
leaf_mat = base_mat("DarkLeaf", (0.08, 0.25, 0.06), rough=0.6)
moss_mat = base_mat("Moss", (0.12, 0.32, 0.10), rough=0.85)
ground_mat = base_mat("Earth", (0.18, 0.16, 0.11), rough=1.0)
glass_mat = base_mat("BrokenGlass", (0.68, 0.85, 0.95), rough=0.05)
glass_nt = glass_mat.node_tree
glass_bsdf = next(n for n in glass_nt.nodes if n.type == 'BSDF_PRINCIPLED')
if 'Transmission Weight' in glass_bsdf.inputs:
    glass_bsdf.inputs['Transmission Weight'].default_value = 0.9
elif 'Transmission' in glass_bsdf.inputs:
    glass_bsdf.inputs['Transmission'].default_value = 0.9
glass_bsdf.inputs['Alpha'].default_value = 0.5

def ground_z(x, y):
    z = 0.25 * math.sin(x * 0.22 + 0.5) * math.cos(y * 0.26 - 0.2)
    z += 0.12 * math.sin(x * 0.7 + 2.0) * math.cos(y * 0.8 + 1.0)
    z += 0.04 * math.sin(x * 1.7 + 1.0) * math.sin(y * 1.5 + 2.0)
    return z

# ---------- ground ----------
res = 120
size = 70.0
verts = []
for j in range(res + 1):
    y = -size / 2.0 + j * size / res
    for i in range(res + 1):
        x = -size / 2.0 + i * size / res
        z = ground_z(x, y)
        verts.append((x, y, z))

faces = []
for j in range(res):
    for i in range(res):
        v00 = j * (res + 1) + i
        v01 = j * (res + 1) + i + 1
        v11 = (j + 1) * (res + 1) + i + 1
        v10 = (j + 1) * (res + 1) + i
        faces.append((v00, v01, v11, v10))

ground_mesh = mesh_from("GroundMesh", verts, faces)
ground = new_object("Ground", ground_mesh, ground_mat)
ground.data.materials.append(leaf_mat)

# Grass particles
ps_mod = ground.modifiers.new("Grass", 'PARTICLE_SYSTEM')
ps = ps_mod.particle_system
p_settings = ps.settings
p_settings.type = 'HAIR'
p_settings.count = 6000
p_settings.hair_length = 0.34
p_settings.hair_step = 4
p_settings.render_type = 'PATH'
p_settings.children_type = 'INTERPOLATED'
p_settings.child_n = 2
p_settings.seed = 11
p_settings.material = 1

# ---------- foliage meshes ----------
leaf_mesh = make_foliage_mesh("LeafClusterMesh", leaf_mat, leaf_count=55)
moss_mesh = make_foliage_mesh("MossClusterMesh", moss_mat, leaf_count=40)

# ---------- houses ----------
houses = []
houses.append(build_house(
    "main_house",
    (-4.8, 1.0, ground_z(-4.8, 1.0)),
    0.18, 7.0, 5.0, 3.0, 2.0,
    door=True, windows="auto"))

houses.append(build_house(
    "house_b",
    (4.2, -1.6, ground_z(4.2, -1.6)),
    -0.25, 5.0, 4.0, 2.8, 1.7,
    door=True, windows="auto"))

houses.append(build_house(
    "house_c",
    (2.4, 4.6, ground_z(2.4, 4.6)),
    0.45, 4.0, 3.5, 2.5, 1.5,
    door=True, windows=[-0.4]))

houses.append(build_house(
    "shed",
    (-6.2, 3.4, ground_z(-6.2, 3.4)),
    1.35, 3.5, 2.6, 2.0, 1.0,
    door=True, windows=[]))

build_ruin((0.4, 3.2, ground_z(0.4, 3.2)), 0.55)

# foliage on houses
for house in houses:
    scatter_house_foliage(house, wall_count=20, roof_count=13)

# ---------- trees ----------
tree_positions = [
    (-10.0, -8.0, ground_z(-10.0, -8.0)),
    (-11.5, 7.0, ground_z(-11.5, 7.0)),
    (9.0, 7.5, ground_z(9.0, 7.5)),
    (11.0, -7.0, ground_z(11.0, -7.0)),
    (-6.5, -7.5, ground_z(-6.5, -7.5)),
    (7.0, 1.5, ground_z(7.0, 1.5)),
]
for tp in tree_positions:
    add_tree(tp[0], tp[1], tp[2], scale=rng.uniform(0.8, 1.4))

# small bushes scattered on the ground
for _ in range(50):
    x = rng.uniform(-12.0, 12.0)
    y = rng.uniform(-10.0, 10.0)
    z = ground_z(x, y)
    if math.hypot(x, y) < 3.0:
        continue
    if rng.random() < 0.5:
        new_foliage_obj((x, y, z), leaf_mesh, rng.uniform(0.5, 1.4))
    else:
        new_foliage_obj((x, y, z), moss_mesh, rng.uniform(0.4, 1.2))

# ---------- atmosphere ----------
world = bpy.data.worlds.new("World")
scene.world = world
world.use_nodes = True
wnt = world.node_tree
wnt.nodes.clear()
wout = wnt.nodes.new('ShaderNodeOutputWorld')
wbg = wnt.nodes.new('ShaderNodeBackground')
wsky = wnt.nodes.new('ShaderNodeTexSky')
wsky.sky_type = 'HOSEK'
wsky.sun_elevation = 0.35
wsky.sun_rotation = 0.75
wbg.inputs['Strength'].default_value = 0.9
wnt.links.new(wsky.outputs['Color'], wbg.inputs['Color'])
wnt.links.new(wbg.outputs['Background'], wout.inputs['Surface'])

sun_data = bpy.data.lights.new("Sun", 'SUN')
sun_data.energy = 3.0
sun_data.angle = 0.06
sun = bpy.data.objects.new("Sun", sun_data)
link(sun)
sun.rotation_euler = Euler((0.75, 0.0, 0.7), 'XYZ')

fill_data = bpy.data.lights.new("Fill", 'AREA')
fill_data.energy = 120.0
fill_data.size = 8.0
fill = bpy.data.objects.new("Fill", fill_data)
link(fill)
fill.location = (-6.0, -8.0, 5.0)
fill.rotation_euler = Euler((1.2, 0.0, 0.4), 'XYZ')

# ---------- camera ----------
cam_data = bpy.data.cameras.new("Camera")
cam = bpy.data.objects.new("Camera", cam_data)
link(cam)
scene.camera = cam
cam.location = Vector((12.8, -12.0, 5.2))
cam_data.lens = 38.0
look_target = Vector((-0.5, 1.2, 1.7))
direction = look_target - cam.location
cam.rotation_euler = direction.to_track_quat('-Z', 'Y').to_euler()

# ---------- render settings ----------
scene.render.engine = 'CYCLES'
scene.render.resolution_x = 1536
scene.render.resolution_y = 1536
scene.render.film_transparent = False
scene.cycles.samples = 64
scene.cycles.denoiser = 'OPENIMAGEDENOISE'
scene.view_settings.view_transform = 'AgX'
scene.view_settings.look = 'AgX - Medium High Contrast'

bpy.context.view_layer.update()
```