Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-01-10 02:10:21 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-01-10 02:12:23 +0300
commit609d4f5c92c76bd62fe77e880e38ae8528419b0a (patch)
tree13276dd5f61befc601e0bcad11a2cad27209a2b9 /release
parenteb3886c7ac832346c412bfccbfd32ba4b6f0a421 (diff)
Fix T60354: Paint color shown when not used
Add 'has_color' check to avoid duplicated tool checks. Also abbreviate text descriptions.
Diffstat (limited to 'release')
-rw-r--r--release/scripts/startup/bl_ui/properties_paint_common.py12
-rw-r--r--release/scripts/startup/bl_ui/space_topbar.py12
2 files changed, 17 insertions, 7 deletions
diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py
index 51db0a99b7d..9f12f2258d3 100644
--- a/release/scripts/startup/bl_ui/properties_paint_common.py
+++ b/release/scripts/startup/bl_ui/properties_paint_common.py
@@ -113,7 +113,7 @@ def brush_texpaint_common(panel, context, layout, brush, settings, projpaint=Fal
col = layout.column()
- if brush.image_tool in {'DRAW', 'FILL'}:
+ if capabilities.has_color:
if brush.blend not in {'ERASE_ALPHA', 'ADD_ALPHA'}:
if not brush.use_gradient:
panel.prop_unified_color_picker(col, context, brush, "color", value_slider=True)
@@ -318,6 +318,8 @@ def brush_basic_wpaint_settings(layout, context, brush, *, compact=False):
def brush_basic_vpaint_settings(layout, context, brush, *, compact=False):
+ capabilities = brush.vertex_paint_capabilities
+
row = layout.row(align=True)
UnifiedPaintPanel.prop_unified_size(row, context, brush, "size", slider=True, text="Radius")
UnifiedPaintPanel.prop_unified_size(row, context, brush, "use_pressure_size")
@@ -326,8 +328,10 @@ def brush_basic_vpaint_settings(layout, context, brush, *, compact=False):
UnifiedPaintPanel.prop_unified_strength(row, context, brush, "strength", text="Strength")
UnifiedPaintPanel.prop_unified_strength(row, context, brush, "use_pressure_strength")
- layout.separator()
- layout.prop(brush, "blend", text="" if compact else "Blend")
+
+ if capabilities.has_color:
+ layout.separator()
+ layout.prop(brush, "blend", text="" if compact else "Blend")
def brush_basic_texpaint_settings(layout, context, brush, *, compact=False):
@@ -346,7 +350,7 @@ def brush_basic_texpaint_settings(layout, context, brush, *, compact=False):
UnifiedPaintPanel.prop_unified_strength(row, context, brush, "strength", text="Strength")
UnifiedPaintPanel.prop_unified_strength(row, context, brush, "use_pressure_strength")
- if brush.image_tool in {'DRAW', 'FILL'}:
+ if capabilities.has_color:
layout.separator()
layout.prop(brush, "blend", text="" if compact else "Blend")
diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py
index 94965e5d03d..06a6e3dc5ac 100644
--- a/release/scripts/startup/bl_ui/space_topbar.py
+++ b/release/scripts/startup/bl_ui/space_topbar.py
@@ -257,7 +257,9 @@ class _draw_left_context_mode:
UnifiedPaintPanel,
brush_basic_texpaint_settings,
)
- UnifiedPaintPanel.prop_unified_color(layout, context, brush, "color", text="")
+ capabilities = brush.image_paint_capabilities
+ if capabilities.has_color:
+ UnifiedPaintPanel.prop_unified_color(layout, context, brush, "color", text="")
brush_basic_texpaint_settings(layout, context, brush, compact=True)
@staticmethod
@@ -276,7 +278,9 @@ class _draw_left_context_mode:
UnifiedPaintPanel,
brush_basic_vpaint_settings,
)
- UnifiedPaintPanel.prop_unified_color(layout, context, brush, "color", text="")
+ capabilities = brush.vertex_paint_capabilities
+ if capabilities.has_color:
+ UnifiedPaintPanel.prop_unified_color(layout, context, brush, "color", text="")
brush_basic_vpaint_settings(layout, context, brush, compact=True)
@staticmethod
@@ -453,7 +457,9 @@ class _draw_left_context_mode:
UnifiedPaintPanel,
brush_basic_texpaint_settings,
)
- UnifiedPaintPanel.prop_unified_color(layout, context, brush, "color", text="")
+ capabilities = brush.image_paint_capabilities
+ if capabilities.has_color:
+ UnifiedPaintPanel.prop_unified_color(layout, context, brush, "color", text="")
brush_basic_texpaint_settings(layout, context, brush, compact=True)