You are operating Blender through the provided tools. Build what the user's prompt asks for in the current scene. Work step by step and verify your own work. Before you finish, set up a camera and lighting to frame a single, well-composed presentation image of your result — position and aim the camera, and add or adjust lights so the subject reads clearly. When you are finished, reply with the single word DONE and no tool calls.


type: user

text: A warm wooden cabin beside a pond, with a stone chimney, a small dock, and a few trees.


type: assistant

user_prompt: A warm wooden cabin beside a pond, with a stone chimney, a small dock, and a few trees.


code:
import bpy, math
from mathutils import Vector
# clear
bpy.ops.object.select_all(action='SELECT'); bpy.ops.object.delete(use_global=False)
for d in (bpy.data.materials, bpy.data.curves, bpy.data.cameras, bpy.data.lights):
    pass
# materials helper
def mat(name, color, rough=0.7, metallic=0):
    m=bpy.data.materials.get(name) or bpy.data.materials.new(name)
    m.diffuse_color=(*color,1); m.use_nodes=True
    bs=m.node_tree.nodes.get('Principled BSDF'); bs.inputs['Base Color'].default_value=(*color,1); bs.inputs['Roughness'].default_value=rough; bs.inputs['Metallic'].default_value=metallic
    return m
wood=mat('Warm cedar',(0.34,0.12,0.035)); wood2=mat('Log highlights',(0.55,0.23,0.07)); darkwood=mat('Dark roof',(0.075,0.035,0.018)); stone=mat('Chimney stone',(0.24,0.22,0.19)); mortar=mat('Mortar',(0.12,0.11,0.1)); water=mat('Pond water',(0.025,0.16,0.22),0.18); grass=mat('Grass',(0.10,0.23,0.07)); leaf=mat('Pine green',(0.035,0.18,0.055)); trunk=mat('Tree trunks',(0.20,0.075,0.025)); window=mat('Golden windows',(0.95,0.48,0.10),0.25); black=mat('Iron',(0.02,0.015,0.01),0.35)
def cube(n,loc,scale,ma, bevel=0.0):
    bpy.ops.mesh.primitive_cube_add(location=loc); o=bpy.context.object; o.name=n; o.scale=scale; bpy.ops.object.transform_apply(location=False,rotation=False,scale=True)
    if ma:o.data.materials.append(ma)
    if bevel:
        mod=o.modifiers.new('Soft edges','BEVEL'); mod.width=bevel; mod.segments=2
    return o
def cyl(n,loc,rad,depth,ma,verts=12):
    bpy.ops.mesh.primitive_cylinder_add(vertices=verts,radius=rad,depth=depth,location=loc); o=bpy.context.object;o.name=n;o.data.materials.append(ma); return o
def cone(n,loc,r1,r2,depth,ma,verts=12):
    bpy.ops.mesh.primitive_cone_add(vertices=verts,radius1=r1,radius2=r2,depth=depth,location=loc);o=bpy.context.object;o.name=n;o.data.materials.append(ma);return o
# ground and pond
cube('Ground',(0,0,-0.25),(10,8,0.25),grass)
bpy.ops.mesh.primitive_cylinder_add(vertices=64,radius=4.1,depth=0.08,location=(3.3,-1.8,0.03)); pond=bpy.context.object;pond.name='Pond';pond.scale.y=0.68; bpy.ops.object.transform_apply(location=False,rotation=False,scale=True);pond.data.materials.append(water)
# cabin main body at left/back
# logs horizontal layers
for z in [0.5,0.9,1.3,1.7,2.1]: cube('Cabin log',( -2.0,1.0,z),(2.35,1.55,0.17),wood2,0.06)
# end wall accents vertical corners
for x in [-4.25,0.25]:
  cube('Corner post',(x,1.0,1.4),(0.16,1.7,1.35),wood,0.04)
# front facade plane door/window
cube('Door',(-2.7,-0.59,1.1),(0.48,0.06,1.0),wood,0.03)
cyl('Door knob',(-2.32,-0.68,1.1),0.07,0.08,black,16).rotation_euler[0]=math.pi/2
for x in [-1.0]: cube('Window frame',(x,-0.64,1.45),(0.65,0.05,0.55),wood,0.03); cube('Window glow',(x,-0.70,1.45),(0.48,0.04,0.38),window)
# crossbars
for z in [1.45]: cube('Window cross',(x,-0.76,z),(0.52,0.025,0.035),wood)
cube('Window cross',(x,-0.76,1.45),(0.035,0.025,0.42),wood)
# gabled roof two slabs
r1=cube('Roof slope',(-2.0,0.05,3.05),(2.65,1.85,0.16),darkwood);r1.rotation_euler[0]=math.radians(-28)
r2=cube('Roof slope',(-2.0,1.95,3.05),(2.65,1.85,0.16),darkwood);r2.rotation_euler[0]=math.radians(28)
# chimney stack behind/right
for z in [2.4,2.8,3.2,3.6]:
  for x in [-0.25,0.02]:
    cube('Chimney stone',(x,1.45,z),(0.14,0.38,0.18),stone,0.02)
cube('Chimney cap',(-0.12,1.45,3.85),(0.42,0.52,0.12),mortar,0.03)
# dock toward pond
for x in [1.5,2.0,2.5,3.0]: cube('Dock plank',(x,-1.2,0.22),(0.22,0.8,0.10),wood2,0.03)
for x in [1.2,3.3]:
 for y in [-1.8,-0.6]: cyl('Dock post',(x,y,-0.25),0.1,1.0,trunk,10)
# trees, pine layers
def pine(x,y,s=1):
 cyl('Tree trunk',(x,y,1.4*s),0.18*s,2.8*s,trunk,10)
 for i,(z,r) in enumerate([(2.1,1.0),(2.8,0.78),(3.45,0.55),(4.0,0.3)]): cone('Pine foliage',(x,y,z*s),r*s,0,1.35*s,leaf,12)
pine(5.4,2.4,1.35); pine(6.8,1.5,1.0); pine(-6.0,2.7,1.15)
# rocks near shore
for loc,sc in [((1.0,-0.1,0.15),(.45,.3,.2)),((4.4,-0.5,.15),(.35,.25,.18)),((5.0,-2.8,.15),(.5,.28,.2))]: cube('Shore stone',loc,sc,stone,0.1)
# sun and area
bpy.ops.object.light_add(type='AREA', location=(-3,-4,8)); key=bpy.context.object;key.name='Warm key';key.data.energy=1100;key.data.shape='DISK';key.data.size=5;key.data.color=(1.0,0.55,0.3)
bpy.ops.object.light_add(type='AREA', location=(4,-1,5)); fill=bpy.context.object;fill.name='Cool fill';fill.data.energy=700;fill.data.size=6;fill.data.color=(0.35,0.55,1.0)
# point warm window light
bpy.ops.object.light_add(type='POINT',location=(-1,-1,1.5)); bpy.context.object.data.energy=180; bpy.context.object.data.color=(1.0,.3,.08)
# camera
bpy.ops.object.camera_add(location=(11,-16,9)); cam=bpy.context.object;cam.name='Presentation Camera';bpy.context.scene.camera=cam
def track(obj,pt): obj.rotation_euler=(Vector(pt)-obj.location).to_track_quat('-Z','Y').to_euler()
track(cam,(-0.5,0.0,1.7)); cam.data.lens=48
# world/render
world=bpy.context.scene.world or bpy.data.worlds.new('World');bpy.context.scene.world=world;world.use_nodes=True; world.node_tree.nodes['Background'].inputs['Color'].default_value=(0.025,0.045,0.08,1);world.node_tree.nodes['Background'].inputs['Strength'].default_value=0.28
sc=bpy.context.scene;sc.render.engine='BLENDER_EEVEE_NEXT';sc.render.resolution_x=900;sc.render.resolution_y=700;sc.render.resolution_percentage=100
sc.render.image_settings.file_format='PNG';sc.render.filepath='/tmp/cabin.png';sc.render.film_transparent=False
sc.view_settings.look='AgX - Medium High Contrast'
bpy.ops.wm.save_as_mainfile(filepath='/tmp/cabin_scene.blend');bpy.ops.render.render(write_still=True)
print('built',len(bpy.context.scene.objects))


Error executing code: Communication error with Blender: Code execution error: bpy_struct: item.attr = val: enum "BLENDER_EEVEE_NEXT" not found in ('BLENDER_EEVEE', 'BLENDER_WORKBENCH', 'CYCLES')


code:
import bpy
from mathutils import Vector
sc=bpy.context.scene
sc.render.engine='BLENDER_EEVEE'
# ensure camera and lights if previous code got through
if 'Presentation Camera' not in bpy.data.objects:
    bpy.ops.object.camera_add(location=(11,-16,9)); cam=bpy.context.object;cam.name='Presentation Camera';sc.camera=cam
else: cam=bpy.data.objects['Presentation Camera']; sc.camera=cam
cam.rotation_euler=(Vector((-0.5,0.0,1.7))-cam.location).to_track_quat('-Z','Y').to_euler();cam.data.lens=48
sc.render.resolution_x=900;sc.render.resolution_y=700;sc.render.resolution_percentage=100
sc.render.image_settings.file_format='PNG';sc.render.filepath='/tmp/cabin.png'
world=sc.world or bpy.data.worlds.new('World');sc.world=world;world.use_nodes=True;world.node_tree.nodes['Background'].inputs['Color'].default_value=(0.025,0.045,0.08,1);world.node_tree.nodes['Background'].inputs['Strength'].default_value=0.28
sc.view_settings.look='AgX - Medium High Contrast'
bpy.ops.wm.save_as_mainfile(filepath='/tmp/cabin_scene.blend');bpy.ops.render.render(write_still=True)
print('objects',len(sc.objects),'camera',cam.name)


Error executing code: Communication error with Blender: Code execution error: Error: Cannot open file <repo>\harness\tmp\cabin_scene.blend@ for writing: No such file or directory


code:
import bpy
from mathutils import Vector
sc=bpy.context.scene; sc.render.engine='BLENDER_EEVEE'
cam=bpy.data.objects.get('Presentation Camera')
if not cam:
 bpy.ops.object.camera_add(location=(11,-16,9));cam=bpy.context.object;cam.name='Presentation Camera'
sc.camera=cam;cam.rotation_euler=(Vector((-0.5,0.0,1.7))-cam.location).to_track_quat('-Z','Y').to_euler();cam.data.lens=48
sc.render.resolution_x=900;sc.render.resolution_y=700;sc.render.resolution_percentage=100
sc.render.image_settings.file_format='PNG';sc.render.filepath='/tmp/cabin.png'
world=sc.world or bpy.data.worlds.new('World');sc.world=world;world.use_nodes=True;world.node_tree.nodes['Background'].inputs['Color'].default_value=(0.025,0.045,0.08,1);world.node_tree.nodes['Background'].inputs['Strength'].default_value=0.28
bpy.ops.render.render(write_still=True)
print('done',len(sc.objects))


Code executed successfully: done 56


text: DONE