execute_python
Run custom Python inside Blender to handle tasks the dedicated tools don't cover, such as geometry nodes, drivers, particles, bmesh work, and animation.
Instructions
Escape hatch for anything the dedicated tools don't cover (geometry nodes, drivers, particles, custom bmesh work, animation). Prefer the dedicated tools - they carry the quality defaults.
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_python"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Python run inside Blender. Available: bpy, bmesh, math, mathutils, Vector, Matrix, np, C (context), D (data), roxy (roxy.call('tool_name', **params) runs any Roxy tool). print() output is returned; set a variable named result to return a value. |