[Bf-blender-cvs] [4ddff574d7b] master: Fix T87832: Incorrect FOV in line art when sensor fit is not Auto.
YimingWu
noreply at git.blender.org
Tue Apr 27 16:34:34 CEST 2021
Commit: 4ddff574d7b1534e43deb22b09d0cdb8a7393896
Author: YimingWu
Date: Tue Apr 27 11:26:44 2021 +0800
Branches: master
https://developer.blender.org/rB4ddff574d7b1534e43deb22b09d0cdb8a7393896
Fix T87832: Incorrect FOV in line art when sensor fit is not Auto.
Reviewed by Sebastian Parborg
https://developer.blender.org/D11095
===================================================================
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 3778e60d813..9c4e428f58a 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
@@ -1817,8 +1817,23 @@ static void lineart_main_load_geometries(
double asp = ((double)rb->w / (double)rb->h);
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