Fix #105088: FBX Camera Focus Distance is interpreted as millimeters #105124

Merged
Thomas Barlow merged 4 commits from Mysteryem/blender-addons:fix_105088_fbx_camera_focus_distance_mm into main 2024-01-16 21:48:22 +01:00
2 changed files with 2 additions and 2 deletions
Showing only changes of commit 6d8622ecd0 - Show all commits

View File

@ -686,7 +686,7 @@ def fbx_data_camera_elements(root, cam_obj, scene_data):
elem_props_template_set(tmpl, props, "p_double", b"SafeAreaAspectRatio", aspect)
# Depth of field and Focus distance.
elem_props_template_set(tmpl, props, "p_bool", b"UseDepthOfField", cam_data.dof.use_dof)
elem_props_template_set(tmpl, props, "p_double", b"FocusDistance", cam_data.dof.focus_distance * 1000 * gscale)
elem_props_template_set(tmpl, props, "p_double", b"FocusDistance", cam_data.dof.focus_distance * gscale)
# Default to perspective camera.
elem_props_template_set(tmpl, props, "p_enum", b"CameraProjectionType", 1 if cam_data.type == 'ORTHO' else 0)
elem_props_template_set(tmpl, props, "p_double", b"OrthoZoom", cam_data.ortho_scale)

View File

@ -2169,7 +2169,7 @@ def blen_read_camera(fbx_tmpl, fbx_obj, settings):
camera.type = 'ORTHO' if elem_props_get_enum(fbx_props, b'CameraProjectionType', 0) == 1 else 'PERSP'
camera.dof.focus_distance = elem_props_get_number(fbx_props, b'FocusDistance', 10 * 1000) / 1000 * global_scale
camera.dof.focus_distance = elem_props_get_number(fbx_props, b'FocusDistance', 10) * global_scale
if (elem_props_get_bool(fbx_props, b'UseDepthOfField', False)):
camera.dof.use_dof = True