Distributed rendering of single images #104327
@ -149,7 +149,8 @@ function authorRenderTasks(settings, renderDir, renderOutput) {
|
|||||||
const task = author.Task(`render-${border[0]}-${border[1]}`, "blender");
|
const task = author.Task(`render-${border[0]}-${border[1]}`, "blender");
|
||||||
let pythonExpr = `import bpy
|
let pythonExpr = `import bpy
|
||||||
|
|
||||||
render = bpy.context.scene.render
|
scene = bpy.context.scene
|
||||||
|
render = scene.render
|
||||||
render.image_settings.file_format = 'OPEN_EXR_MULTILAYER'
|
render.image_settings.file_format = 'OPEN_EXR_MULTILAYER'
|
||||||
render.use_compositing = False
|
render.use_compositing = False
|
||||||
overscan = 16
|
overscan = 16
|
||||||
@ -184,6 +185,8 @@ function authorMergeTask(settings, renderDir, renderOutput) {
|
|||||||
let pythonExpr = `import bpy
|
let pythonExpr = `import bpy
|
||||||
|
|
||||||
render = bpy.context.scene.render
|
render = bpy.context.scene.render
|
||||||
|
render.resolution_x = ${settings.resolution_x}
|
||||||
|
render.resolution_y = ${settings.resolution_y}
|
||||||
bpy.context.scene.use_nodes = True
|
bpy.context.scene.use_nodes = True
|
||||||
render.use_compositing = True
|
render.use_compositing = True
|
||||||
node_tree = bpy.context.scene.node_tree
|
node_tree = bpy.context.scene.node_tree
|
||||||
@ -281,9 +284,9 @@ set_alpha_node.mode = 'REPLACE_ALPHA'
|
|||||||
node_tree.links.new(mix_adds[-1].outputs[0], set_alpha_node.inputs[0])
|
node_tree.links.new(mix_adds[-1].outputs[0], set_alpha_node.inputs[0])
|
||||||
node_tree.links.new(math_adds[-1].outputs[0], set_alpha_node.inputs[1])
|
node_tree.links.new(math_adds[-1].outputs[0], set_alpha_node.inputs[1])
|
||||||
if feed_in_input is not None:
|
if feed_in_input is not None:
|
||||||
node_tree.links.new(set_alpha_node.outputs[0], feed_in_output)
|
node_tree.links.new(set_alpha_node.outputs[0], feed_in_output)
|
||||||
else:
|
else:
|
||||||
raise Exception('No Render Layers Node found. Currently only supported with a Render Layers Node in the Compositor.')
|
raise Exception('No Render Layers Node found. Currently only supported with a Render Layers Node in the Compositor.')
|
||||||
|
|
||||||
node_tree.nodes.remove(render_layers_node)
|
node_tree.nodes.remove(render_layers_node)
|
||||||
bpy.ops.render.render(write_still=True)`
|
bpy.ops.render.render(write_still=True)`
|
||||||
|
Loading…
Reference in New Issue
Block a user