diff options
author | Antonioya <blendergit@gmail.com> | 2018-09-12 16:18:05 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2018-09-12 16:18:23 +0300 |
commit | 6018a3b4e8f9323f07abacb94587c49fbfef1735 (patch) | |
tree | 836e4bc07028cb5874f4a8859bd913a5ccea218e /release | |
parent | b172209b4b9acfe70fc095eb5cdad4574b3fbc84 (diff) |
GP: Hide panels for eraser brushes
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_ui/space_view3d_toolbar.py | 20 |
1 files changed, 18 insertions, 2 deletions
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 |