Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Setup multi scene rendering
# made in answer to http://blender.stackexchange.com/q/74086/935
import bpy
master_render_scene_name = 'Multi_render'
base_path = '//renders/'
if master_render_scene_name not in bpy.data.scenes:
bpy.data.scenes.new(name=master_render_scene_name)
masterScene = bpy.data.scenes[master_render_scene_name]
masterScene.use_nodes = True
masterNodeTree = masterScene.node_tree
for n in masterNodeTree.nodes:
masterNodeTree.nodes.remove(n)
fileNode = masterNodeTree.nodes.new('CompositorNodeOutputFile')
fileNode.base_path = base_path
fileNode.format.file_format = 'PNG'
fileNode.format.color_mode = 'RGBA'
for s in fileNode.file_slots:
fileNode.file_slots.remove(fileNode.inputs[0])
nspacing = 40
nx = (len(bpy.data.scenes)*nspacing)/2
for scn in bpy.data.scenes:
if scn.name == master_render_scene_name:
continue
sp = scn.render.filepath.replace(base_path,'')
fs = fileNode.file_slots.new(sp)
rl = masterNodeTree.nodes.new('CompositorNodeRLayers')
rl.scene = scn
rl.hide = True
rl.location.x = -300
rl.location.y = nx
nx -= nspacing
masterNodeTree.links.new(rl.outputs['Image'], fs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.