I am trying to animate the focal length of the camera, based on focal length information imported from a file. setting the focal length is no problem:
focal_length = 35 timeline_frame = 10 cam = bpy.data.cameras.new('Camera') cam.lens = focal_length
after setting this value I want to insert a keyframe for the focal length. According to my intuition, I am looking for something like this:
cam.keyframe_insert(data_path = 'lens', frame = (timeline_frame))
(this code deosn´t work...) is there any way to get this to work?