cam = bpy.context.active_object
c1 = cam.constraints.new("TRACK_TO")
# set these to something that is right for a camera
c1.track_axis = "TRACK_NEGATIVE_Z"
c1.up_axis = "UP_Y"
#what shall the camera point at?
c1.target = bpy.data.objects['Cube']
|
Blender python API quick-start
Syntax highlighting by Pygments.