[Bf-blender-cvs] [545b9ddc34d] master: Cleanup: Simplify curves toolbar drawing logic

Hans Goudey noreply at git.blender.org
Thu Jun 2 22:18:12 CEST 2022


Commit: 545b9ddc34da54a04f50e40cd0993ee88c4d56de
Author: Hans Goudey
Date:   Thu Jun 2 22:17:50 2022 +0200
Branches: master
https://developer.blender.org/rB545b9ddc34da54a04f50e40cd0993ee88c4d56de

Cleanup: Simplify curves toolbar drawing logic

Use `elif` to clarify that only one case happens.

===================================================================

M	release/scripts/startup/bl_ui/space_view3d.py

===================================================================

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")



More information about the Bf-blender-cvs mailing list