[Bf-blender-cvs] [6018a3b4e8f] blender2.8: GP: Hide panels for eraser brushes
Antonioya
noreply at git.blender.org
Wed Sep 12 15:18:33 CEST 2018
Commit: 6018a3b4e8f9323f07abacb94587c49fbfef1735
Author: Antonioya
Date: Wed Sep 12 15:18:05 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB6018a3b4e8f9323f07abacb94587c49fbfef1735
GP: Hide panels for eraser brushes
===================================================================
M release/scripts/startup/bl_ui/space_view3d_toolbar.py
===================================================================
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 41dc143e680..e13387021d1 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -1462,6 +1462,13 @@ class VIEW3D_PT_tools_grease_pencil_brush_option(View3DPanel, Panel):
bl_label = "Options"
bl_options = {'DEFAULT_CLOSED'}
+ @classmethod
+ def poll(cls, context):
+ brush = context.active_gpencil_brush
+ gp_settings = brush.gpencil_settings
+
+ return brush is not None and gp_settings.gpencil_brush_type != 'ERASE'
+
def draw_header_preset(self, context):
VIEW3D_PT_gpencil_brush_presets.draw_panel_header(self.layout)
@@ -1528,8 +1535,9 @@ class VIEW3D_PT_tools_grease_pencil_brush_settings(View3DPanel, Panel):
@classmethod
def poll(cls, context):
brush = context.active_gpencil_brush
+ gp_settings = brush.gpencil_settings
- return brush is not None
+ return brush is not None and gp_settings.gpencil_brush_type != 'ERASE'
def draw_header(self, context):
brush = context.active_gpencil_brush
@@ -1568,8 +1576,9 @@ class VIEW3D_PT_tools_grease_pencil_brush_random(View3DPanel, Panel):
@classmethod
def poll(cls, context):
brush = context.active_gpencil_brush
+ gp_settings = brush.gpencil_settings
- return brush is not None
+ return brush is not None and gp_settings.gpencil_brush_type != 'ERASE'
def draw_header(self, context):
brush = context.active_gpencil_brush
@@ -1601,6 +1610,13 @@ class VIEW3D_PT_tools_grease_pencil_brushcurves(View3DPanel, Panel):
bl_label = "Curves"
bl_options = {'DEFAULT_CLOSED'}
+ @classmethod
+ def poll(cls, context):
+ brush = context.active_gpencil_brush
+ gp_settings = brush.gpencil_settings
+
+ return brush is not None and gp_settings.gpencil_brush_type != 'ERASE'
+
@staticmethod
def draw(self, context):
layout = self.layout
More information about the Bf-blender-cvs
mailing list