run_script
Execute Python code using Blender's bpy API to build, modify, or query .blend files. Supports live interaction with an open Blender window or headless automated runs.
Instructions
Run Python against Blender's bpy API.
bpy, mathutils, math, D and C are pre-bound. Assign to result or call
emit(value) to send data back; print() output is captured too.
Args: code: The Python to execute. blend_file: Open this .blend first. Supplying it forces a headless run. save_as: Save the file here when the script finishes. target: "auto", "live" or "headless".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| target | No | auto | |
| save_as | No | ||
| blend_file | No |