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 56a91bb7a2 - Show all commits

View File

@ -6,10 +6,9 @@ const JOB_TYPE = {
// Settings for artists to determine:
{ key: "frame", type: "int32", required: true, eval: "C.scene.frame_current",
description: "Frame to render"},
{ key: "tile_size", type: "int32", default: 5, propargs: {min: 1, max: 100}, description: "Tile size for each Task (sizes are in % of the full image)",
{ key: "tile_size", type: "int32", default: 5, propargs: {min: 1, max: 100}, description: "Tile size for each Task (sizes are in % of each dimension)",
visible: "submission" },
// render_output_root + add_path_components determine the value of render_output_path.
k8ie marked this conversation as resolved Outdated

I think this can be moved into the hidden settings, with expr: "bpy.context.scene.cycles.use_denoising". That way the denoising is managed via the normal setting, and not yet again by Flamenco.

I think this can be moved into the hidden settings, with `expr: "bpy.context.scene.cycles.use_denoising"`. That way the denoising is managed via the normal setting, and not yet again by Flamenco.
{ key: "render_output_root", type: "string", subtype: "dir_path", required: true, visible: "submission",
description: "Base directory of where render output is stored. Will have some job-specific parts appended to it"},
@ -27,8 +26,9 @@ const JOB_TYPE = {
description: "Toggles OpenImageDenoise" },
{ key: "image_file_extension", type: "string", required: true, eval: "C.scene.render.file_extension", visible: "hidden",
k8ie marked this conversation as resolved Outdated

The properties are typically named as 'imperative' ("do X", "use Y") and not 'descriptive' ("does X", "uses Y"). So this could be use_compositing.

The properties are typically named as 'imperative' ("do X", "use Y") and not 'descriptive' ("does X", "uses Y"). So this could be `use_compositing`.
Outdated
Review

Should I change denoising to be use_denoising or use_compositing to be just compositing? Just to keep things consistent.

Should I change `denoising` to be `use_denoising` or `use_compositing` to be just `compositing`? Just to keep things consistent.

Use use_denoising and use_compositing.

Use `use_denoising` and `use_compositing`.
description: "File extension used for the final export" },
{ key: "samples", type: "string", required: true, eval: "f'1-{C.scene.cycles.samples}'", visible: "web",
description: "Total number of samples in the job" },
{ key: "resolution_x", type: "int32", required: true, eval: "C.scene.render.resolution_x", visible: "hidden"},
{ key: "resolution_y", type: "int32", required: true, eval: "C.scene.render.resolution_y", visible: "hidden"},
{ key: "resolution_percentage", type: "int32", required: true, eval: "C.scene.render.resolution_percentage", visible: "hidden"}
]
};
@ -90,8 +90,8 @@ function tileChunker(tile_size) {
let tiles = [];
const rows = Math.floor(100 / tile_size);
const columns = Math.floor(100 / tile_size);
for (let row = 1; row <= rows; row++) {
for (let column = 1; column <= columns; column++) {
for (let row = 0; row < rows; row++) {
for (let column = 0; column < columns; column++) {
tiles.push({"row": row, "column": column});
}
}
@ -157,8 +157,16 @@ if len(filenames) <= 1:
pathlib.Path(renders + filenames[0]).rename(basepath + 'MERGED.exr')
exit()
image_nodes = []
bpy.context.scene.render.resolution_x = ${settings.resolution_x}
bpy.context.scene.render.resolution_y = ${settings.resolution_y}
bpy.context.scene.render.resolution_percentage = ${settings.resolution_percentage}
bpy.context.scene.render.use_compositing = True
bpy.context.scene.use_nodes = True
bpy.context.scene.view_layers[0].use = False
bpy.context.scene.render.image_settings.file_format = 'OPEN_EXR_MULTILAYER'
bpy.context.scene.render.filepath = basepath + "MERGED"
image_nodes = []
for index, image in enumerate(filenames):
bpy.ops.image.open(filepath=renders + image, use_sequence_detection=False)
image = bpy.data.images[bpy.path.basename(image)]
@ -166,7 +174,6 @@ for index, image in enumerate(filenames):
image_nodes[index].image = image
alpha_over_nodes = []
for index, node in enumerate(image_nodes):
if index == 0:
# Take the first two image nodes and combine them
@ -182,7 +189,7 @@ for index, node in enumerate(image_nodes):
# Link the last image node and feed the output into the composite node
bpy.context.scene.node_tree.links.new(alpha_over_nodes[index].outputs['Image'], bpy.context.scene.node_tree.nodes['Composite'].inputs['Image'])
break
`;
bpy.ops.render.render(write_still=True)`;
const command = author.Command("blender-render", {
exe: "{blender}",
exeArgs: "{blenderArgs}",