WIP: Single-frame job compiler #104194
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user