diff options
author | William Reynish <billrey@me.com> | 2019-12-23 19:28:21 +0300 |
---|---|---|
committer | William Reynish <billrey@me.com> | 2019-12-23 19:28:47 +0300 |
commit | 2ff996040d0245b6e558016314545177c8c85e9a (patch) | |
tree | b7cca09e2035b80a0d40f8218d855810401616fb /release/scripts | |
parent | 50b478e3282bc19b243d4c0d94450cb7be25ff05 (diff) |
Fix T72555: Brush Radius/Size and Strength not linked on header tools settings when Unified Brush is active
Patch by Demeter Dzadik
Differential Revision: https://developer.blender.org/D6473
Diffstat (limited to 'release/scripts')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_paint_common.py | 14 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_image.py | 5 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_view3d.py | 20 |
3 files changed, 30 insertions, 9 deletions
diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py index 5f866699744..327df079d3b 100644 --- a/release/scripts/startup/bl_ui/properties_paint_common.py +++ b/release/scripts/startup/bl_ui/properties_paint_common.py @@ -104,14 +104,14 @@ class UnifiedPaintPanel: icon='NONE', text=None, slider=False, - display_unified_toggle=True, + header=False, ): """ Generalized way of adding brush options to the UI, along with their pen pressure setting and global toggle, if they exist. """ row = layout.row(align=True) ups = context.tool_settings.unified_paint_settings prop_owner = brush - if unified_name and getattr(ups, unified_name) and display_unified_toggle: + if unified_name and getattr(ups, unified_name): prop_owner = ups row.prop(prop_owner, prop_name, icon=icon, text=text, slider=slider) @@ -119,7 +119,8 @@ class UnifiedPaintPanel: if pressure_name: row.prop(brush, pressure_name, text="") - if unified_name and display_unified_toggle: + if unified_name and not header: + # NOTE: We don't draw UnifiedPaintSettings in the header to reduce clutter. D5928#136281 row.prop(ups, unified_name, text="", icon="WORLD") return row @@ -871,7 +872,7 @@ def draw_color_settings(context, layout, brush, color_type=False): "secondary_color", unified_name="use_unified_color", text="Background Color", - display_unified_toggle=False, + header=True, ) col.prop(brush, "gradient_stroke_mode", text="Gradient Mapping") @@ -961,7 +962,6 @@ def brush_mask_texture_settings(layout, brush): def brush_basic_texpaint_settings(layout, context, brush, *, compact=False): """Draw Tool Settings header for Vertex Paint and 2D and 3D Texture Paint modes.""" - # NOTE: We don't draw UnifiedPaintSettings in the header to reduce clutter. D5928#136281 capabilities = brush.image_paint_capabilities if capabilities.has_color: @@ -974,8 +974,10 @@ def brush_basic_texpaint_settings(layout, context, brush, *, compact=False): brush, "size", pressure_name="use_pressure_size", + unified_name="use_unified_size", slider=True, text="Radius", + header=True ) UnifiedPaintPanel.prop_unified( layout, @@ -983,6 +985,8 @@ def brush_basic_texpaint_settings(layout, context, brush, *, compact=False): brush, "strength", pressure_name="use_pressure_strength", + unified_name="use_unified_strength", + header=True ) diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py index c178476df62..c6f490f9d26 100644 --- a/release/scripts/startup/bl_ui/space_image.py +++ b/release/scripts/startup/bl_ui/space_image.py @@ -589,14 +589,15 @@ class _draw_tool_settings_context_mode: uv_sculpt = tool_settings.uv_sculpt brush = uv_sculpt.brush if brush: - # NOTE: We don't draw UnifiedPaintSettings in the header to reduce clutter. D5928#136281 UnifiedPaintPanel.prop_unified( layout, context, brush, "size", pressure_name="use_pressure_size", + unified_name="use_unified_size", slider=True, + header=True ) UnifiedPaintPanel.prop_unified( layout, @@ -604,7 +605,9 @@ class _draw_tool_settings_context_mode: brush, "strength", pressure_name="use_pressure_strength", + unified_name="use_unified_strength", slider=True, + header=True ) @staticmethod diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 868ee738127..fee8845d88e 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -260,15 +260,16 @@ class _draw_tool_settings_context_mode: if size_owner.use_locked_size == 'SCENE': size = "unprojected_radius" - # NOTE: We don't draw UnifiedPaintSettings in the header to reduce clutter. D5928#136281 UnifiedPaintPanel.prop_unified( layout, context, brush, size, pressure_name="use_pressure_size", + unified_name="use_unified_size", text="Radius", slider=True, + header=True ) # strength, use_strength_pressure @@ -279,7 +280,9 @@ class _draw_tool_settings_context_mode: brush, "strength", pressure_name=pressure_name, + unified_name="use_unified_strength", text="Strength", + header=True ) # direction @@ -331,10 +334,17 @@ class _draw_tool_settings_context_mode: if brush is None: return False - # NOTE: We don't draw UnifiedPaintSettings in the header to reduce clutter. D5928#136281 capabilities = brush.weight_paint_capabilities if capabilities.has_weight: - UnifiedPaintPanel.prop_unified(layout, context, brush, "weight", slider=True) + UnifiedPaintPanel.prop_unified( + layout, + context, + brush, + "weight", + unified_name="use_unified_weight", + slider=True, + header=True + ) UnifiedPaintPanel.prop_unified( layout, @@ -342,8 +352,10 @@ class _draw_tool_settings_context_mode: brush, "size", pressure_name="use_pressure_size", + unified_name="use_unified_size", slider=True, text="Radius", + header=True ) UnifiedPaintPanel.prop_unified( layout, @@ -351,6 +363,8 @@ class _draw_tool_settings_context_mode: brush, "strength", pressure_name="use_pressure_strength", + unified_name="use_unified_strength", + header=True ) return True |