-
Notifications
You must be signed in to change notification settings - Fork 482
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Describe your feature request
I have the specifications of a camera (sensor size in mm, focal distance, field of view etc…) and I would like to create a virtual camera that would mirror those parameters. However it does not seem possible to update the sensor size using the camera api. As a result, even if the field of view is correct, the parameters of the focal length no longer match the one of the original camera.
Describe a possible solution
A simple solution would be to add a function like:
def set_sensor_size(cam: bpy.types.Camera, sensor_width_in_mm: float = None, sensor_height_in_mm: float = None):
""" Update the sensor size of the camera.
:param cam: The camera object.
:param sensor_width_in_mm: width of the sensor in mm.
:param sensor_height_in_mm: height of the sensor in mm.
"""
if sensor_width_in_mm is not None:
cam.sensor_width = sensor_width_in_mm
if sensor_height_in_mm is not None:
cam.sensor_height = sensor_height_in_mm
and call this function at the beginning of set_intrinsics_from_K_matrix and set_intrinsics_from_blender_params (and maybe set_resolution?)
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request