Distributed rendering of single images #104327

Merged
David Zhang merged 22 commits from David-Zhang-10/flamenco:single-image-render into main 2024-09-03 06:47:49 +02:00
Showing only changes of commit 7f79e74371 - Show all commits

View File

@ -200,22 +200,21 @@ for link in node_tree.links:
feed_in_output = link.to_socket
break
from os import listdir
from os.path import isfile, join
from pathlib import Path
root = "${path.join(renderDir, path.basename(renderOutput))}/######"
image_files = [f for f in listdir(root) if isfile(join(root, f))]
root = Path("${path.join(renderDir, path.basename(renderOutput))}/######")
image_files = [f for f in root.iterdir() if f.is_file()]
separate_nodes = []
first_crop_node = None
translate_nodes = []
for i, image_file in enumerate(image_files):
image_node = node_tree.nodes.new('CompositorNodeImage')
image_node.image = bpy.data.images.load(root + '/' + image_file)
image_node.image = bpy.data.images.load(str(root / image_file.name))
crop_node = node_tree.nodes.new('CompositorNodeCrop')
crop_node.use_crop_size = True
left, top, right, bottom = image_file.split('-')
left, top, right, bottom = image_file.stem.split('-')
if left == '0':
crop_node.min_x = 0
crop_node.max_x = ${settings.tile_size_x}