execute_blender_code
Execute Python inside a live Blender session to model, inspect, animate, or modify scenes, capture results, and apply optional undo steps.
Instructions
Run Python inside the live Blender session (main thread, one undo step per call).
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": "execute_blender_code"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Python using bpy. `C`, `D`, `Vector`, `math` are predefined. Assign to `result` to return a value; print() output is captured. | |
| title | No | Short label shown in Blender's panel and undo history | code |
| timeout | No | ||
| undo_step | No | False for read-only queries (no undo step) |