[Bf-blender-cvs] [5e827607a8e] greasepencil-object: GPencil: Remove Smart Smooth Brush parameter

Antonio Vazquez noreply at git.blender.org
Wed Oct 16 16:39:27 CEST 2019


Commit: 5e827607a8e7bdfc9c1e47b018b45f131b49cd14
Author: Antonio Vazquez
Date:   Wed Oct 16 16:32:24 2019 +0200
Branches: greasepencil-object
https://developer.blender.org/rB5e827607a8e7bdfc9c1e47b018b45f131b49cd14

GPencil: Remove Smart Smooth Brush parameter

This parameter is not required because a value of 0.15 is working fine in any OS (this parameter was added to UI to make test of different values).

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

M	release/scripts/startup/bl_ui/space_view3d_toolbar.py
M	source/blender/editors/gpencil/gpencil_paint.c
M	source/blender/makesdna/DNA_brush_types.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 f6a46617422..38208f5e426 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -1904,10 +1904,6 @@ class VIEW3D_PT_tools_grease_pencil_brush_option(View3DPanel, Panel):
             col.prop(gp_settings, "input_samples")
             col.separator()
 
-            subcol = col.column(align=True)
-            subcol.enabled = not gp_settings.use_settings_random
-            subcol.prop(gp_settings, "pen_smart_smooth_factor")
-
             col.prop(gp_settings, "active_smooth_factor")
             col.separator()
 
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 66cf8fbb7ee..d5041005ec8 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -3913,15 +3913,11 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event)
       gpencil_draw_apply_event(C, op, event, CTX_data_depsgraph_pointer(C), 0.0f, 0.0f);
       int size_after = p->gpd->runtime.sbuffer_used;
 
-      /* Smooth segments if some fake points were added (need loop to get cumulative smooth). */
+      /* Smooth segments if some fake points were added (need loop to get cumulative smooth).
+       * the 0.15 value gets a good result in Windows and Linux. */
       if (size_after - size_before > 1) {
         for (int r = 0; r < 5; r++) {
-          /* The factor is divided because a value > 0.5f is too aggressive, but in the UI is
-           * better to keep the range from 0.0f to 1.0f for usability reasons. */
-          gp_smooth_segment(p->gpd,
-                            p->brush->gpencil_settings->smart_smooth * 0.5f,
-                            size_before - 1,
-                            size_after - 1);
+          gp_smooth_segment(p->gpd, 0.15f, size_before - 1, size_after - 1);
         }
       }
 
diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h
index 088301683d3..bc039deffa6 100644
--- a/source/blender/makesdna/DNA_brush_types.h
+++ b/source/blender/makesdna/DNA_brush_types.h
@@ -50,8 +50,7 @@ typedef struct BrushClone {
 typedef struct BrushGpencilSettings {
   /** Amount of smoothing to apply to newly created strokes. */
   float draw_smoothfac;
-  /** Amount of smooth for very fast mouse/pen movements. */
-  float smart_smooth;
+  char _pad2[4];
   /** Amount of alpha strength to apply to newly created strokes. */
   float draw_strength;
   /** Amount of jitter to apply to newly created strokes. */
@@ -517,7 +516,7 @@ typedef enum eBrushUVSculptTool {
         SCULPT_TOOL_ELASTIC_DEFORM, \
         SCULPT_TOOL_POSE, \
 \
-        /* These brushes could handle dynamic topology, \ \ \ \
+        /* These brushes could handle dynamic topology, \ \ \ \ \
          * but user feedback indicates it's better not to */ \
         SCULPT_TOOL_SMOOTH, \
         SCULPT_TOOL_MASK) == 0)
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c
index fdffa7e452d..3892ed0870f 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -1065,15 +1065,6 @@ static void rna_def_gpencil_options(BlenderRNA *brna)
   RNA_def_struct_path_func(srna, "rna_BrushGpencilSettings_path");
   RNA_def_struct_ui_text(srna, "Grease Pencil Brush Settings", "Settings for grease pencil brush");
 
-  /* Smart Smooth factor for new strokes */
-  prop = RNA_def_property(srna, "pen_smart_smooth_factor", PROP_FLOAT, PROP_NONE);
-  RNA_def_property_float_sdna(prop, NULL, "smart_smooth");
-  RNA_def_property_range(prop, 0.0f, 1.0f);
-  RNA_def_property_float_default(prop, 0.2f);
-  RNA_def_property_ui_text(prop, "Smart Smooth", "Factor of smoothing for fast movements");
-  RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
-  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
-
   /* Strength factor for new strokes */
   prop = RNA_def_property(srna, "pen_strength", PROP_FLOAT, PROP_FACTOR);
   RNA_def_property_float_sdna(prop, NULL, "draw_strength");



More information about the Bf-blender-cvs mailing list