Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
| Show First 20 Lines • Show All 1,130 Lines • ▼ Show 20 Lines | def sample_weight_group(): | ||||
| keymap=(), | keymap=(), | ||||
| ) | ) | ||||
| @ToolDef.from_fn | @ToolDef.from_fn | ||||
| def gradient(): | def gradient(): | ||||
| def draw_settings(context, layout, tool): | def draw_settings(context, layout, tool): | ||||
| brush = context.tool_settings.weight_paint.brush | brush = context.tool_settings.weight_paint.brush | ||||
| if brush is not None: | if brush is not None: | ||||
| layout.prop(brush, "weight", slider=True) | from bl_ui.properties_paint_common import UnifiedPaintPanel | ||||
| layout.prop(brush, "strength", slider=True) | 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") | props = tool.operator_properties("paint.weight_gradient") | ||||
| layout.prop(props, "type", expand=True) | layout.prop(props, "type", expand=True) | ||||
| return dict( | return dict( | ||||
| idname="builtin.gradient", | idname="builtin.gradient", | ||||
| label="Gradient", | label="Gradient", | ||||
| icon="ops.paint.weight_gradient", | icon="ops.paint.weight_gradient", | ||||
| widget=None, | widget=None, | ||||
| ▲ Show 20 Lines • Show All 1,134 Lines • Show Last 20 Lines | |||||