[Bf-blender-cvs] [d2e576f34c6] master: GPencil: Remove Fill `use_collide_only` option

Antonio Vazquez noreply at git.blender.org
Thu Sep 29 14:58:47 CEST 2022


Commit: d2e576f34c6d428fb2c2ba855a0e29a2ba132549
Author: Antonio Vazquez
Date:   Thu Sep 29 14:58:29 2022 +0200
Branches: master
https://developer.blender.org/rBd2e576f34c6d428fb2c2ba855a0e29a2ba132549

GPencil: Remove Fill `use_collide_only` option

After a lot of testing, this option is not required and
now this is managed by stroke_collsion.

If the stroke_collision is enabled, only collide strokes 
are used.

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

M	release/scripts/startup/bl_ui/space_view3d_toolbar.py
M	source/blender/editors/gpencil/gpencil_fill.c
M	source/blender/makesdna/DNA_brush_enums.h
M	source/blender/makesrna/intern/rna_brush.c

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

diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 6946ab54ca7..cd6588779e0 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -1934,8 +1934,6 @@ class VIEW3D_PT_tools_grease_pencil_brush_gap_closure(View3DPanel, Panel):
         if gp_settings.fill_extend_mode == 'EXTEND':
             row = col.row(align=True)
             row.prop(gp_settings, "use_collide_strokes")
-            row = col.row(align=True)
-            row.prop(gp_settings, "use_collide_only")
 
 
 # Grease Pencil stroke sculpting tools
diff --git a/source/blender/editors/gpencil/gpencil_fill.c b/source/blender/editors/gpencil/gpencil_fill.c
index d1e51bf64d2..3f49ced16da 100644
--- a/source/blender/editors/gpencil/gpencil_fill.c
+++ b/source/blender/editors/gpencil/gpencil_fill.c
@@ -857,12 +857,12 @@ static bool gpencil_stroke_is_drawable(tGPDfill *tgpf, bGPDstroke *gps)
   const bool is_line_mode = (tgpf->fill_extend_mode == GP_FILL_EMODE_EXTEND);
   const bool show_help = (tgpf->flag & GP_BRUSH_FILL_SHOW_HELPLINES) != 0;
   const bool show_extend = (tgpf->flag & GP_BRUSH_FILL_SHOW_EXTENDLINES) != 0;
+  const bool use_stroke_collide = (tgpf->flag & GP_BRUSH_FILL_STROKE_COLLIDE) != 0;
   const bool is_extend_stroke = (gps->flag & GP_STROKE_NOFILL) && (gps->flag & GP_STROKE_TAG);
   const bool is_help_stroke = (gps->flag & GP_STROKE_NOFILL) && (gps->flag & GP_STROKE_HELP);
-  const bool only_collide_strokes = (tgpf->flag & GP_BRUSH_FILL_COLLIDE_ONLY) != 0;
   const bool stroke_collide = (gps->flag & GP_STROKE_COLLIDE) != 0;
 
-  if (is_line_mode && is_extend_stroke && only_collide_strokes && tgpf->is_render &&
+  if (is_line_mode && is_extend_stroke && tgpf->is_render && use_stroke_collide &&
       !stroke_collide) {
     return false;
   }
@@ -910,7 +910,7 @@ static void gpencil_draw_basic_stroke(tGPDfill *tgpf,
                          !(gps->flag & GP_STROKE_HELP);
   const bool is_help = gps->flag & GP_STROKE_HELP;
   const bool is_line_mode = (tgpf->fill_extend_mode == GP_FILL_EMODE_EXTEND);
-  const bool only_collide = (tgpf->flag & GP_BRUSH_FILL_COLLIDE_ONLY) != 0;
+  const bool use_stroke_collide = (tgpf->flag & GP_BRUSH_FILL_STROKE_COLLIDE) != 0;
   const bool stroke_collide = (gps->flag & GP_STROKE_COLLIDE) != 0;
 
   if (!gpencil_stroke_is_drawable(tgpf, gps)) {
@@ -931,7 +931,7 @@ static void gpencil_draw_basic_stroke(tGPDfill *tgpf,
     col[3] = (gps->flag & GP_STROKE_TAG) ? 0.0f : 0.5f;
   }
   else if ((is_extend) && (!tgpf->is_render)) {
-    if (stroke_collide || !only_collide || !is_line_mode) {
+    if (stroke_collide || !use_stroke_collide || !is_line_mode) {
       copy_v4_v4(col, extend_col);
     }
     else {
diff --git a/source/blender/makesdna/DNA_brush_enums.h b/source/blender/makesdna/DNA_brush_enums.h
index 9b2dad915ed..570b569a4dd 100644
--- a/source/blender/makesdna/DNA_brush_enums.h
+++ b/source/blender/makesdna/DNA_brush_enums.h
@@ -91,8 +91,6 @@ typedef enum eGPDbrush_Flag {
   GP_BRUSH_OUTLINE_STROKE = (1 << 17),
   /* Collide with stroke. */
   GP_BRUSH_FILL_STROKE_COLLIDE = (1 << 18),
-  /* Extend lines only close if collide. */
-  GP_BRUSH_FILL_COLLIDE_ONLY = (1 << 19),
 } eGPDbrush_Flag;
 
 typedef enum eGPDbrush_Flag2 {
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c
index 510fa8a6126..3c9590ddcbe 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -1976,13 +1976,6 @@ static void rna_def_gpencil_options(BlenderRNA *brna)
       prop, "Strokes Collision", "Check if extend lines collide with strokes");
   RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
 
-  prop = RNA_def_property(srna, "use_collide_only", PROP_BOOLEAN, PROP_NONE);
-  RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BRUSH_FILL_COLLIDE_ONLY);
-  RNA_def_property_boolean_default(prop, false);
-  RNA_def_property_ui_text(
-      prop, "Only Collide Lines", "Use for closing gaps only if the extend strokes collide");
-  RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
-
   prop = RNA_def_property(srna, "show_fill", PROP_BOOLEAN, PROP_NONE);
   RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GP_BRUSH_FILL_HIDE);
   RNA_def_property_boolean_default(prop, true);



More information about the Bf-blender-cvs mailing list