I’m writing a script where I need to copy camera settings from one camera to another. I’m able to copy things like this:
left_cam.angle = center_cam.data.angle
left_cam.clip_start = center_cam.data.clip_start
left_cam.clip_end = center_cam.data.clip_end
left_cam.dof_distance = center_cam.data.dof_distance
left_cam.dof_object = center_cam.data.dof_object
left_cam.shift_y = center_cam.data.shift_y
left_cam.shift_x = (camera.stereo_camera_shift_x/2)+center_cam.data.shift_x
left_cam_obj.location = -(camera.stereo_camera_separation/1000)/2,0,0
left_cam_obj.rotation_euler = (0.0,0.0,0.0) # reset
left_cam_obj.data.cycles.aperture_blades = bpy.data.objects["Camera"].data.cycles.aperture_blades
left_cam_obj.data.cycles.aperture_size = bpy.data.objects["Camera"].data.cycles.aperture_size
left_cam_obj.data.cycles.aperture_rotation = bpy.data.objects["Camera"].data.cycles.aperture_rotation
left_cam_obj.data.cycles.aperture_type = bpy.data.objects["Camera"].data.cycles.aperture_type
left_cam_obj.data.cycles.aperture_ratio = bpy.data.objects["Camera"].data.cycles.aperture_ratio
However, if I create keyframes for aperature_size, this code does not copy keyframes from one camera to another. It only copies the current value at the current frame.
How can I make a copy of the keyframes from one camera to another?