blender_execute_code
Execute Python scripts within Blender to automate 3D modeling, using bpy, bmesh, and mathutils. Set result to return values; keep scripts under 20 lines for reliable geometry updates.
Instructions
Run Python in Blender (bpy, bmesh, mathutils, math available). Set __result__ to return a value. Keep under ~20 lines.
For boolean ops use blender_boolean instead — it's safer and validates the
result. NEVER use bpy.ops.object.join() (creates internal faces). After any
geometry change call blender_validate(checks=['HEALTH']) to verify watertight + manifold.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"code": "<code>"
},
"name": "blender_execute_code"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |