import bpy bpy.context.object.data.sensor_width = 5.76 bpy.context.object.data.sensor_height = 4.29 bpy.context.object.data.sensor_fit = 'HORIZONTAL'