A Blender Addon to write script file to launch renders from the terminal.
Write file .sh
and, but poorly tested, .bat
.
Launching renders from the command line is useful for:
With this addon the script creation is simplified and can then be modified and customized according to your needs.
With default values this addon writes a script to start rendering the current frame with the project settings; clicking the "Write script" button creates a .sh
and/or .bat
file in the same folder as the .blend
project, with the same name followed by "_render":[blend file name]_render.sh
This file is ready to be launched from the terminal with
./<nome blend file>_render.sh
The created script has a function "startrender" which is called by passing several parameters:
The values for resolution percentage, render engine, render quality and overwrite are collected in a Python string that is passed to blender with the --python-expr
parameter.
The other values are passed with the corresponding blender command line parameters.
In this panel you choose which frames to render
Render only current frame: renders only the current frame; (the same result is obtained if you leave the "frames to render" field empty).
Launch animation as in project
launches the animation as set in the project; if the "Enable Override values" option is not selected in the script, Blender is launched with the -a
option; if instead there are changes to the project settings ("Enable Override values" selected) Blender is launched passing the frame interval set with "Frame Start" and "End" of the animation.
frames to render
animation as singles
If there is an animation, e.g. 1-5, the command line does not have the animation -f 1..5
, but the single separate frames: -f 1,2,3,4,5
.
Useful when used together with "new call each render"
new call each render For each frame indicated in the "frames to render" field a blender call is made. For example:
-f 1,3,5..8
-f 1
-f 3
-f 5..8
-f 1
-f 3
-f 5
-f 6
-f 7
-f 8
This can be useful if you need to reload the entire project before each render.
These are commands that you want to run before or after the renders.
Warning: these values will be copied into the script without any syntax checking or anything else.
-P pyfile.py
)With these values the script will launch the renders by modifying the project settings.
Enable Override values Enable override
Output path Like the "Output path" field in the "Output" panel, if empty uses the project setting
Override overwrite + Overwrite With "Override overwrite" selected it allows you to choose whether to overwrite the renders or not
Render Engine Choosing which render engine to use:
Samples rendering quality, "max samples" for Cycles and "samples" for Eevee
% As "Resolution Scale", 0: Use project setting
Scene
Scene to load before launching the render (-S [scene name]
)
Write the script:
[blend file name]_render.sh
Warning: The .bat file for Windows has not been adequately tested.
operator name changed from "rft.writescript" to "render.writescript"
This extension requests the following permission:
Create script to render from terminal