[Bf-blender-cvs] [cd4741eb736] blender-v2.82-release: Fix Vertex weight gradient tool show wrong weight/strength values in the UI

Philipp Oeser noreply at git.blender.org
Tue Mar 10 13:53:10 CET 2020


Commit: cd4741eb73601beec943214b50e7deff2d15a962
Author: Philipp Oeser
Date:   Thu Feb 20 16:45:33 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rBcd4741eb73601beec943214b50e7deff2d15a962

Fix Vertex weight gradient tool show wrong weight/strength values in the
UI

Main issue is that the UI doesn not respect the Unified Weight/Strength
setting (but instead alwasy shows the brushes weight/strength)

Was working before, but somewhat missed in rBfb74dcc5d69d.

See discussion in T74025 on why the Gradient Tool in its current state
is not very user friendly in general, what I think we should do though
is at least have the values in the UI respect Unified Weight / Unified
Strength since this is what the tool will use internally...

ref T74025

Maniphest Tasks: T74025

Differential Revision: https://developer.blender.org/D6900

===================================================================

M	release/scripts/startup/bl_ui/space_toolsystem_toolbar.py

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
index 74a34589a4b..1c1a8254ea9 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -1130,8 +1130,25 @@ class _defs_weight_paint:
         def draw_settings(context, layout, tool):
             brush = context.tool_settings.weight_paint.brush
             if brush is not None:
-                layout.prop(brush, "weight", slider=True)
-                layout.prop(brush, "strength", slider=True)
+                from bl_ui.properties_paint_common import UnifiedPaintPanel
+                UnifiedPaintPanel.prop_unified(
+                    layout,
+                    context,
+                    brush,
+                    "weight",
+                    unified_name="use_unified_weight",
+                    slider=True,
+                    header=True
+                )
+                UnifiedPaintPanel.prop_unified(
+                    layout,
+                    context,
+                    brush,
+                    "strength",
+                    unified_name="use_unified_strength",
+                    header=True
+                )
+
             props = tool.operator_properties("paint.weight_gradient")
             layout.prop(props, "type", expand=True)



More information about the Bf-blender-cvs mailing list