[Bf-blender-cvs] [bdbf24772a0] master: GPencil: Remove Leak Size

Antonio Vazquez noreply at git.blender.org
Sat Sep 17 12:41:20 CEST 2022


Commit: bdbf24772a0dd5edd65eb861e9347a44205c164b
Author: Antonio Vazquez
Date:   Fri Sep 16 13:10:12 2022 +0200
Branches: master
https://developer.blender.org/rBbdbf24772a0dd5edd65eb861e9347a44205c164b

GPencil: Remove Leak Size

This value was used to close gaps, but now with the new system is not needed.

Internally, still we need to keep a small leak size, but after doing a lot of test a 
value of 3 is perfect, so it's harcoded.

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

M	source/blender/blenkernel/intern/brush.cc
M	source/blender/editors/gpencil/gpencil_fill.c
M	source/blender/makesdna/DNA_brush_types.h
M	source/blender/makesrna/intern/rna_brush.c

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

diff --git a/source/blender/blenkernel/intern/brush.cc b/source/blender/blenkernel/intern/brush.cc
index c206a04fecc..a998fc0a75f 100644
--- a/source/blender/blenkernel/intern/brush.cc
+++ b/source/blender/blenkernel/intern/brush.cc
@@ -982,7 +982,6 @@ void BKE_gpencil_brush_preset_set(Main *bmain, Brush *brush, const short type)
     case GP_BRUSH_PRESET_FILL_AREA: {
       brush->size = 5.0f;
 
-      brush->gpencil_settings->fill_leak = 3;
       brush->gpencil_settings->fill_threshold = 0.1f;
       brush->gpencil_settings->fill_simplylvl = 1;
       brush->gpencil_settings->fill_factor = 1.0f;
diff --git a/source/blender/editors/gpencil/gpencil_fill.c b/source/blender/editors/gpencil/gpencil_fill.c
index d601ba142a1..6eb49cd933a 100644
--- a/source/blender/editors/gpencil/gpencil_fill.c
+++ b/source/blender/editors/gpencil/gpencil_fill.c
@@ -67,6 +67,7 @@
 
 #define LEAK_HORZ 0
 #define LEAK_VERT 1
+#define FILL_LEAK 3.0f
 #define MIN_WINDOW_SIZE 128
 
 /* Set to 1 to debug filling internal image. By default, the value must be 0. */
@@ -1980,7 +1981,7 @@ static tGPDfill *gpencil_session_init_fill(bContext *C, wmOperator *op)
   tgpf->fill_extend_fac = brush->gpencil_settings->fill_extend_fac;
   tgpf->fill_factor = max_ff(GPENCIL_MIN_FILL_FAC,
                              min_ff(brush->gpencil_settings->fill_factor, GPENCIL_MAX_FILL_FAC));
-  tgpf->fill_leak = (int)ceil((float)brush->gpencil_settings->fill_leak * tgpf->fill_factor);
+  tgpf->fill_leak = (int)ceil(FILL_LEAK * tgpf->fill_factor);
 
   int totcol = tgpf->ob->totcol;
 
diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h
index 4048867607f..761a36e8d1f 100644
--- a/source/blender/makesdna/DNA_brush_types.h
+++ b/source/blender/makesdna/DNA_brush_types.h
@@ -58,8 +58,7 @@ typedef struct BrushGpencilSettings {
 
   /** Factor for transparency. */
   float fill_threshold;
-  /** Number of pixel to consider the leak is too small (x 2). */
-  short fill_leak;
+  char _pad2[2];
   /* Type of caps: eGPDstroke_Caps. */
   int8_t caps_type;
   char _pad[5];
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c
index 3c3b6f1619b..bd0e14e4b59 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -1491,14 +1491,6 @@ static void rna_def_gpencil_options(BlenderRNA *brna)
   RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
   RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
 
-  /* fill leak size */
-  prop = RNA_def_property(srna, "fill_leak", PROP_INT, PROP_PIXEL);
-  RNA_def_property_int_sdna(prop, NULL, "fill_leak");
-  RNA_def_property_range(prop, 0, 100);
-  RNA_def_property_ui_text(prop, "Leak Size", "Size in pixels to consider the leak closed");
-  RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
-  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
-
   /* fill factor size */
   prop = RNA_def_property(srna, "fill_factor", PROP_FLOAT, PROP_NONE);
   RNA_def_property_float_sdna(prop, NULL, "fill_factor");



More information about the Bf-blender-cvs mailing list