blender-scripting
Installation
SKILL.md
Blender Scripting
Overview
Automate Blender tasks and create 3D models procedurally using Python and the bpy API. Run scripts headlessly from the terminal to manipulate scenes, build geometry with bmesh, apply modifiers, batch process files, and import/export models.
Instructions
1. Run scripts from the terminal
blender --background --python script.py
blender myfile.blend --background --python script.py
blender --background --factory-startup --python-exit-code 1 --python script.py -- --output /tmp/result.png --scale 2.0
Your own arguments go after --; read them in the script with sys.argv[sys.argv.index("--") + 1:]. Without --python-exit-code 1, Blender exits with status 0 even when the script raised an exception, so CI and shell && chains never notice the failure. --factory-startup ignores the user's saved preferences and add-ons for reproducible runs.