diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-05-01 13:20:53 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-05-01 13:20:53 +0300 |
commit | f38fbc9bedb37695c4936838c002a389c45e367e (patch) | |
tree | 14ac554c67e75c373d9d9efeb8f61c54f8bde854 | |
parent | 314420e19365fee5d6d7ea625ea2063ff467705c (diff) |
UI: add weight paint sample tools
Also use unified weight.
-rw-r--r-- | release/scripts/startup/bl_ui/space_toolsystem_toolbar.py | 32 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_topbar.py | 2 |
2 files changed, 30 insertions, 4 deletions
diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py index 5312aac4764..2f0af9ebcb3 100644 --- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py +++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py @@ -613,10 +613,32 @@ class _defs_weight_paint: ) @ToolDef.from_fn + def sample_weight(): + return dict( + text="Sample Weight", + icon="ops.paint.weight_sample", + widget=None, + keymap=( + ("paint.weight_sample", dict(), dict(type='ACTIONMOUSE', value='PRESS')), + ), + ) + + @ToolDef.from_fn + def sample_weight_group(): + return dict( + text="Sample Vertex Group", + icon="ops.paint.weight_sample_group", + widget=None, + keymap=( + ("paint.weight_sample_group", dict(), dict(type='ACTIONMOUSE', value='PRESS')), + ), + ) + + @ToolDef.from_fn def gradient_linear(): return dict( text="Linear Gradient", - icon=None, + icon="ops.paint.weight_gradient.linear", widget=None, keymap=( ("paint.weight_gradient", dict(type='LINEAR'), @@ -628,7 +650,7 @@ class _defs_weight_paint: def gradient_radial(): return dict( text="Radial Gradient", - icon=None, + icon="ops.paint.weight_gradient.radial", widget=None, keymap=( ("paint.weight_gradient", @@ -771,9 +793,13 @@ class VIEW3D_PT_tools_active(ToolSelectPanelHelper, Panel): ], 'PAINT_WEIGHT': [ _defs_weight_paint.generate_from_brushes, - + None, + _defs_weight_paint.sample_weight, + _defs_weight_paint.sample_weight_group, + None, # TODO, override brush events *_tools_select, + None, ( _defs_weight_paint.gradient_linear, _defs_weight_paint.gradient_radial, diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py index 519a9f5a9b9..0189f9fc100 100644 --- a/release/scripts/startup/bl_ui/space_topbar.py +++ b/release/scripts/startup/bl_ui/space_topbar.py @@ -224,7 +224,7 @@ class _draw_left_context_mode: from .properties_paint_common import UnifiedPaintPanel - layout.prop(brush, "weight") + UnifiedPaintPanel.prop_unified_weight(layout, context, brush, "weight", slider=True, text="Weight") UnifiedPaintPanel.prop_unified_size(layout, context, brush, "size", slider=True, text="Radius") UnifiedPaintPanel.prop_unified_strength(layout, context, brush, "strength", slider=True, text="Strength") |