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 feed_in_output = link.to_socket
break break
from os import listdir from pathlib import Path
from os.path import isfile, join
root = "${path.join(renderDir, path.basename(renderOutput))}/######" root = Path("${path.join(renderDir, path.basename(renderOutput))}/######")
image_files = [f for f in listdir(root) if isfile(join(root, f))] image_files = [f for f in root.iterdir() if f.is_file()]
separate_nodes = [] separate_nodes = []
first_crop_node = None first_crop_node = None
translate_nodes = [] translate_nodes = []
for i, image_file in enumerate(image_files): for i, image_file in enumerate(image_files):
image_node = node_tree.nodes.new('CompositorNodeImage') 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 = node_tree.nodes.new('CompositorNodeCrop')
crop_node.use_crop_size = True crop_node.use_crop_size = True
left, top, right, bottom = image_file.split('-') left, top, right, bottom = image_file.stem.split('-')
if left == '0': if left == '0':
crop_node.min_x = 0 crop_node.min_x = 0
crop_node.max_x = ${settings.tile_size_x} crop_node.max_x = ${settings.tile_size_x}