[Bf-blender-cvs] [c8ef6efc01d] greasepencil-object: GPencil: Add Fallof menu to Tint tool

Antonio Vazquez noreply at git.blender.org
Fri Nov 22 23:51:32 CET 2019


Commit: c8ef6efc01d1e75318ab615ae70e303976902af3
Author: Antonio Vazquez
Date:   Fri Nov 22 23:51:18 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rBc8ef6efc01d1e75318ab615ae70e303976902af3

GPencil: Add Fallof menu to Tint tool

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

M	release/scripts/startup/bl_ui/properties_grease_pencil_common.py
M	release/scripts/startup/bl_ui/space_view3d_toolbar.py

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

diff --git a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
index 343a0791db5..d402feb281f 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -314,7 +314,7 @@ class GreasePencilAppearancePanel:
             col = layout.column()
             col.prop(brush, "use_custom_icon")
 
-            sub =col.column()
+            sub = col.column()
             sub.active = brush.use_custom_icon
             sub.prop(brush, "icon_filepath", text="")
 
@@ -326,14 +326,24 @@ class GreasePencilBrushFalloff:
     @classmethod
     def poll(cls, context):
         ts = context.tool_settings
-        settings = ts.gpencil_vertex_paint
-        brush = settings.brush
+        settings = None
+        if context.mode == 'PAINT_GPENCIL':
+            settings = ts.gpencil_paint
+        if context.mode == 'SCULPT_GPENCIL':
+            settings = ts.gpencil_sculpt_paint
+        elif context.mode == 'WEIGHT_GPENCIL':
+            settings = ts.gpencil_weight_paint
+        elif context.mode == 'VERTEX_GPENCIL':
+            settings = ts.gpencil_vertex_paint
+
         return (settings and settings.brush and settings.brush.curve)
 
     def draw(self, context):
         layout = self.layout
         ts = context.tool_settings
         settings = None
+        if context.mode == 'PAINT_GPENCIL':
+            settings = ts.gpencil_paint
         if context.mode == 'SCULPT_GPENCIL':
             settings = ts.gpencil_sculpt_paint
         elif context.mode == 'WEIGHT_GPENCIL':
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 53df8ca8915..c8931cc0b60 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -2377,6 +2377,21 @@ class VIEW3D_PT_tools_grease_pencil_brush_vertex_color(View3DPanel, Panel):
         sub_row.operator("gpencil.tint_flip", icon='FILE_REFRESH', text="")
 
 
+class VIEW3D_PT_tools_grease_pencil_brush_paint_falloff(GreasePencilBrushFalloff, Panel, View3DPaintPanel):
+    bl_context = ".greasepencil_paint"
+    bl_label = "Falloff"
+    bl_options = {'DEFAULT_CLOSED'}
+
+    @classmethod
+    def poll(cls, context):
+        ts = context.tool_settings
+        settings = ts.gpencil_paint
+        brush = settings.brush
+        tool = brush.gpencil_tool
+
+        return (settings and settings.brush and settings.brush.curve and tool == 'TINT')
+
+
 class VIEW3D_PT_tools_grease_pencil_brush_vertex_falloff(GreasePencilBrushFalloff, Panel, View3DPaintPanel):
     bl_context = ".greasepencil_vertex"
     bl_label = "Falloff"
@@ -2386,7 +2401,6 @@ class VIEW3D_PT_tools_grease_pencil_brush_vertex_falloff(GreasePencilBrushFallof
     def poll(cls, context):
         ts = context.tool_settings
         settings = ts.gpencil_vertex_paint
-        brush = settings.brush
         return (settings and settings.brush and settings.brush.curve)
 
 
@@ -2399,7 +2413,6 @@ class VIEW3D_PT_tools_grease_pencil_brush_sculpt_falloff(GreasePencilBrushFallof
     def poll(cls, context):
         ts = context.tool_settings
         settings = ts.gpencil_sculpt_paint
-        brush = settings.brush
         return (settings and settings.brush and settings.brush.curve)
 
 
@@ -2724,6 +2737,7 @@ classes = (
     VIEW3D_PT_tools_grease_pencil_brush_vertex_palette,
     VIEW3D_PT_tools_grease_pencil_brush_vertex_falloff,
     VIEW3D_PT_tools_grease_pencil_vertex_appearance,
+    VIEW3D_PT_tools_grease_pencil_brush_paint_falloff,
 )
 
 if __name__ == "__main__":  # only for live edit.



More information about the Bf-blender-cvs mailing list