blender_execute_python
Run arbitrary Python code inside Blender to perform custom operations when no dedicated tool fits. Assign output to 'result' to retrieve data.
Instructions
Execute arbitrary Python code inside Blender (escape hatch for advanced ops).
The code runs with bpy already imported. To return data, assign it to
a variable named result. Use this only when no dedicated tool fits.
DESTRUCTIVE: arbitrary code can modify or delete anything in the scene.
Args:
params: ExecutePythonInput with the code string to execute (max 20,000 chars).
Returns:
JSON with the value of result (if set) or a success confirmation.
Example: code = "result = [obj.name for obj in bpy.data.objects if obj.type == 'MESH']"
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| params | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |