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:
Diffstat (limited to 'release')
-rw-r--r--release/scripts/startup/bl_ui/space_toolsystem_toolbar.py47
-rw-r--r--release/scripts/startup/bl_ui/space_topbar.py2
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")