Distributed rendering of single images #104327
@ -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}
|
||||||
|
Loading…
Reference in New Issue
Block a user