|
|
 |
Blender (.py) Scripts...
Automating Blender .. |
|
|
|
 | Blender Script without Opening Blender |  |
A great little example of using Blender scripts without actually opening the Blender - is to have to load a .blend file - render the output to a jpg and then close. We'll do all this in a single Python script.
If you've not already got one - create a simple test blender file called 'test.blend' - make sure it has a camera so you can render the output to an image (using the Blender renderer).
You cannot just run Blender python scripts directly through Python - you need to pass them into Blender! So you either need to add Blender.exe to the global system path or call it with the absolute location from the command terminal:
"C:\Program Files\Blender Foundation\Blender 4.1\blender.exe" --background --python myscript.py
This is what your myscript.py file looks like:
|
|
|
|
|
|