WIP: Single-frame job compiler #104194
@ -102,12 +102,12 @@ bpy.context.scene.cycles.use_denoising = False
|
||||
render.image_settings.file_format = 'OPEN_EXR_MULTILAYER'
|
||||
render.use_crop_to_border = True
|
||||
|
||||
tile_size_normalized = ${settings.tile_size} / 100
|
||||
tile_size_decimal = ${settings.tile_size} / 100
|
||||
|
||||
render.border_min_x = ${tile.column} * tile_size_normalized
|
||||
render.border_max_x = tile_size_normalized + ${tile.column} * tile_size_normalized
|
||||
render.border_min_y = ${tile.row} * tile_size_normalized
|
||||
render.border_max_y = tile_size_normalized + ${tile.row} * tile_size_normalized`;
|
||||
render.border_min_x = ${tile.column} * tile_size_decimal
|
||||
render.border_max_x = tile_size_decimal + ${tile.column} * tile_size_decimal
|
||||
render.border_min_y = ${tile.row} * tile_size_decimal
|
||||
render.border_max_y = tile_size_decimal + ${tile.row} * tile_size_decimal`;
|
||||
if (settings.use_denoising) {
|
||||
pythonExpression += `
|
||||
for layer in bpy.context.scene.view_layers:
|
||||
@ -168,17 +168,21 @@ bpy_render.image_settings.file_format = 'OPEN_EXR_MULTILAYER'
|
||||
bpy_render.filepath = basepath + "MERGED"
|
||||
denoising = "${settings.use_denoising}" == "true"
|
||||
|
||||
tile_size_decimal = ${settings.tile_size} / 100
|
||||
|
||||
# Takes the column and row number and creates a translate node with the right coordinates to align a tile
|
||||
def create_translate(dimensions):
|
||||
translate_node = node_tree.nodes.new(type='CompositorNodeTranslate')
|
||||
translate_node.use_relative = True
|
||||
for dimension in dimensions:
|
||||
if dimensions[dimension] == 0:
|
||||
translate_node.inputs[dimension].default_value = normalize(${settings.tile_size} / 100 / 2)
|
||||
elif dimensions[dimension] == row_max and 100 % ${settings.tile_size} != 0:
|
||||
translate_node.inputs[dimension].default_value = normalize((${settings.tile_size} / 100 + (dimensions[dimension] - 1) * ${settings.tile_size} / 100) + ((100 % ${settings.tile_size}) / 100) / 2)
|
||||
translate_node.inputs[dimension].default_value = normalize(tile_size_decimal / 2)
|
||||
else:
|
||||
translate_node.inputs[dimension].default_value = normalize((${settings.tile_size} / 100 + (dimensions[dimension] - 1) * ${settings.tile_size} / 100) + (${settings.tile_size} / 100) / 2)
|
||||
if dimensions[dimension] == row_max and 100 % ${settings.tile_size} != 0:
|
||||
half_this_tile = ((100 % ${settings.tile_size}) / 100) / 2
|
||||
else:
|
||||
half_this_tile = (tile_size_decimal) / 2
|
||||
translate_node.inputs[dimension].default_value = normalize((tile_size_decimal + (dimensions[dimension] - 1) * tile_size_decimal) + half_this_tile)
|
||||
return translate_node
|
||||
|
||||
def align_tiles(input):
|
||||
|
Loading…
Reference in New Issue
Block a user