Closed regcs closed 3 years ago
Note for later:
The user reporting the issue has mentioned that the render operator must be called in blocking mode. There are actually two operators that are called in the add-on:
bpy.ops.render.render
operator.~An approach to solve the problem might, thus, be connected to the following approaches:~
~1. Set the attribute 'BLOCKING' for our own operator.~
~2. Internally call bpy.ops.render.render()
instead of bpy.ops.render.render("INVOKE_DEFAULT")
because the latter is running the operator in modal mode.~ Edit: The BLOCKING
property is only for blocking the UI from being used and the second approach would not make the rest of the operator blocking. So forget about that.
Since we need a non-blocking operation for normal usage of the add-on, the best approach would be to create a second blocking operator, which can be called from scripts by users who want to render on a render farm.
This would be fixed with multi-view rendering, which we're currently implementing as an option, though we'll need to test to ensure that's the case.
We can also attempt to fix this for single-view rendering.
After talking to another render farm user, I am getting the impression that this can be solved by implementing the above mentioned second operator and instead of processing everything in a modal loop, just use a normal loop within the operators invoke()
call. This operator would be blocking and can be called from command line.
I did some research on render farms today and it seems every render farm works a bit different. That means, the only thing we can do on the add-on side is to provide a mechanism that enables render farms to add support for Alice/LG. There are three things I will implement:
render.quilt()
operator that can be called from python scripts to start the quilt rendering process in a blocking manner.--alicelg-render
and --alicelg-render-anim
that Alice/LG will check for on start up. If Blender is called with these arguments, Alice/LG will automatically call the render.quilt(blocking=True)
to start the render process. Save .blend file for render farm
, that will use the blenderLKG mechanism and add a multiview camera system bound to the main camera that moves with the active camera each frame. That would not require any modification by render farms, as long as these do support multiview rendering. However, it will not automatically generate a quilt.~ Edit: Decided to postpone this to later versions.408e74d3245a27694a8a5c04375cec1f319eb306 adds command-line arguments -alicelg-render
and -alicelg-render-anim
, which start a quilt rendering or quilt animation rendering when calling Blender in background mode from the command line. These can be called by render farms. Either of the both arguments must be called after all Blender arguments, i.e. following a --
. For example:
blender -b BLENDFILE_PATH -- -alicelg-render
This will start Blender, open the BLENDFILE_PATH, and will use the settings saved in this .blend
file to render a quilt. Still need to implement a bit of refinement (e.g., What if the user / renderfarm also passes an output path for the file?)
Edit: Using Blenders -o
/ --render-output
now works to specify the output path of the quilt. If specified, the "Add Metadata" option is automatically disabled (456f4f8757).
Added further command line arguments with 97b23841ae291c56cb9932238bdb56b1d55399b6. The add-on now understands the following arguments, which are already known from Blender command line:
-o
or --render-output
<path>
: Set the render path and file name. Automatically disables the "Add Metadata" option.-s
or --frame-start
<frame>
: Set start to frame <frame>
, supports +/- for relative frames too.-e
or --frame-end
<frame>
: Set end to frame <frame>
, supports +/- for relative frames too.-j
or --frame-jump
<frame>
: Set number of frames to step forward after each rendered frame-f
or --render-frame
: Specify a single frame to renderHowever, it is important that these arguments are specified after the mandatory --
to notify Alice/LG that the arguments are meant for the add-on. An example call, which would start Blender in background mode, load the BLENDFILE_PATH, and render a quilt animation from frame 10 to 24 with the base file name quilt_anim
would look like this:
blender -b BLENDFILE_PATH -- -alicelg-render-anim -o /tmp/quilt_anim.png -s 10 -e 24
Another example, which would only render the frame 16 as a single quilt, would like this:
blender -b BLENDFILE_PATH -- -alicelg-render -o /tmp/quilt.png -f 16
Currently, rendering quilts on a render farm seems not to work. We need to look into that.