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.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |