blender_run_code
Run Python code in Blender's main thread to create, modify, or query scenes and objects, then return the script's standard output.
Instructions
在 Blender 主线程执行一段 Python 代码(可直接使用 bpy、C、D),返回标准输出。
示例:创建立方体并移动 import bpy bpy.ops.mesh.primitive_cube_add(size=2, location=(1, 0, 0)) print('created:', bpy.context.object.name)
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_run_code"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |