From 545b9ddc34da54a04f50e40cd0993ee88c4d56de Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Thu, 2 Jun 2022 22:17:50 +0200 Subject: [PATCH] Cleanup: Simplify curves toolbar drawing logic Use `elif` to clarify that only one case happens. --- release/scripts/startup/bl_ui/space_view3d.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index b7fe715ca90..80ea33f8a75 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -510,30 +510,27 @@ class _draw_tool_settings_context_mode: header=True, ) - if brush.curves_sculpt_tool == 'COMB': + curves_tool = brush.curves_sculpt_tool + + if curves_tool == 'COMB': layout.prop(brush, "falloff_shape", expand=True) layout.popover("VIEW3D_PT_tools_brush_falloff") - - if brush.curves_sculpt_tool == 'ADD': + elif curves_tool == 'ADD': layout.prop(brush, "falloff_shape", expand=True) layout.prop(brush.curves_sculpt_settings, "add_amount") 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': + elif curves_tool == 'GROW_SHRINK': layout.prop(brush, "direction", expand=True, text="") layout.prop(brush, "falloff_shape", expand=True) 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': + elif curves_tool == 'SNAKE_HOOK': layout.prop(brush, "falloff_shape", expand=True) layout.popover("VIEW3D_PT_tools_brush_falloff") - - if brush.curves_sculpt_tool == 'DELETE': + elif curves_tool == 'DELETE': layout.prop(brush, "falloff_shape", expand=True) - - if brush.curves_sculpt_tool == 'SELECTION_PAINT': + elif curves_tool == 'SELECTION_PAINT': layout.prop(brush, "direction", expand=True, text="") layout.prop(brush, "falloff_shape", expand=True) layout.popover("VIEW3D_PT_tools_brush_falloff")