I wrote a script to generate a multiview render of an animation. You can see the result here
Still everything is rendered at the resolution of the final image and then scaled down. This wastes a lot of time. I want to render the input render layers at their original resolution and then compose them in the larger image that is the composite layer output. But it appears that the resolution of the final channel large image defines the resolution of all the renderings. Setting the original render layers resolution does not seem to change anything.
So the composite node has a resolution Nbase_x X Mbase_y and the NXM components have resolution base_x X base_y. All these quantities are fixed for the all animation. When rendering I see that also the original images are scaled and fit to Nbase_x X Mbase_y.
Does anybody have any suggestion?
It would save a lot of time to render the component at the actual resolution.
Here is the code
bpy.ops.scene.new(type='NEW')
sizescene=bpy.context.screen.scene
sizescene.render.resolution_y = len(anglelist_y)*resy
sizescene.render.resolution_x = N_PERSP_x*resx
sizescene.render.resolution_percentage=100
bpy.context.scene.use_nodes = True
tree = bpy.context.scene.node_tree
# clear default nodes
for node in tree.nodes:
print(node,node.name)
tree.nodes.remove(node)
new_render_layer_node = tree.nodes.new(type = 'CompositorNodeRLayers')
new_render_layer_node.location.x=-200
new_render_layer_node.scene=sizescene
new_render_layer_node.layer=sizescene.render.layers.active.name
bpy.ops.object.camera_add(view_align=False,
location=[0, 0, 0],
rotation=[(pi/2), 0, (2*pi)])
last_node=new_render_layer_node
for i in range(len(anglelist_y)):
blender_angle_y = -anglelist_y[i] + (pi/2)
z = RADIUS*math.cos(blender_angle_y)
zz= RADIUS*math.sin(blender_angle_y)
for j in range(N_PERSP_x):
bpy.context.screen.scene=basescene
# print('A bpy.context.screen.scene',bpy.context.screen.scene)
bpy.ops.scene.new(type='LINK_OBJECTS')
#
newscene=bpy.context.screen.scene
bpy.context.screen.scene.name='scene_h_'+ str(i)+'_w_'+str(j)
new_render_layer = newscene.render.layers.new('rl_h_'+ str(i)+'_w_'+str(j))
newscene.render.layers.active = new_render_layer
bpy.context.screen.scene.render.layers.active=new_render_layer
new_render_layer_node = tree.nodes.new(type = 'CompositorNodeRLayers')
new_render_layer_node.scene=newscene
new_render_layer_node.layer=new_render_layer.name
new_render_layer_node.location.x = 200*i
new_render_layer_node.location.y = 400*j
new_render_layer_node.name='rl_h_'+ str(i)+'_w_'+str(j)
new_scale_node = tree.nodes.new(type = 'CompositorNodeScale')
new_scale_node.inputs[1].default_value=1.0/N_PERSP_x
new_scale_node.inputs[2].default_value=1.0/len(anglelist_y)
links = tree.links
link = links.new(new_render_layer_node.outputs[0], new_scale_node.inputs[0])
new_scale_node.hide=True
new_scale_node.location.x = 1000+200*i
new_scale_node.location.y = 400*j
new_transf_node = tree.nodes.new(type = 'CompositorNodeTranslate')
link = links.new(new_scale_node.outputs[0], new_transf_node.inputs[0])
new_transf_node.inputs[1].default_value=resx*(j-(N_PERSP_x-1)/2.0)#/N_PERSP_x
new_transf_node.inputs[2].default_value=resy*(i-(len(anglelist_y)-1)/2.0)#/(len(anglelist_y))
new_transf_node.hide=True
new_transf_node.location.x = 1000+200*i+100
new_transf_node.location.y = 400*j
if last_node is None:
last_node=new_transf_node
else:
alphanode=tree.nodes.new(type = 'CompositorNodeAlphaOver')
link = links.new(new_transf_node.outputs[0], alphanode.inputs[2])
link = links.new(last_node.outputs[0], alphanode.inputs[1])
alphanode.location.x = 2000+200*i
alphanode.location.y = 200*j
last_node=alphanode
ps: Would baking be of any help with an high number of cameras?