[Bf-blender-cvs] [8d45a967895] master: Fix T87082: Smooth thickness not working

Falk David noreply at git.blender.org
Wed Mar 31 14:19:16 CEST 2021


Commit: 8d45a9678955694cdd44aa709b5175308821dbba
Author: Falk David
Date:   Wed Mar 31 14:18:41 2021 +0200
Branches: master
https://developer.blender.org/rB8d45a9678955694cdd44aa709b5175308821dbba

Fix T87082: Smooth thickness not working

When using the smooth operator, the thickness would not be
smoothed on the first iteration. This was becasue the inner loop
was set to run `r * 20` times but `r` starts at 0.

The fix makes sure that "Smooth Thickness" works on the first
iteration by using  a fixed value of `20` as the loop limit. This
makes sure that for every iteration, we run the smoothing of the
thickness 20 more times.

Reviewed By: antoniov

Maniphest Tasks: T87082

Differential Revision: https://developer.blender.org/D10867

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

M	source/blender/editors/gpencil/gpencil_edit.c

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

diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c
index 99c9bfa3a56..66beb74d566 100644
--- a/source/blender/editors/gpencil/gpencil_edit.c
+++ b/source/blender/editors/gpencil/gpencil_edit.c
@@ -3951,7 +3951,7 @@ static void gpencil_smooth_stroke(bContext *C, wmOperator *op)
           }
           if (smooth_thickness) {
             /* thickness need to repeat process several times */
-            for (int r2 = 0; r2 < r * 20; r2++) {
+            for (int r2 = 0; r2 < 20; r2++) {
               BKE_gpencil_stroke_smooth_thickness(gps, i, factor);
             }
           }



More information about the Bf-blender-cvs mailing list