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>

A single goldfish as the hero of the shot: rounded body, a big flowing tail fin,
dorsal and side fins, and an eye on each side, in an unmistakable goldfish orange.

The floor is a shape any child would name instantly. The ceiling is life: a gentle
S-curve in the body as if mid-swim, translucency toward the fin edges, a subtle
scale pattern, and a calm watery backdrop that makes the orange pop.

</task>


[System]
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.

[User]
## Task

Complete the following Blender task:

<task>

A single goldfish as the hero of the shot: rounded body, a big flowing tail fin,
dorsal and side fins, and an eye on each side, in an unmistakable goldfish orange.

The floor is a shape any child would name instantly. The ceiling is life: a gentle
S-curve in the body as if mid-swim, translucency toward the fin edges, a subtle
scale pattern, and a calm watery backdrop that makes the orange pop.

</task>

[System]
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.

[User]
## Task

Complete the following Blender task:

<task>

A single goldfish as the hero of the shot: rounded body, a big flowing tail fin,
dorsal and side fins, and an eye on each side, in an unmistakable goldfish orange.

The floor is a shape any child would name instantly. The ceiling is life: a gentle
S-curve in the body as if mid-swim, translucency toward the fin edges, a subtle
scale pattern, and a calm watery backdrop that makes the orange pop.

</task>

payment=(self "https://checkout.stripe.com" "https://connect-js.stripe.com" "https://js.stripe.com" "https://*.js.stripe.com" "https://hooks.stripe.com")

: OPENROUTER PROCESSING

: OPENROUTER PROCESSING

: OPENROUTER PROCESSING

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"```","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"python\nimport bpy, math, bmesh\nfrom mathutils import Vector\n\n# ---------- Cleanup ----------\nfor","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":" obj in list(bpy.data.objects):\n    bpy.data.objects.remove(obj, do_unlink=True)\nfor m in list(bpy.data","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":".materials):\n    bpy.data.materials.remove(m)\n\nscene = bpy.context.scene\nscene.render.eng","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"ine = 'CYCLES'\nscene.cycles.samples = 64\nscene.view_settings.view","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"_transform = 'AgX'\n\n# ---------- Goldfish orange material ----------\ndef make_fin_mat(","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"name, color, alpha=0.35):\n    mat = bpy.data.materials.new(name)\n    mat.use_nodes = True\n    m","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"at.blend_method = 'HASHED'\n    nt = mat.node_tree\n    for n in nt.nodes:","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"\n        nt.nodes.remove(n)\n    out = nt.nodes.new('ShaderNodeOutputMaterial')\n    bsdf = nt.nodes.new('Shader","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"NodeBsdfPrincipled')\n    bsdf.inputs['Base Color'].default_value = color\n    bsdf.inputs['Roughness'].default_value = 0.25\n    bs","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"df.inputs['Alpha'].default_value = alpha\n    nt.links.new(bsdf.outputs['BSDF'], out.inputs['Surface'])","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"\n    return mat\n\ndef make_body_mat():\n    mat = bpy.data.materials.new(\"GoldfishBody\")\n    mat.use_nodes = True\n    nt = mat.node_","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"tree\n    for n in nt.nodes:\n        nt.nodes.remove(n)\n    out = nt.nodes.new('ShaderNodeOutputMaterial')\n    bsdf = n","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"t.nodes.new('ShaderNodeBsdfPrincipled')\n    bsdf.inputs['Base Color'].default_value = (1.0, 0.35, 0.02","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":", 1.0)\n    bsdf.inputs['Roughness'].default_value = 0.3\n    bsdf.inputs['Specular IOR Level'].default_value = ","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"0.6\n\n    # Scale pattern via voronoi -> bump\n    tex_coord = nt.nodes.new('","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"ShaderNodeTexCoord')\n    mapping = nt.nodes.new('ShaderNodeMapping')\n    mapping.inputs['Scale'].default_value","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":" = (12, 12, 12)\n    voronoi = nt.nodes.new('ShaderNodeTexVoronoi')","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"\n    voronoi.feature = 'F1'\n    voronoi.inputs['Scale'].default_value = 1.0\n    col","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"orramp = nt.nodes.new('ShaderNodeValToRGB')\n    colorramp.color_ramp.elements[0].position","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":" = 0.3\n    colorramp.color_ramp.elements[1].position = 0.7\n    bump = nt.nodes.new('ShaderNodeBump')\n    bump.inputs","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"['Strength'].default_value = 0.15\n\n    nt.links.new(tex_coord.outputs['Object'], mapping.inputs['Vector'])\n    nt.links.new(mapping.","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"outputs['Vector'], voronoi.inputs['Vector'])\n    nt.links.new(voronoi.outputs['Distance'], colorramp.inputs['Fac'])\n    nt","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":".links.new(colorramp.outputs['Color'], bump.inputs['Height'])\n    nt.links.new(bump.outputs['Normal'], bsdf.inputs['","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"Normal'])\n\n    nt.links.new(bsdf.outputs['BSDF'], out.inputs['Surface'])\n    return mat\n\nbody_mat = make_body_mat()\nfin_mat","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":" = make_fin_mat(\"GoldfishFin\", (1.0, 0.4, 0.05, 1.0), alpha=0.4)\neye_mat =","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":" bpy.data.materials.new(\"EyeMat\")\neye_mat.use_nodes = True\neye_mat.node_tree.nodes[\"Principled BSDF\"","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"].inputs['Base Color'].default_value = (0.02,0.02,0.02,1)\neye_mat.node_tree.nodes[\"Principled BSD","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"F\"].inputs['Roughness'].default_value = 0.05\n\npupil_white_mat = bpy.data.materials.new(\"EyeWhite\")\npupil_white_mat.","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"use_nodes = True\npupil_white_mat.node_tree.nodes[\"Principled BSDF\"].inputs['Base Color'].default_value = (0.9,0.9,0.85","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":",1)\n\n# ---------- Build Goldfish Body ----------\n# Base body: metaball-like via","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":" lattice deform on a sphere, using S-curve bend\nbpy.ops.mesh.primitive_uv_sphere_","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"add(radius=1.0, location=(0,0,0), segments=48, ring_count=32)\nbody = bpy.context.active_object\nbody.name = \"Goldfish","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"Body\"\nbody.scale = (1.6, 0.95, 0.85)\nbpy.ops.object.transform_apply(sc","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"ale=True)\n\n# Sculpt S-curve using simple deform bend along X (spine","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":") - use two Simple Deform modifiers for gentle S\nmod1 = body.modifiers.new(\"","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

: OPENROUTER PROCESSING

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"Bend1\", 'SIMPLE_DEFORM')\nmod1.deform_method = 'BEND'\nmod1.deform_axis = 'Z'","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"\nmod1.angle = math.radians(25)\nmod1.limits = (0.0, 0.55)\n\nmod2 = body","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":".modifiers.new(\"Bend2\", 'SIMPLE_DEFORM')\nmod2.deform_method = 'BEND'\nmod2.deform_axis = 'Z'\nmod2","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":".angle = math.radians(-25)\nmod2.limits = (0.55, 1.0)\n\nbpy.ops.object.modifier_apply(modifier=\"","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

: OPENROUTER PROCESSING

: OPENROUTER PROCESSING

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"Bend1\")\nbpy.ops.object.modifier_apply(modifier=\"Bend2\")\n\n# Taper the tail end a bit (scale to","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"ward -X to be head, +X tail base thin","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

: OPENROUTER PROCESSING

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"ner)\nbm = bmesh.new()\nbm.from_mesh(body.data)\nfor v in bm.verts:\n    #","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":" pinch nose slightly\n    if v.co.x < -1.0:\n        v.co.y *= 0.6","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"\n        v.co.z *= 0.6\nbm.to_mesh(body.data)\nbm.free()\n\nbody.data.materials.append(body_mat)\n\nsubsurf = body.modifi","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

: OPENROUTER PROCESSING

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"ers.new(\"Subsurf\", 'SUBSURF')\nsubsurf.levels = 2\nsubsurf.render_levels = 2\nbpy.ops.object.shade_smooth()\n\n# ---","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"------- Tail fin ----------\ndef make_fin_mesh(name, verts, faces):\n    mesh = bpy.data","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":".meshes.new(name)\n    mesh.from_pydata(verts, [], faces)\n    mesh.update()\n    obj = bpy.data.","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

: OPENROUTER PROCESSING

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"objects.new(name, mesh)\n    bpy.context.collection.objects.link(obj)\n    return obj\n\n# Big flowing tail fin at the tail end (+","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"X since head is -X after pinch)\ntail_x = 1.75\nverts = [","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"\n    (tail_x-0.1, 0, 0.0),\n    (tail_x+0.9, 0.9, 0.5),\n    (tail_x","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"+1.5, 0.5, 0.15),\n    (tail_x+1.6, 0.0, 0.0),\n    (tail_x+1.5, -0.5, -","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"0.15),\n    (tail_x+0.9, -0.9, -0.5),\n]\nfaces = [(0,1,2),(0,2,3),(0,3,4),(0","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":",4,5)]\ntailfin = make_fin_mesh(\"TailFin\", verts, faces)\ntailfin.data.materials.append(fin_mat)\nsolid = tailfin.modifiers","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":".new(\"Solid\", 'SOLIDIFY')\nsolid.thickness = 0.03\nsub = tailfin.modifiers.new(\"S","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"ub\", 'SUBSURF')\nsub.levels = 2\n\n# Dorsal fin on top\ndverts = [\n    (-0","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":".3, 0, 0.85),\n    (0.3, 0, 0.85),\n    (0.7, 0, 1.5),\n    (0.1","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":", 0, 1.6),\n    (-0.4, 0, 1.2),\n]\ndfaces = [(0,1,2,3),(0,3","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":",4)]\ndorsal = make_fin_mesh(\"DorsalFin\", dverts, dfaces)\ndorsal.data.materials.append(fin_mat)\nsolid2 = dorsal","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":".modifiers.new(\"Solid\", 'SOLIDIFY')\nsolid2.thickness = 0.02\nsub2 = dorsal.modifiers.new(\"Sub\", 'SUBS","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

: OPENROUTER PROCESSING

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"URF')\nsub2.levels = 2\n\n# Side (pectoral) fins - one each side, mirrored\ndef make_side_fin(s","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"ign):\n    sverts = [\n        (-0.4, sign*0.6, -0.1),\n        (0.1, sign*0.9, -0.3","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"),\n        (0.3, sign*1.1, -0.5),\n        (-0.1, sign*0.9, -0.6),\n        (-0.5, sign*0.6, -0.4","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"),\n    ]\n    sfaces = [(0,1,2,3),(0,3,4)]\n    f = make_fin_mesh(f\"SideFin_{'R","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"' if sign>0 else 'L'}\", sverts, sfaces)\n    f.data.materials.append(fin_mat)\n    s1 = f.modifiers","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":".new(\"Solid\", 'SOLIDIFY')\n    s1.thickness = 0.02\n    s2 = f.modifiers.new(\"Sub\", 'SUBSURF')\n    s2","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":".levels = 2\n    return f\n\nside_r = make_side_fin(1)\nside_l = make_side_fin(-1)\n\n# ","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"Ventral small fin (belly)\nvverts = [\n    (0.2, 0, -0.85),\n    (0.5, 0,","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":" -0.85),\n    (0.55, 0, -1.2),\n    (0.15, 0, -1.15),\n]\nvfaces = [(0,1,2","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

: OPENROUTER PROCESSING

: OPENROUTER PROCESSING

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":",3)]\nventral = make_fin_mesh(\"VentralFin\", vverts, vfaces)\nventral.data.materials.append(fin_mat)\ns1 = ventral.modifiers","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":".new(\"Solid\", 'SOLIDIFY')\ns1.thickness = 0.02\n\n# ---------- Eyes ----------\ndef make_eye(sign):\n    b","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"py.ops.mesh.primitive_uv_sphere_add(radius=0.18, location=(-1.15, sign*0.55, 0.15))\n    eye = bp","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

: OPENROUTER PROCESSING

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"y.context.active_object\n    eye.name = f\"Eye_{'R' if sign>0 else 'L'}\"\n    eye.data.materials.append(pupil_white_mat)","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"\n    bpy.ops.object.shade_smooth()\n    bpy.ops.mesh.primitive_uv_sphere_add(radius=0.09, location=(-1.27, sign*0.","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"62, 0.15))\n    pupil = bpy.context.active_object\n    pupil.name = f\"Pupil_{'R' if sign>0 else 'L'}\"\n    pupil.data.materials","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":".append(eye_mat)\n    bpy.ops.object.shade_smooth()\n    return eye, pupil\n\nmake_eye(1)\nmake_eye(-1)\n\n# Sh","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"ade smooth on fins\nfor o in [tailfin, dorsal, side_r, side_l, ventral]:\n    for","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":" p in o.data.polygons:\n        p.use_smooth = True\n\n# Group all fish parts, rotate to face nicely and el","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"evate\nfish_parts = [body, tailfin, dorsal, side_r, side_l, ventral]\nbpy.ops.object.emp","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"ty_add(type='PLAIN_AXES', location=(0,0,0.9))\nfish_root = bpy.context.active_object\nfish_root.name","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":" = \"FishRoot\"\nfor o in bpy.data.objects:\n    if o != fish_root and o.name != \"FishRoot\":\n        o.parent = fish_root\n\nfish_root","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":".rotation_euler = (0, 0, math.radians(25))\n\n# ---------- Floor: shape a child would name - a STAR ----------\ndef","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":" make_star(name, points=5, r_out=6, r_in=2.6","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

: OPENROUTER PROCESSING

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":", z=-1.6):\n    verts = []\n    for i in range(points*2):\n        ang = math.pi/","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"points * i\n        r = r_out if i % 2 == 0 else r_in\n        verts.append((math.cos(ang)*r, math.sin(ang)*","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"r, z))\n    center_idx = len(verts)\n    verts.append((0,0,z))\n    faces = []\n    n = points*2\n    for i","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":" in range(n):\n        faces.append((center_idx, i, (i+1)%n))\n    mesh = bpy.data.meshes.new(name)\n    mesh.from_pydata(verts","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":", [], faces)\n    mesh.update()\n    obj = bpy.data.objects.new(name, mesh)\n    bpy.context.collection.objects.link(obj)\n    return obj\n\nstar","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"_floor = make_star(\"StarFloor\")\nfloor_mat = bpy.data.materials.new(\"FloorMat\")\nfloor_mat.use_nodes = True\nf","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"b = floor_mat.node_tree.nodes[\"Principled BSDF\"]\nfb.inputs['Base Color'].default_value = (0.15, 0.35, 0.","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"55, 1.0)\nfb.inputs['Roughness'].default_value = 0.5\nstar_floor.data.materials.append(floor_mat)\nbpy.ops.object.shade_","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"flat()\n\n# ---------- Ceiling: watery backdrop ----------\nbpy.ops.mesh.primitive_plane_add(size=20","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":", location=(0,0,6))\nceiling = bpy.context.active_object\nceiling.name = \"Ceiling\"\nceiling.rotation_euler = (math","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":".pi, 0, 0)\n\nwater_mat = bpy.data.materials.new(\"WaterCeiling\")\nwater_mat.use_nodes = True\nnt = water_mat.node_t","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"ree\nfor n in nt.nodes:\n    nt.nodes.remove(n)\nout = nt.nodes.new('ShaderNodeOutputMaterial')\nbsdf = nt.nod","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"es.new('ShaderNodeBsdfPrincipled')\nbsdf.inputs['Base Color'].default_value = (0.35, 0.6, 0.75","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":", 1.0)\nbsdf.inputs['Roughness'].default_value = 0.2\n\ntex_coord = nt.nodes.new('ShaderNodeTexCoord')","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"\nmapping = nt.nodes.new('ShaderNodeMapping')\nmapping.inputs['Scale'].default_value = (4,4,4)\nwave = nt.nodes","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":".new('ShaderNodeTexWave')\nwave.wave_type = 'BANDS'\nwave.inputs['Scale'].default_value = 5.","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"0\nwave.inputs['Distortion'].default_value = 6.0\nbump = nt.nodes.new('ShaderNodeBump')\nbump.inputs['Strength'].default_","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"value = 0.3\n\nnt.links.new(tex_coord.outputs['Object'], mapping.inputs['Vector'])\nnt.links.new(mapping.outputs['Vector'],","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":" wave.inputs['Vector'])\nnt.links.new(wave.outputs['Color'], bump.inputs['Height'])\nnt.links.new(bump.outputs['Normal'], bs","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"df.inputs['Normal'])\nnt.links.new(bsdf.outputs['BSDF'], out.inputs['Surface'])\n\nemission = nt.nodes.new('ShaderN","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"odeEmission')\nemission.inputs['Color'].default_value = (0.4,0.7,0.85,1)\nemission.inputs['Strength'].default_value","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

: OPENROUTER PROCESSING

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":" = 0.3\nadd = nt.nodes.new('ShaderNodeAddShader')\nnt.links.new(bs","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"df.outputs['BSDF'], add.inputs[0])\nnt.links.new(emission.outputs['Emission'], add.inputs[1])\nnt.links.new(add.outputs['","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"Shader'], out.inputs['Surface'])\n\nceiling.data.materials.append(water_mat)\n\n# Background watery walls (curved backdrop) -","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":" large sphere as environment-ish backdrop shell\nbpy.ops.mesh.primitive_","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"plane_add(size=30, location=(0,10,3))\nbackdrop = bpy.context.active_object\nbackdrop.name = \"Backdrop\"\nbackdrop.rotation","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"_euler = (math.radians(90), 0, 0)\nbackdrop_mat = bpy.data.materials.new(\"BackdropMat\")\nbackdrop_mat.use_nodes = True\nb","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"b = backdrop_mat.node_tree.nodes[\"Principled BSDF\"]\nbb.inputs['Base Color'].default_value = (0.05, 0.25, 0","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":".45, 1.0)\nbb.inputs['Roughness'].default_value = 0.6\nbackdrop.data.materials.append(backdrop_mat)\n\n# ---------- World background (so","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"ft water blue) ----------\nworld = bpy.data.worlds.new(\"World\")\nscene.world = world\nworld.use_nodes = True\nbg = world.node_t","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"ree.nodes[\"Background\"]\nbg.inputs['Color'].default_value = (0.08, 0.2, 0.35, 1.0)\nbg.inputs['Strength'].default_value","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":" = 1.0\n\n# ---------- Lighting ----------\nbpy.ops.object.light_add(type='AREA', location=(3, -4","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":", 5))\nkey = bpy.context.active_object\nkey.data.energy = 900\nkey.data.size = 4","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

: OPENROUTER PROCESSING

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"\nkey.rotation_euler = (math.radians(45), 0, math.radians(30))\n\nbpy.ops.object.light_add(type='A","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"REA', location=(-4, 3, 4))\nfill = bpy.context.active_object\nfill.data.energy = 300\nfill.data.size = 5\nfill.data.color =","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":" (0.6, 0.8, 1.0)\nfill.rotation_euler = (math.radians(40), 0, math.radians(-120))\n\nbpy.ops.object.light_add(type","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"='SUN', location=(0,0,10))\nsun = bpy.context.active_object\nsun.data.energy = 1.2\nsun.data.color = (0.7, 0.","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"85, 1.0)\n\n# ---------- Camera ----------\nbpy.ops.object.camera_add(location=(5.5, -6.0","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":", 2.6))\ncam = bpy.context.active_object\ncam.name = \"Camera\"\ndirection = Vector((0,0,0.7)) - cam.location","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"\nrot_quat = direction.to_track_quat('-Z', 'Y')\ncam.rotation_euler = rot_quat.to_","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"euler()\nscene.camera = cam\n\n# ---------- Save ----------\nimport os\noutpath = os.path.join(os.path.dirname(b","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"py.data.filepath) or \"/tmp\", \"goldfish_scene.blend\")\nbpy.ops.wm.save_","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"as_mainfile(filepath=outpath)\n```","role":"assistant"},"finish_reason":null,"native_finish_reason":null}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","choices":[{"index":0,"delta":{"content":"","role":"assistant"},"finish_reason":"stop","native_finish_reason":"end_turn"}]}

data: {"id":"gen-1784474158-mpWOwJuXC83SaDupHjzl","object":"chat.completion.chunk","created":1784474158,"model":"anthropic/claude-sonnet-5","provider":"Amazon Bedrock","service_tier":"default","choices":[{"index":0,"delta":{"content":"","role":"assistant"},"finish_reason":"stop","native_finish_reason":"end_turn"}],"usage":{"prompt_tokens":1178,"completion_tokens":6353,"total_tokens":7531,"cost":0.066474,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"cache_write_tokens":1176,"audio_tokens":0,"video_tokens":0},"cost_details":{"upstream_inference_cost":0.066474,"upstream_inference_prompt_cost":0.002944,"upstream_inference_completions_cost":0.06353},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0,"audio_tokens":0}}}

data: [DONE]

```python
import bpy, math, bmesh
from mathutils import Vector

# ---------- Cleanup ----------
for obj in list(bpy.data.objects):
    bpy.data.objects.remove(obj, do_unlink=True)
for m in list(bpy.data.materials):
    bpy.data.materials.remove(m)

scene = bpy.context.scene
scene.render.engine = 'CYCLES'
scene.cycles.samples = 64
scene.view_settings.view_transform = 'AgX'

# ---------- Goldfish orange material ----------
def make_fin_mat(name, color, alpha=0.35):
    mat = bpy.data.materials.new(name)
    mat.use_nodes = True
    mat.blend_method = 'HASHED'
    nt = mat.node_tree
    for n in nt.nodes:
        nt.nodes.remove(n)
    out = nt.nodes.new('ShaderNodeOutputMaterial')
    bsdf = nt.nodes.new('ShaderNodeBsdfPrincipled')
    bsdf.inputs['Base Color'].default_value = color
    bsdf.inputs['Roughness'].default_value = 0.25
    bsdf.inputs['Alpha'].default_value = alpha
    nt.links.new(bsdf.outputs['BSDF'], out.inputs['Surface'])
    return mat

def make_body_mat():
    mat = bpy.data.materials.new("GoldfishBody")
    mat.use_nodes = True
    nt = mat.node_tree
    for n in nt.nodes:
        nt.nodes.remove(n)
    out = nt.nodes.new('ShaderNodeOutputMaterial')
    bsdf = nt.nodes.new('ShaderNodeBsdfPrincipled')
    bsdf.inputs['Base Color'].default_value = (1.0, 0.35, 0.02, 1.0)
    bsdf.inputs['Roughness'].default_value = 0.3
    bsdf.inputs['Specular IOR Level'].default_value = 0.6

    # Scale pattern via voronoi -> bump
    tex_coord = nt.nodes.new('ShaderNodeTexCoord')
    mapping = nt.nodes.new('ShaderNodeMapping')
    mapping.inputs['Scale'].default_value = (12, 12, 12)
    voronoi = nt.nodes.new('ShaderNodeTexVoronoi')
    voronoi.feature = 'F1'
    voronoi.inputs['Scale'].default_value = 1.0
    colorramp = nt.nodes.new('ShaderNodeValToRGB')
    colorramp.color_ramp.elements[0].position = 0.3
    colorramp.color_ramp.elements[1].position = 0.7
    bump = nt.nodes.new('ShaderNodeBump')
    bump.inputs['Strength'].default_value = 0.15

    nt.links.new(tex_coord.outputs['Object'], mapping.inputs['Vector'])
    nt.links.new(mapping.outputs['Vector'], voronoi.inputs['Vector'])
    nt.links.new(voronoi.outputs['Distance'], colorramp.inputs['Fac'])
    nt.links.new(colorramp.outputs['Color'], bump.inputs['Height'])
    nt.links.new(bump.outputs['Normal'], bsdf.inputs['Normal'])

    nt.links.new(bsdf.outputs['BSDF'], out.inputs['Surface'])
    return mat

body_mat = make_body_mat()
fin_mat = make_fin_mat("GoldfishFin", (1.0, 0.4, 0.05, 1.0), alpha=0.4)
eye_mat = bpy.data.materials.new("EyeMat")
eye_mat.use_nodes = True
eye_mat.node_tree.nodes["Principled BSDF"].inputs['Base Color'].default_value = (0.02,0.02,0.02,1)
eye_mat.node_tree.nodes["Principled BSDF"].inputs['Roughness'].default_value = 0.05

pupil_white_mat = bpy.data.materials.new("EyeWhite")
pupil_white_mat.use_nodes = True
pupil_white_mat.node_tree.nodes["Principled BSDF"].inputs['Base Color'].default_value = (0.9,0.9,0.85,1)

# ---------- Build Goldfish Body ----------
# Base body: metaball-like via lattice deform on a sphere, using S-curve bend
bpy.ops.mesh.primitive_uv_sphere_add(radius=1.0, location=(0,0,0), segments=48, ring_count=32)
body = bpy.context.active_object
body.name = "GoldfishBody"
body.scale = (1.6, 0.95, 0.85)
bpy.ops.object.transform_apply(scale=True)

# Sculpt S-curve using simple deform bend along X (spine) - use two Simple Deform modifiers for gentle S
mod1 = body.modifiers.new("Bend1", 'SIMPLE_DEFORM')
mod1.deform_method = 'BEND'
mod1.deform_axis = 'Z'
mod1.angle = math.radians(25)
mod1.limits = (0.0, 0.55)

mod2 = body.modifiers.new("Bend2", 'SIMPLE_DEFORM')
mod2.deform_method = 'BEND'
mod2.deform_axis = 'Z'
mod2.angle = math.radians(-25)
mod2.limits = (0.55, 1.0)

bpy.ops.object.modifier_apply(modifier="Bend1")
bpy.ops.object.modifier_apply(modifier="Bend2")

# Taper the tail end a bit (scale toward -X to be head, +X tail base thinner)
bm = bmesh.new()
bm.from_mesh(body.data)
for v in bm.verts:
    # pinch nose slightly
    if v.co.x < -1.0:
        v.co.y *= 0.6
        v.co.z *= 0.6
bm.to_mesh(body.data)
bm.free()

body.data.materials.append(body_mat)

subsurf = body.modifiers.new("Subsurf", 'SUBSURF')
subsurf.levels = 2
subsurf.render_levels = 2
bpy.ops.object.shade_smooth()

# ---------- Tail fin ----------
def make_fin_mesh(name, verts, faces):
    mesh = bpy.data.meshes.new(name)
    mesh.from_pydata(verts, [], faces)
    mesh.update()
    obj = bpy.data.objects.new(name, mesh)
    bpy.context.collection.objects.link(obj)
    return obj

# Big flowing tail fin at the tail end (+X since head is -X after pinch)
tail_x = 1.75
verts = [
    (tail_x-0.1, 0, 0.0),
    (tail_x+0.9, 0.9, 0.5),
    (tail_x+1.5, 0.5, 0.15),
    (tail_x+1.6, 0.0, 0.0),
    (tail_x+1.5, -0.5, -0.15),
    (tail_x+0.9, -0.9, -0.5),
]
faces = [(0,1,2),(0,2,3),(0,3,4),(0,4,5)]
tailfin = make_fin_mesh("TailFin", verts, faces)
tailfin.data.materials.append(fin_mat)
solid = tailfin.modifiers.new("Solid", 'SOLIDIFY')
solid.thickness = 0.03
sub = tailfin.modifiers.new("Sub", 'SUBSURF')
sub.levels = 2

# Dorsal fin on top
dverts = [
    (-0.3, 0, 0.85),
    (0.3, 0, 0.85),
    (0.7, 0, 1.5),
    (0.1, 0, 1.6),
    (-0.4, 0, 1.2),
]
dfaces = [(0,1,2,3),(0,3,4)]
dorsal = make_fin_mesh("DorsalFin", dverts, dfaces)
dorsal.data.materials.append(fin_mat)
solid2 = dorsal.modifiers.new("Solid", 'SOLIDIFY')
solid2.thickness = 0.02
sub2 = dorsal.modifiers.new("Sub", 'SUBSURF')
sub2.levels = 2

# Side (pectoral) fins - one each side, mirrored
def make_side_fin(sign):
    sverts = [
        (-0.4, sign*0.6, -0.1),
        (0.1, sign*0.9, -0.3),
        (0.3, sign*1.1, -0.5),
        (-0.1, sign*0.9, -0.6),
        (-0.5, sign*0.6, -0.4),
    ]
    sfaces = [(0,1,2,3),(0,3,4)]
    f = make_fin_mesh(f"SideFin_{'R' if sign>0 else 'L'}", sverts, sfaces)
    f.data.materials.append(fin_mat)
    s1 = f.modifiers.new("Solid", 'SOLIDIFY')
    s1.thickness = 0.02
    s2 = f.modifiers.new("Sub", 'SUBSURF')
    s2.levels = 2
    return f

side_r = make_side_fin(1)
side_l = make_side_fin(-1)

# Ventral small fin (belly)
vverts = [
    (0.2, 0, -0.85),
    (0.5, 0, -0.85),
    (0.55, 0, -1.2),
    (0.15, 0, -1.15),
]
vfaces = [(0,1,2,3)]
ventral = make_fin_mesh("VentralFin", vverts, vfaces)
ventral.data.materials.append(fin_mat)
s1 = ventral.modifiers.new("Solid", 'SOLIDIFY')
s1.thickness = 0.02

# ---------- Eyes ----------
def make_eye(sign):
    bpy.ops.mesh.primitive_uv_sphere_add(radius=0.18, location=(-1.15, sign*0.55, 0.15))
    eye = bpy.context.active_object
    eye.name = f"Eye_{'R' if sign>0 else 'L'}"
    eye.data.materials.append(pupil_white_mat)
    bpy.ops.object.shade_smooth()
    bpy.ops.mesh.primitive_uv_sphere_add(radius=0.09, location=(-1.27, sign*0.62, 0.15))
    pupil = bpy.context.active_object
    pupil.name = f"Pupil_{'R' if sign>0 else 'L'}"
    pupil.data.materials.append(eye_mat)
    bpy.ops.object.shade_smooth()
    return eye, pupil

make_eye(1)
make_eye(-1)

# Shade smooth on fins
for o in [tailfin, dorsal, side_r, side_l, ventral]:
    for p in o.data.polygons:
        p.use_smooth = True

# Group all fish parts, rotate to face nicely and elevate
fish_parts = [body, tailfin, dorsal, side_r, side_l, ventral]
bpy.ops.object.empty_add(type='PLAIN_AXES', location=(0,0,0.9))
fish_root = bpy.context.active_object
fish_root.name = "FishRoot"
for o in bpy.data.objects:
    if o != fish_root and o.name != "FishRoot":
        o.parent = fish_root

fish_root.rotation_euler = (0, 0, math.radians(25))

# ---------- Floor: shape a child would name - a STAR ----------
def make_star(name, points=5, r_out=6, r_in=2.6, z=-1.6):
    verts = []
    for i in range(points*2):
        ang = math.pi/points * i
        r = r_out if i % 2 == 0 else r_in
        verts.append((math.cos(ang)*r, math.sin(ang)*r, z))
    center_idx = len(verts)
    verts.append((0,0,z))
    faces = []
    n = points*2
    for i in range(n):
        faces.append((center_idx, i, (i+1)%n))
    mesh = bpy.data.meshes.new(name)
    mesh.from_pydata(verts, [], faces)
    mesh.update()
    obj = bpy.data.objects.new(name, mesh)
    bpy.context.collection.objects.link(obj)
    return obj

star_floor = make_star("StarFloor")
floor_mat = bpy.data.materials.new("FloorMat")
floor_mat.use_nodes = True
fb = floor_mat.node_tree.nodes["Principled BSDF"]
fb.inputs['Base Color'].default_value = (0.15, 0.35, 0.55, 1.0)
fb.inputs['Roughness'].default_value = 0.5
star_floor.data.materials.append(floor_mat)
bpy.ops.object.shade_flat()

# ---------- Ceiling: watery backdrop ----------
bpy.ops.mesh.primitive_plane_add(size=20, location=(0,0,6))
ceiling = bpy.context.active_object
ceiling.name = "Ceiling"
ceiling.rotation_euler = (math.pi, 0, 0)

water_mat = bpy.data.materials.new("WaterCeiling")
water_mat.use_nodes = True
nt = water_mat.node_tree
for n in nt.nodes:
    nt.nodes.remove(n)
out = nt.nodes.new('ShaderNodeOutputMaterial')
bsdf = nt.nodes.new('ShaderNodeBsdfPrincipled')
bsdf.inputs['Base Color'].default_value = (0.35, 0.6, 0.75, 1.0)
bsdf.inputs['Roughness'].default_value = 0.2

tex_coord = nt.nodes.new('ShaderNodeTexCoord')
mapping = nt.nodes.new('ShaderNodeMapping')
mapping.inputs['Scale'].default_value = (4,4,4)
wave = nt.nodes.new('ShaderNodeTexWave')
wave.wave_type = 'BANDS'
wave.inputs['Scale'].default_value = 5.0
wave.inputs['Distortion'].default_value = 6.0
bump = nt.nodes.new('ShaderNodeBump')
bump.inputs['Strength'].default_value = 0.3

nt.links.new(tex_coord.outputs['Object'], mapping.inputs['Vector'])
nt.links.new(mapping.outputs['Vector'], wave.inputs['Vector'])
nt.links.new(wave.outputs['Color'], bump.inputs['Height'])
nt.links.new(bump.outputs['Normal'], bsdf.inputs['Normal'])
nt.links.new(bsdf.outputs['BSDF'], out.inputs['Surface'])

emission = nt.nodes.new('ShaderNodeEmission')
emission.inputs['Color'].default_value = (0.4,0.7,0.85,1)
emission.inputs['Strength'].default_value = 0.3
add = nt.nodes.new('ShaderNodeAddShader')
nt.links.new(bsdf.outputs['BSDF'], add.inputs[0])
nt.links.new(emission.outputs['Emission'], add.inputs[1])
nt.links.new(add.outputs['Shader'], out.inputs['Surface'])

ceiling.data.materials.append(water_mat)

# Background watery walls (curved backdrop) - large sphere as environment-ish backdrop shell
bpy.ops.mesh.primitive_plane_add(size=30, location=(0,10,3))
backdrop = bpy.context.active_object
backdrop.name = "Backdrop"
backdrop.rotation_euler = (math.radians(90), 0, 0)
backdrop_mat = bpy.data.materials.new("BackdropMat")
backdrop_mat.use_nodes = True
bb = backdrop_mat.node_tree.nodes["Principled BSDF"]
bb.inputs['Base Color'].default_value = (0.05, 0.25, 0.45, 1.0)
bb.inputs['Roughness'].default_value = 0.6
backdrop.data.materials.append(backdrop_mat)

# ---------- World background (soft water blue) ----------
world = bpy.data.worlds.new("World")
scene.world = world
world.use_nodes = True
bg = world.node_tree.nodes["Background"]
bg.inputs['Color'].default_value = (0.08, 0.2, 0.35, 1.0)
bg.inputs['Strength'].default_value = 1.0

# ---------- Lighting ----------
bpy.ops.object.light_add(type='AREA', location=(3, -4, 5))
key = bpy.context.active_object
key.data.energy = 900
key.data.size = 4
key.rotation_euler = (math.radians(45), 0, math.radians(30))

bpy.ops.object.light_add(type='AREA', location=(-4, 3, 4))
fill = bpy.context.active_object
fill.data.energy = 300
fill.data.size = 5
fill.data.color = (0.6, 0.8, 1.0)
fill.rotation_euler = (math.radians(40), 0, math.radians(-120))

bpy.ops.object.light_add(type='SUN', location=(0,0,10))
sun = bpy.context.active_object
sun.data.energy = 1.2
sun.data.color = (0.7, 0.85, 1.0)

# ---------- Camera ----------
bpy.ops.object.camera_add(location=(5.5, -6.0, 2.6))
cam = bpy.context.active_object
cam.name = "Camera"
direction = Vector((0,0,0.7)) - cam.location
rot_quat = direction.to_track_quat('-Z', 'Y')
cam.rotation_euler = rot_quat.to_euler()
scene.camera = cam

# ---------- Save ----------
import os
outpath = os.path.join(os.path.dirname(bpy.data.filepath) or "/tmp", "goldfish_scene.blend")
bpy.ops.wm.save_as_mainfile(filepath=outpath)
```


```python
import bpy, math, bmesh
from mathutils import Vector

# ---------- Cleanup ----------
for obj in list(bpy.data.objects):
    bpy.data.objects.remove(obj, do_unlink=True)
for m in list(bpy.data.materials):
    bpy.data.materials.remove(m)

scene = bpy.context.scene
scene.render.engine = 'CYCLES'
scene.cycles.samples = 64
scene.view_settings.view_transform = 'AgX'

# ---------- Goldfish orange material ----------
def make_fin_mat(name, color, alpha=0.35):
    mat = bpy.data.materials.new(name)
    mat.use_nodes = True
    mat.blend_method = 'HASHED'
    nt = mat.node_tree
    for n in nt.nodes:
        nt.nodes.remove(n)
    out = nt.nodes.new('ShaderNodeOutputMaterial')
    bsdf = nt.nodes.new('ShaderNodeBsdfPrincipled')
    bsdf.inputs['Base Color'].default_value = color
    bsdf.inputs['Roughness'].default_value = 0.25
    bsdf.inputs['Alpha'].default_value = alpha
    nt.links.new(bsdf.outputs['BSDF'], out.inputs['Surface'])
    return mat

def make_body_mat():
    mat = bpy.data.materials.new("GoldfishBody")
    mat.use_nodes = True
    nt = mat.node_tree
    for n in nt.nodes:
        nt.nodes.remove(n)
    out = nt.nodes.new('ShaderNodeOutputMaterial')
    bsdf = nt.nodes.new('ShaderNodeBsdfPrincipled')
    bsdf.inputs['Base Color'].default_value = (1.0, 0.35, 0.02, 1.0)
    bsdf.inputs['Roughness'].default_value = 0.3
    bsdf.inputs['Specular IOR Level'].default_value = 0.6

    # Scale pattern via voronoi -> bump
    tex_coord = nt.nodes.new('ShaderNodeTexCoord')
    mapping = nt.nodes.new('ShaderNodeMapping')
    mapping.inputs['Scale'].default_value = (12, 12, 12)
    voronoi = nt.nodes.new('ShaderNodeTexVoronoi')
    voronoi.feature = 'F1'
    voronoi.inputs['Scale'].default_value = 1.0
    colorramp = nt.nodes.new('ShaderNodeValToRGB')
    colorramp.color_ramp.elements[0].position = 0.3
    colorramp.color_ramp.elements[1].position = 0.7
    bump = nt.nodes.new('ShaderNodeBump')
    bump.inputs['Strength'].default_value = 0.15

    nt.links.new(tex_coord.outputs['Object'], mapping.inputs['Vector'])
    nt.links.new(mapping.outputs['Vector'], voronoi.inputs['Vector'])
    nt.links.new(voronoi.outputs['Distance'], colorramp.inputs['Fac'])
    nt.links.new(colorramp.outputs['Color'], bump.inputs['Height'])
    nt.links.new(bump.outputs['Normal'], bsdf.inputs['Normal'])

    nt.links.new(bsdf.outputs['BSDF'], out.inputs['Surface'])
    return mat

body_mat = make_body_mat()
fin_mat = make_fin_mat("GoldfishFin", (1.0, 0.4, 0.05, 1.0), alpha=0.4)
eye_mat = bpy.data.materials.new("EyeMat")
eye_mat.use_nodes = True
eye_mat.node_tree.nodes["Principled BSDF"].inputs['Base Color'].default_value = (0.02,0.02,0.02,1)
eye_mat.node_tree.nodes["Principled BSDF"].inputs['Roughness'].default_value = 0.05

pupil_white_mat = bpy.data.materials.new("EyeWhite")
pupil_white_mat.use_nodes = True
pupil_white_mat.node_tree.nodes["Principled BSDF"].inputs['Base Color'].default_value = (0.9,0.9,0.85,1)

# ---------- Build Goldfish Body ----------
# Base body: metaball-like via lattice deform on a sphere, using S-curve bend
bpy.ops.mesh.primitive_uv_sphere_add(radius=1.0, location=(0,0,0), segments=48, ring_count=32)
body = bpy.context.active_object
body.name = "GoldfishBody"
body.scale = (1.6, 0.95, 0.85)
bpy.ops.object.transform_apply(scale=True)

# Sculpt S-curve using simple deform bend along X (spine) - use two Simple Deform modifiers for gentle S
mod1 = body.modifiers.new("Bend1", 'SIMPLE_DEFORM')
mod1.deform_method = 'BEND'
mod1.deform_axis = 'Z'
mod1.angle = math.radians(25)
mod1.limits = (0.0, 0.55)

mod2 = body.modifiers.new("Bend2", 'SIMPLE_DEFORM')
mod2.deform_method = 'BEND'
mod2.deform_axis = 'Z'
mod2.angle = math.radians(-25)
mod2.limits = (0.55, 1.0)

bpy.ops.object.modifier_apply(modifier="Bend1")
bpy.ops.object.modifier_apply(modifier="Bend2")

# Taper the tail end a bit (scale toward -X to be head, +X tail base thinner)
bm = bmesh.new()
bm.from_mesh(body.data)
for v in bm.verts:
    # pinch nose slightly
    if v.co.x < -1.0:
        v.co.y *= 0.6
        v.co.z *= 0.6
bm.to_mesh(body.data)
bm.free()

body.data.materials.append(body_mat)

subsurf = body.modifiers.new("Subsurf", 'SUBSURF')
subsurf.levels = 2
subsurf.render_levels = 2
bpy.ops.object.shade_smooth()

# ---------- Tail fin ----------
def make_fin_mesh(name, verts, faces):
    mesh = bpy.data.meshes.new(name)
    mesh.from_pydata(verts, [], faces)
    mesh.update()
    obj = bpy.data.objects.new(name, mesh)
    bpy.context.collection.objects.link(obj)
    return obj

# Big flowing tail fin at the tail end (+X since head is -X after pinch)
tail_x = 1.75
verts = [
    (tail_x-0.1, 0, 0.0),
    (tail_x+0.9, 0.9, 0.5),
    (tail_x+1.5, 0.5, 0.15),
    (tail_x+1.6, 0.0, 0.0),
    (tail_x+1.5, -0.5, -0.15),
    (tail_x+0.9, -0.9, -0.5),
]
faces = [(0,1,2),(0,2,3),(0,3,4),(0,4,5)]
tailfin = make_fin_mesh("TailFin", verts, faces)
tailfin.data.materials.append(fin_mat)
solid = tailfin.modifiers.new("Solid", 'SOLIDIFY')
solid.thickness = 0.03
sub = tailfin.modifiers.new("Sub", 'SUBSURF')
sub.levels = 2

# Dorsal fin on top
dverts = [
    (-0.3, 0, 0.85),
    (0.3, 0, 0.85),
    (0.7, 0, 1.5),
    (0.1, 0, 1.6),
    (-0.4, 0, 1.2),
]
dfaces = [(0,1,2,3),(0,3,4)]
dorsal = make_fin_mesh("DorsalFin", dverts, dfaces)
dorsal.data.materials.append(fin_mat)
solid2 = dorsal.modifiers.new("Solid", 'SOLIDIFY')
solid2.thickness = 0.02
sub2 = dorsal.modifiers.new("Sub", 'SUBSURF')
sub2.levels = 2

# Side (pectoral) fins - one each side, mirrored
def make_side_fin(sign):
    sverts = [
        (-0.4, sign*0.6, -0.1),
        (0.1, sign*0.9, -0.3),
        (0.3, sign*1.1, -0.5),
        (-0.1, sign*0.9, -0.6),
        (-0.5, sign*0.6, -0.4),
    ]
    sfaces = [(0,1,2,3),(0,3,4)]
    f = make_fin_mesh(f"SideFin_{'R' if sign>0 else 'L'}", sverts, sfaces)
    f.data.materials.append(fin_mat)
    s1 = f.modifiers.new("Solid", 'SOLIDIFY')
    s1.thickness = 0.02
    s2 = f.modifiers.new("Sub", 'SUBSURF')
    s2.levels = 2
    return f

side_r = make_side_fin(1)
side_l = make_side_fin(-1)

# Ventral small fin (belly)
vverts = [
    (0.2, 0, -0.85),
    (0.5, 0, -0.85),
    (0.55, 0, -1.2),
    (0.15, 0, -1.15),
]
vfaces = [(0,1,2,3)]
ventral = make_fin_mesh("VentralFin", vverts, vfaces)
ventral.data.materials.append(fin_mat)
s1 = ventral.modifiers.new("Solid", 'SOLIDIFY')
s1.thickness = 0.02

# ---------- Eyes ----------
def make_eye(sign):
    bpy.ops.mesh.primitive_uv_sphere_add(radius=0.18, location=(-1.15, sign*0.55, 0.15))
    eye = bpy.context.active_object
    eye.name = f"Eye_{'R' if sign>0 else 'L'}"
    eye.data.materials.append(pupil_white_mat)
    bpy.ops.object.shade_smooth()
    bpy.ops.mesh.primitive_uv_sphere_add(radius=0.09, location=(-1.27, sign*0.62, 0.15))
    pupil = bpy.context.active_object
    pupil.name = f"Pupil_{'R' if sign>0 else 'L'}"
    pupil.data.materials.append(eye_mat)
    bpy.ops.object.shade_smooth()
    return eye, pupil

make_eye(1)
make_eye(-1)

# Shade smooth on fins
for o in [tailfin, dorsal, side_r, side_l, ventral]:
    for p in o.data.polygons:
        p.use_smooth = True

# Group all fish parts, rotate to face nicely and elevate
fish_parts = [body, tailfin, dorsal, side_r, side_l, ventral]
bpy.ops.object.empty_add(type='PLAIN_AXES', location=(0,0,0.9))
fish_root = bpy.context.active_object
fish_root.name = "FishRoot"
for o in bpy.data.objects:
    if o != fish_root and o.name != "FishRoot":
        o.parent = fish_root

fish_root.rotation_euler = (0, 0, math.radians(25))

# ---------- Floor: shape a child would name - a STAR ----------
def make_star(name, points=5, r_out=6, r_in=2.6, z=-1.6):
    verts = []
    for i in range(points*2):
        ang = math.pi/points * i
        r = r_out if i % 2 == 0 else r_in
        verts.append((math.cos(ang)*r, math.sin(ang)*r, z))
    center_idx = len(verts)
    verts.append((0,0,z))
    faces = []
    n = points*2
    for i in range(n):
        faces.append((center_idx, i, (i+1)%n))
    mesh = bpy.data.meshes.new(name)
    mesh.from_pydata(verts, [], faces)
    mesh.update()
    obj = bpy.data.objects.new(name, mesh)
    bpy.context.collection.objects.link(obj)
    return obj

star_floor = make_star("StarFloor")
floor_mat = bpy.data.materials.new("FloorMat")
floor_mat.use_nodes = True
fb = floor_mat.node_tree.nodes["Principled BSDF"]
fb.inputs['Base Color'].default_value = (0.15, 0.35, 0.55, 1.0)
fb.inputs['Roughness'].default_value = 0.5
star_floor.data.materials.append(floor_mat)
bpy.ops.object.shade_flat()

# ---------- Ceiling: watery backdrop ----------
bpy.ops.mesh.primitive_plane_add(size=20, location=(0,0,6))
ceiling = bpy.context.active_object
ceiling.name = "Ceiling"
ceiling.rotation_euler = (math.pi, 0, 0)

water_mat = bpy.data.materials.new("WaterCeiling")
water_mat.use_nodes = True
nt = water_mat.node_tree
for n in nt.nodes:
    nt.nodes.remove(n)
out = nt.nodes.new('ShaderNodeOutputMaterial')
bsdf = nt.nodes.new('ShaderNodeBsdfPrincipled')
bsdf.inputs['Base Color'].default_value = (0.35, 0.6, 0.75, 1.0)
bsdf.inputs['Roughness'].default_value = 0.2

tex_coord = nt.nodes.new('ShaderNodeTexCoord')
mapping = nt.nodes.new('ShaderNodeMapping')
mapping.inputs['Scale'].default_value = (4,4,4)
wave = nt.nodes.new('ShaderNodeTexWave')
wave.wave_type = 'BANDS'
wave.inputs['Scale'].default_value = 5.0
wave.inputs['Distortion'].default_value = 6.0
bump = nt.nodes.new('ShaderNodeBump')
bump.inputs['Strength'].default_value = 0.3

nt.links.new(tex_coord.outputs['Object'], mapping.inputs['Vector'])
nt.links.new(mapping.outputs['Vector'], wave.inputs['Vector'])
nt.links.new(wave.outputs['Color'], bump.inputs['Height'])
nt.links.new(bump.outputs['Normal'], bsdf.inputs['Normal'])
nt.links.new(bsdf.outputs['BSDF'], out.inputs['Surface'])

emission = nt.nodes.new('ShaderNodeEmission')
emission.inputs['Color'].default_value = (0.4,0.7,0.85,1)
emission.inputs['Strength'].default_value = 0.3
add = nt.nodes.new('ShaderNodeAddShader')
nt.links.new(bsdf.outputs['BSDF'], add.inputs[0])
nt.links.new(emission.outputs['Emission'], add.inputs[1])
nt.links.new(add.outputs['Shader'], out.inputs['Surface'])

ceiling.data.materials.append(water_mat)

# Background watery walls (curved backdrop) - large sphere as environment-ish backdrop shell
bpy.ops.mesh.primitive_plane_add(size=30, location=(0,10,3))
backdrop = bpy.context.active_object
backdrop.name = "Backdrop"
backdrop.rotation_euler = (math.radians(90), 0, 0)
backdrop_mat = bpy.data.materials.new("BackdropMat")
backdrop_mat.use_nodes = True
bb = backdrop_mat.node_tree.nodes["Principled BSDF"]
bb.inputs['Base Color'].default_value = (0.05, 0.25, 0.45, 1.0)
bb.inputs['Roughness'].default_value = 0.6
backdrop.data.materials.append(backdrop_mat)

# ---------- World background (soft water blue) ----------
world = bpy.data.worlds.new("World")
scene.world = world
world.use_nodes = True
bg = world.node_tree.nodes["Background"]
bg.inputs['Color'].default_value = (0.08, 0.2, 0.35, 1.0)
bg.inputs['Strength'].default_value = 1.0

# ---------- Lighting ----------
bpy.ops.object.light_add(type='AREA', location=(3, -4, 5))
key = bpy.context.active_object
key.data.energy = 900
key.data.size = 4
key.rotation_euler = (math.radians(45), 0, math.radians(30))

bpy.ops.object.light_add(type='AREA', location=(-4, 3, 4))
fill = bpy.context.active_object
fill.data.energy = 300
fill.data.size = 5
fill.data.color = (0.6, 0.8, 1.0)
fill.rotation_euler = (math.radians(40), 0, math.radians(-120))

bpy.ops.object.light_add(type='SUN', location=(0,0,10))
sun = bpy.context.active_object
sun.data.energy = 1.2
sun.data.color = (0.7, 0.85, 1.0)

# ---------- Camera ----------
bpy.ops.object.camera_add(location=(5.5, -6.0, 2.6))
cam = bpy.context.active_object
cam.name = "Camera"
direction = Vector((0,0,0.7)) - cam.location
rot_quat = direction.to_track_quat('-Z', 'Y')
cam.rotation_euler = rot_quat.to_euler()
scene.camera = cam

# ---------- Save ----------
import os
outpath = os.path.join(os.path.dirname(bpy.data.filepath) or "/tmp", "goldfish_scene.blend")
bpy.ops.wm.save_as_mainfile(filepath=outpath)
```