Commit: ea90625acf2d6490588df105a9323bd78a693730
Author: Antonioya
Date:   Tue Apr 9 16:25:04 2019 +0200
Branches: greasepencil-object
https://developer.blender.org/rBea90625acf2d6490588df105a9323bd78a693730

GPencil: Active gradient only for DOTS

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

M       release/scripts/startup/bl_ui/space_view3d_toolbar.py
M       source/blender/draw/engines/gpencil/shaders/gpencil_point_frag.glsl

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

diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py 
b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index fc3df1ec778..365cbe0781f 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -1728,9 +1728,17 @@ class 
VIEW3D_PT_tools_grease_pencil_brush_option(View3DPanel, Panel):
 
             col.prop(gp_settings, "angle", slider=True)
             col.prop(gp_settings, "angle_factor", text="Factor", slider=True)
+
+            ma = context.material
+            if brush.gpencil_settings.material:
+                ma = brush.gpencil_settings.material
+
             col.separator()
-            col.prop(gp_settings, "gradient_factor", slider=True)
-            col.prop(gp_settings, "gradient_shape")
+            subcol = col.column(align=True)
+            if ma and ma.grease_pencil.mode != 'DOTS':
+                subcol.enabled = False
+            subcol.prop(gp_settings, "gradient_factor", slider=True)
+            subcol.prop(gp_settings, "gradient_shape")
 
 
 class VIEW3D_PT_tools_grease_pencil_brush_stabilizer(View3DPanel, Panel):
diff --git 
a/source/blender/draw/engines/gpencil/shaders/gpencil_point_frag.glsl 
b/source/blender/draw/engines/gpencil/shaders/gpencil_point_frag.glsl
index d6dcb87a1c1..88d0a210e50 100644
--- a/source/blender/draw/engines/gpencil/shaders/gpencil_point_frag.glsl
+++ b/source/blender/draw/engines/gpencil/shaders/gpencil_point_frag.glsl
@@ -61,13 +61,14 @@ void main()
                fragColor.a = min(text_color.a * mColor.a, mColor.a);
        }
        
-       if (gradient_f < 1.0) {
+       if ((mode == GPENCIL_MODE_DOTS) && (gradient_f < 1.0)) {
                float dist = length(centered) * 2.0;
                float ex = pow(dist, (-gradient_f * 2.0f));
                float alpha = clamp(1.0 - abs((1.0f - ex) / 10.0f), 0.0f, 1.0f) 
* ellip;
                fragColor.a = clamp(smoothstep(fragColor.a, 0.0, alpha), 0.01, 
1.0);
        }
        
-       if(fragColor.a < 0.0035)
+       if(fragColor.a < 0.0035) {
                discard;
+       }
 }

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to