I'm trying to add a new camera to the scene and render it using multiview (with python script). at first, I remove all the objects besides the light from the scene:
bpy.ops.object.select_by_type(type='MESH')
bpy.ops.object.delete()
bpy.ops.object.select_by_type(type='CAMERA')
bpy.ops.object.delete()
But I saw that it didn't erease the camera from bpy.data.cameras
which will give me a problem later on.
After that, two cameras were added with init location and rotation:
bpy.ops.object.camera_add(location = [9.69,-10.85,12.388], rotation = [0.6799,0,0.8254],enter_editmode=True)
bpy.data.cameras[0].lens = 18
bpy.ops.object.camera_add(location = [9.69,10.85,12.388], rotation = [radians(40.6),radians(-5.5),radians(140)],enter_editmode=True)
bpy.data.cameras[1].lens = 18
The cameras are perfectly set in terms of location and rotation but not for the focal lens for some reason.
What is the right way to insert a new camera?
and another quick question - in order to be able to render the scene in multiview are the following lines are all is needed?
bpy.data.scenes[0].render.use_multiview = True
bpy.data.scenes[0].render.views_format = 'MULTIVIEW'
BR, Aviv