diff options
author | Hans Goudey <h.goudey@me.com> | 2022-05-11 16:47:49 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-05-11 16:47:49 +0300 |
commit | a4382badb91cce4e2d419425a9a06385f0aeb7fd (patch) | |
tree | 7804e408ecc0ed8454e390a38eedc87be7190428 /release/scripts/startup/bl_ui/space_view3d.py | |
parent | 6599d2f03b2af9be752cf73a8fd59a6e7a535686 (diff) |
Curves: Adjust sculpt mode UI layouts
This patch adjusts the UI layouts for the tool header and the tool
properties in sculpt mode in a few ways. The goals are to better group
related settings, keep fundamental settings easily accessible, fix the
availability of some options, and make better use of space.
1. Remove ID template in tool header
2. Rename "Add Amount" to "Count" for add brush
3. Add "use pressure" toggles to radius and strength sliders
4. Move strength falloff to a popover
5. Move many "Add" brush settings to popover called "Curve Shape"
6. Move two "Grow/Shrink" options to a popover called "Scaling"
7. Don't display "Falloff" panel in properties when it has no effect
See the differential revision for screenshots and more reasoning.
Differential Revision: https://developer.blender.org/D14922
Diffstat (limited to 'release/scripts/startup/bl_ui/space_view3d.py')
-rw-r--r-- | release/scripts/startup/bl_ui/space_view3d.py | 90 |
1 files changed, 69 insertions, 21 deletions
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 9ea120616f4..4ff62b2ca00 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -484,22 +484,22 @@ class _draw_tool_settings_context_mode: tool_settings = context.tool_settings paint = tool_settings.curves_sculpt - layout.template_ID_preview(paint, "brush", rows=3, cols=8, hide_buttons=True) brush = paint.brush if brush is None: return False UnifiedPaintPanel.prop_unified( - layout, - context, - brush, - "size", - unified_name="use_unified_size", - text="Radius", - slider=True, - header=True - ) + layout, + context, + brush, + "size", + unified_name="use_unified_size", + pressure_name="use_pressure_size", + text="Radius", + slider=True, + header=True + ) if brush.curves_sculpt_tool not in {'ADD', 'DELETE'}: UnifiedPaintPanel.prop_unified( @@ -508,33 +508,30 @@ class _draw_tool_settings_context_mode: brush, "strength", unified_name="use_unified_strength", + pressure_name="use_pressure_strength", header=True ) if brush.curves_sculpt_tool == 'COMB': layout.prop(brush, "falloff_shape", expand=True) - layout.prop(brush, "curve_preset") + layout.popover("VIEW3D_PT_tools_brush_falloff") if brush.curves_sculpt_tool == 'ADD': - layout.prop(brush, "use_frontface", text="Front Faces Only") layout.prop(brush, "falloff_shape", expand=True) layout.prop(brush.curves_sculpt_settings, "add_amount") - layout.prop(brush.curves_sculpt_settings, "points_per_curve") - layout.prop(brush.curves_sculpt_settings, "curve_length") - layout.prop(brush.curves_sculpt_settings, "interpolate_length") - layout.prop(brush.curves_sculpt_settings, "interpolate_shape") - layout.prop(brush.curves_sculpt_settings, "interpolate_point_count") + layout.popover("VIEW3D_PT_curves_sculpt_add_shape", text="Curve Shape") + layout.prop(brush, "use_frontface", text="Front Faces Only") + if brush.curves_sculpt_tool == 'GROW_SHRINK': layout.prop(brush, "direction", expand=True, text="") layout.prop(brush, "falloff_shape", expand=True) - layout.prop(brush.curves_sculpt_settings, "scale_uniform") - layout.prop(brush.curves_sculpt_settings, "minimum_length") - layout.prop(brush, "curve_preset") + layout.popover("VIEW3D_PT_curves_sculpt_grow_shrink_scaling", text="Scaling") + layout.popover("VIEW3D_PT_tools_brush_falloff") if brush.curves_sculpt_tool == 'SNAKE_HOOK': layout.prop(brush, "falloff_shape", expand=True) - layout.prop(brush, "curve_preset") + layout.popover("VIEW3D_PT_tools_brush_falloff") if brush.curves_sculpt_tool == 'DELETE': layout.prop(brush, "falloff_shape", expand=True) @@ -7617,6 +7614,55 @@ class TOPBAR_PT_gpencil_vertexcolor(GreasePencilVertexcolorPanel, Panel): return ob and ob.type == 'GPENCIL' +class VIEW3D_PT_curves_sculpt_add_shape(Panel): + # Only for popover, these are dummy values. + bl_space_type = 'VIEW_3D' + bl_region_type = 'WINDOW' + bl_label = "Curves Sculpt Add Curve Options" + + def draw(self, context): + layout = self.layout + + layout.use_property_split = True + layout.use_property_decorate = False # No animation. + + settings = UnifiedPaintPanel.paint_settings(context) + brush = settings.brush + + col = layout.column(heading="Interpolate", align=True) + col.prop(brush.curves_sculpt_settings, "interpolate_length", text="Length") + col.prop(brush.curves_sculpt_settings, "interpolate_shape", text="Shape") + col.prop(brush.curves_sculpt_settings, "interpolate_point_count", text="Point Count") + + col = layout.column() + col.active = not brush.curves_sculpt_settings.interpolate_length + col.prop(brush.curves_sculpt_settings, "curve_length", text="Length") + + col = layout.column() + col.active = not brush.curves_sculpt_settings.interpolate_point_count + col.prop(brush.curves_sculpt_settings, "points_per_curve", text="Points") + + +class VIEW3D_PT_curves_sculpt_grow_shrink_scaling(Panel): + # Only for popover, these are dummy values. + bl_space_type = 'VIEW_3D' + bl_region_type = 'WINDOW' + bl_label = "Curves Grow/Shrink Scaling" + bl_ui_units_x = 12 + + def draw(self, context): + layout = self.layout + + layout.use_property_split = True + layout.use_property_decorate = False # No animation. + + settings = UnifiedPaintPanel.paint_settings(context) + brush = settings.brush + + layout.prop(brush.curves_sculpt_settings, "scale_uniform") + layout.prop(brush.curves_sculpt_settings, "minimum_length") + + classes = ( VIEW3D_HT_header, VIEW3D_HT_tool_header, @@ -7848,6 +7894,8 @@ classes = ( TOPBAR_PT_gpencil_materials, TOPBAR_PT_gpencil_vertexcolor, TOPBAR_PT_annotation_layers, + VIEW3D_PT_curves_sculpt_add_shape, + VIEW3D_PT_curves_sculpt_grow_shrink_scaling, ) |