diff options
Diffstat (limited to 'release/scripts/startup/bl_ui/space_view3d_toolbar.py')
-rw-r--r-- | release/scripts/startup/bl_ui/space_view3d_toolbar.py | 31 |
1 files changed, 29 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 604509b99f9..89bb2005f53 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -1322,6 +1322,14 @@ class VIEW3D_PT_tools_particlemode_options_display(View3DPanel, Panel): # Grease Pencil drawing brushes +def tool_use_brush(context): + from bl_ui.space_toolsystem_common import ToolSelectPanelHelper + tool = ToolSelectPanelHelper.tool_active_from_context(context) + if tool and tool.has_datablock is False: + return False + + return True + class GreasePencilPaintPanel: bl_context = ".greasepencil_paint" @@ -1333,6 +1341,10 @@ class GreasePencilPaintPanel: if context.gpencil_data is None: return False + # Hide for tools not using bruhses + if tool_use_brush(context) is False: + return False + gpd = context.gpencil_data return bool(gpd.is_stroke_paint_mode) else: @@ -1718,9 +1730,14 @@ class VIEW3D_PT_tools_grease_pencil_brush_paint_falloff(GreasePencilBrushFalloff if brush is None: return False - tool = brush.gpencil_tool + from bl_ui.space_toolsystem_common import ToolSelectPanelHelper + tool = ToolSelectPanelHelper.tool_active_from_context(context) + if tool and tool.idname != 'builtin_brush.Tint': + return False + + gptool = brush.gpencil_tool - return (settings and settings.brush and settings.brush.curve and tool == 'TINT') + return (settings and settings.brush and settings.brush.curve and gptool == 'TINT') # Grease Pencil stroke sculpting tools @@ -2039,6 +2056,11 @@ class VIEW3D_PT_tools_grease_pencil_brush_mixcolor(View3DPanel, Panel): if context.region.type == 'TOOL_HEADER': return False + from bl_ui.space_toolsystem_common import ToolSelectPanelHelper + tool = ToolSelectPanelHelper.tool_active_from_context(context) + if tool and tool.idname in('builtin.cutter', 'builtin.eyedropper', 'builtin.interpolate'): + return False + if brush.gpencil_tool == 'TINT': return True @@ -2095,6 +2117,11 @@ class VIEW3D_PT_tools_grease_pencil_brush_mix_palette(View3DPanel, Panel): if ob is None or brush is None: return False + from bl_ui.space_toolsystem_common import ToolSelectPanelHelper + tool = ToolSelectPanelHelper.tool_active_from_context(context) + if tool and tool.idname in('builtin.cutter', 'builtin.eyedropper', 'builtin.interpolate'): + return False + if brush.gpencil_tool == 'TINT': return True |