[Bf-blender-cvs] [9d3d9019abd] blender-v3.3-release: Fix T101824: Line art flickers when light object has scaling.

YimingWu noreply at git.blender.org
Thu Jan 12 14:07:18 CET 2023


Commit: 9d3d9019abd2f9c8843ceb369f13240dad514cfe
Author: YimingWu
Date:   Thu Jan 12 13:36:05 2023 +0100
Branches: blender-v3.3-release
https://developer.blender.org/rB9d3d9019abd2f9c8843ceb369f13240dad514cfe

Fix T101824: Line art flickers when light object has scaling.

Line art doesn't expect light or camera objects to have scaling.

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

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 e251292fe2f..8d75082d63f 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
@@ -3573,6 +3573,10 @@ static LineartData *lineart_create_render_buffer(Scene *scene,
     copy_v3db_v3fl(ld->conf.active_camera_pos, active_camera->obmat[3]);
   }
   copy_m4_m4(ld->conf.cam_obmat, camera->obmat);
+  /* Make sure none of the scaling factor makes in, line art expects no scaling on cameras and lights. */
+  normalize_v3(ld->conf.cam_obmat[0]);
+  normalize_v3(ld->conf.cam_obmat[1]);
+  normalize_v3(ld->conf.cam_obmat[2]);
 
   ld->conf.cam_is_persp = (c->type == CAM_PERSP);
   ld->conf.near_clip = c->clip_start + clipping_offset;
@@ -3601,6 +3605,10 @@ static LineartData *lineart_create_render_buffer(Scene *scene,
     Object *light_obj = lmd->light_contour_object;
     copy_v3db_v3fl(ld->conf.camera_pos_secondary, light_obj->obmat[3]);
     copy_m4_m4(ld->conf.cam_obmat_secondary, light_obj->obmat);
+    /* Make sure none of the scaling factor makes in, line art expects no scaling on cameras and lights. */
+    normalize_v3(ld->conf.cam_obmat_secondary[0]);
+    normalize_v3(ld->conf.cam_obmat_secondary[1]);
+    normalize_v3(ld->conf.cam_obmat_secondary[2]);
     ld->conf.light_reference_available = true;
     if (light_obj->type == OB_LAMP) {
       ld->conf.cam_is_persp_secondary = ((Light *)light_obj->data)->type != LA_SUN;



More information about the Bf-blender-cvs mailing list