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 9048b23eb6 - Show all commits

View File

@ -142,14 +142,14 @@ import math
def normalize(number):
return round(-0.5 + (number - 0) * (0.5 - -0.5) / 1 - 0, 10)
basepath = "${renderOutput}/"
renders = basepath + "tiles/"
filenames = list(pathlib.Path(renders).iterdir())
basepath = pathlib.Path("${renderOutput}")
renders = basepath / "tiles"
filenames = list(renders.iterdir())
if len(filenames) <= 1:
print('This job only has one file, merging not required.')
print('Moving ' + renders + filenames[0].name + ' to ' + basepath + 'MERGED.exr')
pathlib.Path(renders + filenames[0].name).rename(basepath + 'MERGED.exr')
print('Moving ' + str(renders / filenames[0].name) + ' to ' + str(basepath / 'MERGED.exr'))
(renders / filenames[0].name).rename(basepath / 'MERGED.exr')
exit()
row_max = math.ceil(100 / ${settings.tile_size}) - 1
@ -165,7 +165,7 @@ bpy_render.use_compositing = True
bpy_scene.use_nodes = True
node_tree.nodes.clear()
bpy_render.image_settings.file_format = 'OPEN_EXR_MULTILAYER'
bpy_render.filepath = basepath + "MERGED"
bpy_render.filepath = str(basepath / "MERGED")
denoising = "${settings.use_denoising}" == "true"
tile_size_decimal = ${settings.tile_size} / 100
@ -197,7 +197,7 @@ def align_tiles(input):
# Create a list of image nodes
image_nodes = []
for index, file in enumerate(filenames):
bpy.ops.image.open(filepath=renders + file.name, use_sequence_detection=False)
bpy.ops.image.open(filepath=str(renders / file.name), use_sequence_detection=False)
image = bpy.data.images[bpy.path.basename(file.name)]
image_nodes.append(node_tree.nodes.new(type='CompositorNodeImage'))
image_nodes[index].image = image
@ -260,7 +260,7 @@ bpy.ops.render.render(write_still=True)`;
argsBefore: [],
blendfile: settings.blendfile,
args: [
"--python-exit-code", 1,
"--python-exit-code", 1,
"--python-expr", pythonExpression
]
});
@ -341,7 +341,7 @@ image.save_render(str(basepath / "FINAL") + "${settings.image_file_extension}")`
argsBefore: [],
blendfile: settings.blendfile,
args: [
"--python-exit-code", 1,
"--python-exit-code", 1,
"--python-expr", pythonExpression
]
});