[Bf-blender-cvs] [6b11df31af7] temp-lineart-contained: LineArt: Fix incorrect fov when sensor fit is not Auto.

YimingWu noreply at git.blender.org
Tue Apr 27 05:27:03 CEST 2021


Commit: 6b11df31af782459613d0db6b01c025a3c84bcbd
Author: YimingWu
Date:   Tue Apr 27 11:26:44 2021 +0800
Branches: temp-lineart-contained
https://developer.blender.org/rB6b11df31af782459613d0db6b01c025a3c84bcbd

LineArt: Fix incorrect fov when sensor fit is not Auto.

===================================================================

M	source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c

===================================================================

diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
index 0a27ec41153..73a79093d20 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
@@ -1914,8 +1914,23 @@ static void lineart_main_load_geometries(
   }
 
   if (cam->type == CAM_PERSP) {
-    if (asp < 1) {
-      fov /= asp;
+    if (cam->sensor_fit == CAMERA_SENSOR_FIT_AUTO) {
+      if (asp < 1) {
+        fov /= asp;
+      }
+      else {
+        fov *= asp;
+      }
+    }
+    else if (cam->sensor_fit == CAMERA_SENSOR_FIT_HOR) {
+      if (asp < 1) {
+        fov /= asp;
+      }
+    }
+    else if (cam->sensor_fit == CAMERA_SENSOR_FIT_VERT) {
+      if (asp > 1) {
+        fov *= asp;
+      }
     }
     lineart_matrix_perspective_44d(proj, fov, asp, cam->clip_start, cam->clip_end);
   }



More information about the Bf-blender-cvs mailing list