diff options
author | Jeroen Bakker <j.bakker@atmind.nl> | 2018-05-01 17:28:02 +0300 |
---|---|---|
committer | Jeroen Bakker <j.bakker@atmind.nl> | 2018-05-01 17:28:02 +0300 |
commit | 43452c254e2dae31361a74ff90eb44ac35368f3f (patch) | |
tree | d32a1922353e13d5fe79e61feae3371677a020d1 /release | |
parent | be88f23b834b9f9e9c7c71215284a4c1f6fe0f66 (diff) | |
parent | c5c3fa3eacb32b6e9f8ece47d1c69f274b9070c0 (diff) |
Merge branch 'blender2.8' of git.blender.org:blender into blender2.8
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_ui/space_toolsystem_toolbar.py | 47 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_topbar.py | 2 |
2 files changed, 32 insertions, 17 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..c621e27ae00 100644 --- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py +++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py @@ -613,28 +613,42 @@ class _defs_weight_paint: ) @ToolDef.from_fn - def gradient_linear(): + def sample_weight(): return dict( - text="Linear Gradient", - icon=None, + text="Sample Weight", + icon="ops.paint.weight_sample", widget=None, keymap=( - ("paint.weight_gradient", dict(type='LINEAR'), - dict(type='EVT_TWEAK_A', value='ANY')), + ("paint.weight_sample", dict(), dict(type='ACTIONMOUSE', value='PRESS')), ), ) @ToolDef.from_fn - def gradient_radial(): + def sample_weight_group(): return dict( - text="Radial Gradient", - icon=None, + text="Sample Vertex Group", + icon="ops.paint.weight_sample_group", widget=None, keymap=( - ("paint.weight_gradient", - dict(type='RADIAL'), - dict(type='EVT_TWEAK_A', value='ANY')), + ("paint.weight_sample_group", dict(), dict(type='ACTIONMOUSE', value='PRESS')), + ), + ) + + @ToolDef.from_fn + def gradient(): + def draw_settings(context, layout): + wm = context.window_manager + props = wm.operator_properties_last("paint.weight_gradient") + layout.prop(props, "type") + + return dict( + text="Gradient", + icon="ops.paint.weight_gradient", + widget=None, + keymap=( + ("paint.weight_gradient", dict(), dict(type='EVT_TWEAK_A', value='ANY')), ), + draw_settings=draw_settings, ) @@ -771,13 +785,14 @@ 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, - ( - _defs_weight_paint.gradient_linear, - _defs_weight_paint.gradient_radial, - ), + None, + _defs_weight_paint.gradient, ], } 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") |