blender_execute
Runs Blender Python scripts live in the GUI or headlessly to create and edit 3D models, modifiers, shaders, lighting, and animation, then save .blend files or export common 3D formats.
Instructions
Execute Blender Python (bpy/bmesh/mathutils) 3D modeling, modifier, shader, lighting, or animation scripts either LIVE inside the open Blender GUI (via Live Bridge) or HEADLESSLY (Blender --background). Supports saving .blend and exporting .glb/.gltf/.obj/.stl/.fbx/.usdz.
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"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Python code using bpy, bmesh, mathutils, math. Assign `result = ...` to return structured data. | |
| mode | No | auto | |
| port | No | ||
| save_as | No | Optional output .blend file path. | |
| blend_file | No | Input .blend file (for headless edits on an existing file). | |
| export_path | No | Optional 3D export path (.glb, .gltf, .obj, .stl, .fbx, .usdz). | |
| timeout_sec | No |