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>2018-05-01 13:46:25 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-05-01 13:48:35 +0300
commit3f4a81232a2ab3da4802c77c0b7dcbe49f223cbd (patch)
tree0c785edc0184132730c6d74f706c00bd2c051df8
parentf38fbc9bedb37695c4936838c002a389c45e367e (diff)
UI: expose radial gradient as option
Was a separate tool, use option so we can extend more easily.
-rw-r--r--release/scripts/startup/bl_ui/space_toolsystem_toolbar.py31
1 files changed, 10 insertions, 21 deletions
diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
index 2f0af9ebcb3..c621e27ae00 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -635,28 +635,20 @@ class _defs_weight_paint:
)
@ToolDef.from_fn
- def gradient_linear():
- return dict(
- text="Linear Gradient",
- icon="ops.paint.weight_gradient.linear",
- widget=None,
- keymap=(
- ("paint.weight_gradient", dict(type='LINEAR'),
- dict(type='EVT_TWEAK_A', value='ANY')),
- ),
- )
+ def gradient():
+ def draw_settings(context, layout):
+ wm = context.window_manager
+ props = wm.operator_properties_last("paint.weight_gradient")
+ layout.prop(props, "type")
- @ToolDef.from_fn
- def gradient_radial():
return dict(
- text="Radial Gradient",
- icon="ops.paint.weight_gradient.radial",
+ text="Gradient",
+ icon="ops.paint.weight_gradient",
widget=None,
keymap=(
- ("paint.weight_gradient",
- dict(type='RADIAL'),
- dict(type='EVT_TWEAK_A', value='ANY')),
+ ("paint.weight_gradient", dict(), dict(type='EVT_TWEAK_A', value='ANY')),
),
+ draw_settings=draw_settings,
)
@@ -800,10 +792,7 @@ class VIEW3D_PT_tools_active(ToolSelectPanelHelper, Panel):
# TODO, override brush events
*_tools_select,
None,
- (
- _defs_weight_paint.gradient_linear,
- _defs_weight_paint.gradient_radial,
- ),
+ _defs_weight_paint.gradient,
],
}