From 5ec5572a21fbf05d6bc23beb58d04d45f8187dcf Mon Sep 17 00:00:00 2001 From: Sean Kim Date: Mon, 29 Sep 2025 18:22:29 +0200 Subject: [PATCH] UI: Add dropdown toggle for grease pencil pressure curves Follow up to 5b02341a11286bbf29384640843dfebfafd5a024 Pull Request: https://projects.blender.org/blender/blender/pulls/146776 --- .../startup/bl_ui/properties_paint_common.py | 29 +++++++++++++++---- scripts/startup/bl_ui/space_view3d_toolbar.py | 13 +++++++-- 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/scripts/startup/bl_ui/properties_paint_common.py b/scripts/startup/bl_ui/properties_paint_common.py index 710cf4acf1b..e25c9d8b285 100644 --- a/scripts/startup/bl_ui/properties_paint_common.py +++ b/scripts/startup/bl_ui/properties_paint_common.py @@ -1667,6 +1667,7 @@ def brush_basic__draw_color_selector(context, layout, brush, gp_settings): def brush_basic_grease_pencil_paint_settings(layout, context, brush, props, *, compact=False): gp_settings = brush.gpencil_settings + paint = context.tool_settings.gpencil_paint tool = context.workspace.tools.from_space_view3d_mode(context.mode, create=False) if gp_settings is None: return @@ -1694,18 +1695,34 @@ def brush_basic_grease_pencil_paint_settings(layout, context, brush, props, *, c row = layout.row(align=True) row.prop(brush, size, slider=True, text="Size") row.prop(brush, "use_pressure_size", text="") + if not compact: + row.prop( + paint, + "show_size_curve", + text="", + icon='DOWNARROW_HLT' if paint.show_size_curve else 'RIGHTARROW', + emboss=False) - if brush.use_pressure_size and not compact: - col = layout.column() - col.template_curve_mapping(gp_settings, "curve_sensitivity", brush=True) + if paint.show_size_curve: + col = layout.column() + col.active = brush.use_pressure_size + col.template_curve_mapping(gp_settings, "curve_sensitivity", brush=True) row = layout.row(align=True) row.prop(brush, "strength", slider=True, text="Strength") row.prop(brush, "use_pressure_strength", text="") + if not compact: + row.prop( + paint, + "show_strength_curve", + text="", + icon='DOWNARROW_HLT' if paint.show_strength_curve else 'RIGHTARROW', + emboss=False) - if brush.use_pressure_strength and not compact: - col = layout.column() - col.template_curve_mapping(gp_settings, "curve_strength", brush=True) + if paint.show_strength_curve: + col = layout.column() + col.active = brush.use_pressure_strength + col.template_curve_mapping(gp_settings, "curve_strength", brush=True) if props: layout.prop(props, "subdivision") diff --git a/scripts/startup/bl_ui/space_view3d_toolbar.py b/scripts/startup/bl_ui/space_view3d_toolbar.py index 7be4cb6dc59..ed263d410f7 100644 --- a/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -2084,6 +2084,7 @@ class VIEW3D_PT_tools_grease_pencil_v3_brush_random(View3DPanel, Panel): layout.use_property_decorate = False tool_settings = context.tool_settings + paint = tool_settings.gpencil_paint brush = tool_settings.gpencil_paint.brush mode = tool_settings.gpencil_paint.color_mode gp_settings = brush.gpencil_settings @@ -2142,8 +2143,16 @@ class VIEW3D_PT_tools_grease_pencil_v3_brush_random(View3DPanel, Panel): row = col.row(align=True) row.prop(gp_settings, "pen_jitter", slider=True) row.prop(gp_settings, "use_jitter_pressure", text="", icon='STYLUS_PRESSURE') - if gp_settings.use_jitter_pressure and self.is_popover is False: - col.template_curve_mapping(gp_settings, "curve_jitter", brush=True) + if self.is_popover is False: + row.prop( + paint, + "show_jitter_curve", + text="", + icon='DOWNARROW_HLT' if paint.show_jitter_curve else 'RIGHTARROW', + emboss=False) + if paint.show_jitter_curve: + col.active = gp_settings.use_jitter_pressure + col.template_curve_mapping(gp_settings, "curve_jitter", brush=True) class VIEW3D_PT_tools_grease_pencil_v3_brush_stabilizer(Panel, View3DPanel):