I am importing a VRML file using Blender command line. I need to change the focal length of the camera using the command line.
How can I do that? I cannot find Python api for this.
Thanks.
Blender Stack Exchange is a question and answer site for people who use Blender to create 3D graphics, animations, or games. It only takes a minute to sign up.
Sign up to join this communityI am importing a VRML file using Blender command line. I need to change the focal length of the camera using the command line.
How can I do that? I cannot find Python api for this.
Thanks.
It's in bpy.data.cameras['
name of your camera object
'].lens
, or camera.angle
(thanks @ideasman42).
Note that you must have a camera in the scene.
Ok, I think I got it ..
We can get the focal length by using bpy.data.cameras.values()[0].lens
. We can set this value as well.
bpy.data.cameras.values()[0].lens
is better written as bpy.data.cameras[0].lens
$\endgroup$
– ideasman42
Aug 5 '14 at 22:37