WIP: Initial version of a single-frame job compiler #104189

Closed
k8ie wants to merge 26 commits from k8ie/flamenco:single-frame into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Showing only changes of commit b159598500 - Show all commits

View File

@ -23,7 +23,7 @@ const JOB_TYPE = {
// Automatically evaluated settings:
{ key: "blendfile", type: "string", required: true, description: "Path of the Blend file to render", visible: "web" },
{ key: "samples", type: "string", required: true, eval: "f'0-{C.scene.cycles.samples}'", visible: "web",
{ key: "samples", type: "string", required: true, eval: "f'1-{C.scene.cycles.samples}'", visible: "web",
description: "Total number of samples in the job" },
]
};
@ -82,7 +82,18 @@ function authorRenderTasks(settings, renderDir, renderOutput) {
let chunks = frameChunker(settings.samples, settings.chunk_size);
for (let chunk of chunks) {
const task = author.Task(`render-${chunk}`, "blender");
let chunk_size = chunk.split("-", 2)[1] - chunk.split("-", 2)[0]
let chunk_arr = chunk.split("-", 2)
let chunk_end
let chunk_start
if (chunk_arr.length < 2) {
chunk_end = chunk_arr[0]
chunk_start = chunk_arr[0] - 1
}
else {
chunk_end = chunk_arr[1]
chunk_start = chunk_arr[0] - 1
}
let chunk_size = chunk_end - chunk_start
let pythonExpression = `
import bpy
bpy.context.scene.render.engine = 'CYCLES'
@ -90,7 +101,7 @@ bpy.context.scene.render.use_compositing = False
bpy.context.scene.cycles.use_denoising = False
bpy.context.scene.render.image_settings.file_format = 'OPEN_EXR_MULTILAYER'
bpy.context.scene.cycles.samples = ${chunk_size}
bpy.context.scene.cycles.sample_offset = ${chunk.split("-", 1)}`;
bpy.context.scene.cycles.sample_offset = ${chunk_start}`;
if (settings.denoising) {
pythonExpression += `
for layer in bpy.context.scene.view_layers: