WIP: Single-frame job compiler #104194
@ -274,7 +274,7 @@ function authorCreateCompositeTask(settings, renderOutput) {
|
||||
import pathlib
|
||||
import bpy
|
||||
C = bpy.context
|
||||
basepath = "${renderOutput}/"
|
||||
basepath = pathlib.Path("${renderOutput}")
|
||||
filename = "MERGED.exr"
|
||||
`;
|
||||
if (settings.use_compositing) {
|
||||
@ -282,7 +282,7 @@ filename = "MERGED.exr"
|
||||
// uses snippets from
|
||||
// https://github.com/state-of-the-art/BlendNet/blob/master/BlendNet/script-compose.py#L94
|
||||
pythonExpression += `
|
||||
bpy.ops.image.open(filepath=basepath + filename, use_sequence_detection=False)
|
||||
bpy.ops.image.open(filepath=str(basepath / filename), use_sequence_detection=False)
|
||||
image = bpy.data.images[bpy.path.basename(filename)]
|
||||
image_node = C.scene.node_tree.nodes.new(type='CompositorNodeImage')
|
||||
image_node.image = image
|
||||
@ -317,21 +317,21 @@ print("Removing the nodes could potentially break the pipeline")
|
||||
for node in nodes_to_remove:
|
||||
print('INFO: Removing %s' % (node,))
|
||||
C.scene.node_tree.nodes.remove(node)
|
||||
C.scene.render.filepath = basepath + "FINAL"
|
||||
C.scene.render.filepath = str(basepath / "FINAL")
|
||||
bpy.ops.render.render(write_still=True)`;
|
||||
}
|
||||
else {
|
||||
if (settings.format == "OPEN_EXR_MULTILAYER") {
|
||||
// Only rename
|
||||
pythonExpression += `
|
||||
pathlib.Path(basepath + filename).rename(basepath + 'FINAL.exr')`;
|
||||
(basepath / filename).rename(basepath / 'FINAL.exr')`;
|
||||
}
|
||||
else {
|
||||
// Only export
|
||||
pythonExpression += `
|
||||
bpy.ops.image.open(filepath=basepath + filename, use_sequence_detection=False)
|
||||
bpy.ops.image.open(filepath=str(basepath / filename), use_sequence_detection=False)
|
||||
image = bpy.data.images[bpy.path.basename(filename)]
|
||||
image.save_render(basepath + "FINAL" + "${settings.image_file_extension}")`;
|
||||
image.save_render(str(basepath / "FINAL") + "${settings.image_file_extension}")`;
|
||||
}
|
||||
}
|
||||
const task = author.Task(`composite`, "blender");
|
||||
|
Loading…
Reference in New Issue
Block a user