WIP: Single-frame job compiler #104194
@ -97,7 +97,6 @@ function authorRenderTasks(settings, renderDir, renderOutput) {
|
||||
let pythonExpression = `
|
||||
import bpy
|
||||
render = bpy.context.scene.render
|
||||
render.engine = 'CYCLES'
|
||||
render.use_compositing = False
|
||||
bpy.context.scene.cycles.use_denoising = False
|
||||
render.image_settings.file_format = 'OPEN_EXR_MULTILAYER'
|
||||
@ -133,7 +132,6 @@ for layer in bpy.context.scene.view_layers:
|
||||
function authorCreateMergeTask(settings, renderOutput) {
|
||||
const task = author.Task(`merge`, "blender");
|
||||
let pythonExpression = `
|
||||
import os
|
||||
import pathlib
|
||||
import bpy
|
||||
import math
|
||||
@ -143,12 +141,12 @@ def normalize(number):
|
||||
|
||||
basepath = "${renderOutput}/"
|
||||
renders = basepath + "tiles/"
|
||||
filenames = [f for f in os.listdir(renders) if os.path.isfile(renders + f)]
|
||||
filenames = list(pathlib.Path(renders).iterdir())
|
||||
|
||||
if len(filenames) <= 1:
|
||||
print('This job only has one file, merging not required.')
|
||||
print('Moving ' + renders + filenames[0] + ' to ' + basepath + 'MERGED.exr')
|
||||
pathlib.Path(renders + filenames[0]).rename(basepath + 'MERGED.exr')
|
||||
print('Moving ' + renders + filenames[0].name + ' to ' + basepath + 'MERGED.exr')
|
||||
pathlib.Path(renders + filenames[0].name).rename(basepath + 'MERGED.exr')
|
||||
exit()
|
||||
|
||||
row_max = math.ceil(100 / ${settings.tile_size}) - 1
|
||||
@ -187,9 +185,9 @@ def align_tiles(input):
|
||||
|
||||
# Create a list of image nodes
|
||||
image_nodes = []
|
||||
for index, image in enumerate(filenames):
|
||||
bpy.ops.image.open(filepath=renders + image, use_sequence_detection=False)
|
||||
image = bpy.data.images[bpy.path.basename(image)]
|
||||
for index, file in enumerate(filenames):
|
||||
bpy.ops.image.open(filepath=renders + file.name, use_sequence_detection=False)
|
||||
image = bpy.data.images[bpy.path.basename(file.name)]
|
||||
image_nodes.append(bpy.context.scene.node_tree.nodes.new(type='CompositorNodeImage'))
|
||||
image_nodes[index].image = image
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user