1👍
✅
There’s a similar question on Blender stackexchange: https://blender.stackexchange.com/a/1366
I would recommend you using blender as a Python module and not running a separate process since it’s harder to control the load on the system and handle errors. How to run the blender as Python module: https://wiki.blender.org/wiki/Building_Blender/Other/BlenderAsPyModule
However, for the sake of simplicity, you can run the blender
as a command using subprocess
, see examples here: https://docs.python.org/3/library/subprocess.html#subprocess.run
import subprocess
subprocess.run(
["blender", "-b", "animation.blend", "-o", "//render_", "-F", "PNG", "-x", "1", "-a"]
)
Source:stackexchange.com