WIP: Single-frame job compiler #104194

Draft
k8ie wants to merge 30 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 a935c05d6d - Show all commits

View File

@ -7,7 +7,7 @@ const JOB_TYPE = {
{ 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 each dimension)" },
// render_output_root + add_path_components determine the value of render_output_path.
{ 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" },
@ -274,7 +274,7 @@ function authorCreateCompositeTask(settings, renderOutput) {
import pathlib
import bpy
C = bpy.context
basepath = "${renderOutput}/"
basepath = pathlib.Path("${renderOutput}")
filename = "MERGED.exr"
`;
if (settings.use_compositing) {
@ -282,7 +282,7 @@ filename = "MERGED.exr"
// uses snippets from
// https://github.com/state-of-the-art/BlendNet/blob/master/BlendNet/script-compose.py#L94
pythonExpression += `
bpy.ops.image.open(filepath=basepath + filename, use_sequence_detection=False)
bpy.ops.image.open(filepath=str(basepath / filename), use_sequence_detection=False)
image = bpy.data.images[bpy.path.basename(filename)]
image_node = C.scene.node_tree.nodes.new(type='CompositorNodeImage')
image_node.image = image
@ -317,21 +317,21 @@ print("Removing the nodes could potentially break the pipeline")
for node in nodes_to_remove:
print('INFO: Removing %s' % (node,))
C.scene.node_tree.nodes.remove(node)
C.scene.render.filepath = basepath + "FINAL"
C.scene.render.filepath = str(basepath / "FINAL")
bpy.ops.render.render(write_still=True)`;
}
else {
if (settings.format == "OPEN_EXR_MULTILAYER") {
// Only rename
pythonExpression += `
pathlib.Path(basepath + filename).rename(basepath + 'FINAL.exr')`;
(basepath / filename).rename(basepath / 'FINAL.exr')`;
}
else {
// Only export
pythonExpression += `
bpy.ops.image.open(filepath=basepath + filename, use_sequence_detection=False)
bpy.ops.image.open(filepath=str(basepath / filename), use_sequence_detection=False)
image = bpy.data.images[bpy.path.basename(filename)]
image.save_render(basepath + "FINAL" + "${settings.image_file_extension}")`;
image.save_render(str(basepath / "FINAL") + "${settings.image_file_extension}")`;
}
}
const task = author.Task(`composite`, "blender");