[Bf-blender-cvs] [0a033c4b696] greasepencil-object: GPencil: Disable Smart Smooth when Random is enabled

Antonio Vazquez noreply at git.blender.org
Thu Oct 3 17:46:32 CEST 2019


Commit: 0a033c4b69616a8807ee7d339cce8f89f1b4c1dc
Author: Antonio Vazquez
Date:   Thu Oct 3 17:46:21 2019 +0200
Branches: greasepencil-object
https://developer.blender.org/rB0a033c4b69616a8807ee7d339cce8f89f1b4c1dc

GPencil: Disable Smart Smooth when Random is enabled

These options cannot be used at the same time because the Smart Smooth is designed to remove any imperfection in the stroke and the random options are designed to create these imperfections, so the smooth removes all randomnes.

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

M	release/scripts/startup/bl_ui/space_view3d_toolbar.py
M	source/blender/editors/gpencil/gpencil_paint.c

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

diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index bac6004f7a9..b7e74e304dc 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -1903,7 +1903,10 @@ class VIEW3D_PT_tools_grease_pencil_brush_option(View3DPanel, Panel):
             col.prop(gp_settings, "input_samples")
             col.separator()
 
-            col.prop(gp_settings, "pen_smart_smooth_factor")
+            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 d1f17f0c702..891edf4347f 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -1362,7 +1362,9 @@ static void gp_stroke_newfrombuffer(tGPsdata *p)
     }
 
     /* Smooth any point created with fake events when the mouse/pen move very fast. */
-    gp_smooth_fake_segments(p);
+    if ((brush->gpencil_settings->flag & GP_BRUSH_GROUP_RANDOM) == 0) {
+      gp_smooth_fake_segments(p);
+    }
 
     pt = gps->points;
     dvert = gps->dvert;



More information about the Bf-blender-cvs mailing list