blender_execute_code
Execute custom Python code with Blender's bpy API to perform complex 3D operations, create custom workflows, and access advanced functionality not covered by standard tools.
Instructions
Execute Python code using Blender's bpy API.
Provides escape hatch for complex operations not covered by other tools. Use full bpy API access.
Args:
code (string): Python code to execute using bpy API (max 100KB)
timeout (optional): Execution timeout in milliseconds (1000-180000, default: 180000)
Returns: Execution result with any output or error message
Examples:
List objects: [obj.name for obj in bpy.data.objects]
Create custom mesh: bpy.ops.mesh.primitive_cube_add(location=(1, 2, 3))
Get object location: bpy.data.objects['Cube'].location[:]
Use when: Complex operations, custom workflows, bpy API access Don't use when: Simple operations covered by dedicated tools
Security: Code is validated for dangerous patterns. System commands are restricted. Performance: Long-running code may hit timeout limits (default 3 minutes)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Python code using bpy API | |
| timeout | No | Execution timeout (ms) |