[Bf-blender-cvs] [a6b5d5bfe83] master: GPencil: Simplify modifier minimal vert count fix

Henrik Dick noreply at git.blender.org
Sun Mar 13 17:22:46 CET 2022


Commit: a6b5d5bfe83e9d692a268cfbc979df8906391e34
Author: Henrik Dick
Date:   Sun Mar 13 17:21:30 2022 +0100
Branches: master
https://developer.blender.org/rBa6b5d5bfe83e9d692a268cfbc979df8906391e34

GPencil: Simplify modifier minimal vert count fix

Lower the minimal vert count for all simplify modes.

Differential Revision: http://developer.blender.org/D14319

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

M	source/blender/blenkernel/intern/gpencil_geom.cc
M	source/blender/gpencil_modifiers/intern/MOD_gpencilsimplify.c

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

diff --git a/source/blender/blenkernel/intern/gpencil_geom.cc b/source/blender/blenkernel/intern/gpencil_geom.cc
index 2160d567db5..e4ed2a40f10 100644
--- a/source/blender/blenkernel/intern/gpencil_geom.cc
+++ b/source/blender/blenkernel/intern/gpencil_geom.cc
@@ -2032,7 +2032,7 @@ void BKE_gpencil_stroke_simplify_adaptive(bGPdata *gpd, bGPDstroke *gps, float e
 
 void BKE_gpencil_stroke_simplify_fixed(bGPdata *gpd, bGPDstroke *gps)
 {
-  if (gps->totpoints < 5) {
+  if (gps->totpoints < 4) {
     return;
   }
 
@@ -2047,7 +2047,7 @@ void BKE_gpencil_stroke_simplify_fixed(bGPdata *gpd, bGPDstroke *gps)
 
   /* resize gps */
   int newtot = (gps->totpoints - 2) / 2;
-  if (((gps->totpoints - 2) % 2) > 0) {
+  if ((gps->totpoints % 2) != 0) {
     newtot++;
   }
   newtot += 2;
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilsimplify.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilsimplify.c
index 365b9afe348..f94b5d05291 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencilsimplify.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilsimplify.c
@@ -64,7 +64,7 @@ static void deformStroke(GpencilModifierData *md,
                                       mmd->material,
                                       mmd->pass_index,
                                       mmd->layer_pass,
-                                      mmd->mode == GP_SIMPLIFY_SAMPLE ? 2 : 4,
+                                      mmd->mode == GP_SIMPLIFY_SAMPLE ? 2 : 3,
                                       gpl,
                                       gps,
                                       mmd->flag & GP_SIMPLIFY_INVERT_LAYER,



More information about the Bf-blender-cvs mailing list