I'm searching for a simple script to move a camera in Blender 2.61 with Python. I thought this would be an easy task, but the Camera object has no properties like loc or something similar.
I only found scripts online for Blender 2.49 but they don't work anymore because of the immense API changes with Blender 2.5.
I would appreciate any hints.
A friendly user on reddit pointed me to one correct solution: The trick is to retrieve the camera as an
Object
, not as aCamera
. With this way, you can set the location via the standard way and set keyframes.If you want to set
Camera
specific objects, you have to retrieve it viabpy.data.cameras
.Perhaps the camera rigs at the bottom of this page could be a nice starting point.
furtelwart's answer was quite usefull. I did some more digging so you can also set some other very usefull properties regarding the camera and render.
I'm using this script to make batch rendering. You can check it out here: http://code.google.com/p/encuadro/source/browse/renders/marker/model/marker_a4.py
It will be improved later to take command line arguments. I'm new to python and blender so this may be kind of amateur but it works.