[Bf-blender-cvs] [7fc9666c893] master: Cleanup: use elif for sculpt tool checks

Campbell Barton noreply at git.blender.org
Wed Jul 22 04:02:58 CEST 2020


Commit: 7fc9666c893983d9e8c2af999e960e0ddae68e8f
Author: Campbell Barton
Date:   Wed Jul 22 11:29:53 2020 +1000
Branches: master
https://developer.blender.org/rB7fc9666c893983d9e8c2af999e960e0ddae68e8f

Cleanup: use elif for sculpt tool checks

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

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

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

diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py
index d3ee5757e6e..6dde1e715bb 100644
--- a/release/scripts/startup/bl_ui/properties_paint_common.py
+++ b/release/scripts/startup/bl_ui/properties_paint_common.py
@@ -541,6 +541,7 @@ def brush_settings(layout, context, brush, popover=False):
     # Sculpt Mode #
     if mode == 'SCULPT':
         capabilities = brush.sculpt_capabilities
+        sculpt_tool = brush.sculpt_tool
 
         # normal_radius_factor
         layout.prop(brush, "normal_radius_factor", slider=True)
@@ -575,7 +576,7 @@ def brush_settings(layout, context, brush, popover=False):
         # crease_pinch_factor
         if capabilities.has_pinch_factor:
             text = "Pinch"
-            if brush.sculpt_tool in {'BLOB', 'SNAKE_HOOK'}:
+            if sculpt_tool in {'BLOB', 'SNAKE_HOOK'}:
                 text = "Magnify"
             layout.prop(brush, "crease_pinch_factor", slider=True, text=text)
 
@@ -625,17 +626,19 @@ def brush_settings(layout, context, brush, popover=False):
             row.prop(ups, "use_unified_color", text="", icon='BRUSHES_ALL')
             layout.prop(brush, "blend", text="Blend Mode")
 
-        if brush.sculpt_tool == 'CLAY_STRIPS':
+        # Per sculpt tool options.
+
+        if sculpt_tool == 'CLAY_STRIPS':
             row = layout.row()
             row.prop(brush, "tip_roundness")
 
-        if brush.sculpt_tool == 'ELASTIC_DEFORM':
+        elif sculpt_tool == 'ELASTIC_DEFORM':
             layout.separator()
             layout.prop(brush, "elastic_deform_type")
             layout.prop(brush, "elastic_deform_volume_preservation", slider=True)
             layout.separator()
 
-        if brush.sculpt_tool == 'POSE':
+        elif sculpt_tool == 'POSE':
             layout.separator()
             layout.prop(brush, "pose_deform_type")
             layout.prop(brush, "pose_origin_type")
@@ -647,10 +650,9 @@ def brush_settings(layout, context, brush, popover=False):
             layout.prop(brush, "use_connected_only")
             layout.prop(brush, "disconnected_distance_max")
 
-
             layout.separator()
 
-        if brush.sculpt_tool == 'CLOTH':
+        elif sculpt_tool == 'CLOTH':
             layout.separator()
             layout.prop(brush, "cloth_sim_limit")
             layout.prop(brush, "cloth_sim_falloff")
@@ -662,22 +664,22 @@ def brush_settings(layout, context, brush, popover=False):
             layout.prop(brush, "cloth_damping")
             layout.separator()
 
-        if brush.sculpt_tool == 'SCRAPE':
+        elif sculpt_tool == 'SCRAPE':
             row = layout.row()
             row.prop(brush, "area_radius_factor", slider=True)
             row = layout.row()
             row.prop(brush, "invert_to_scrape_fill", text="Invert to Fill")
 
-        if brush.sculpt_tool == 'FILL':
+        elif sculpt_tool == 'FILL':
             row = layout.row()
             row.prop(brush, "area_radius_factor", slider=True)
             row = layout.row()
             row.prop(brush, "invert_to_scrape_fill", text="Invert to Scrape")
 
-        if brush.sculpt_tool == 'GRAB':
+        elif sculpt_tool == 'GRAB':
             layout.prop(brush, "use_grab_active_vertex")
 
-        if brush.sculpt_tool == 'PAINT':
+        elif sculpt_tool == 'PAINT':
             row = layout.row(align=True)
             row.prop(brush, "flow")
             row.prop(brush, "invert_flow_pressure", text = "")
@@ -704,21 +706,21 @@ def brush_settings(layout, context, brush, popover=False):
             row = layout.row()
             row.prop(brush, "tip_scale_x")
 
-        if brush.sculpt_tool == 'SMEAR':
+        elif sculpt_tool == 'SMEAR':
             col = layout.column()
             col.prop(brush, "smear_deform_type")
 
-        if brush.sculpt_tool == 'TOPOLOGY':
+        elif sculpt_tool == 'TOPOLOGY':
             col = layout.column()
             col.prop(brush, "slide_deform_type")
 
-        if brush.sculpt_tool == 'MULTIPLANE_SCRAPE':
+        elif sculpt_tool == 'MULTIPLANE_SCRAPE':
             col = layout.column()
             col.prop(brush, "multiplane_scrape_angle")
             col.prop(brush, "use_multiplane_scrape_dynamic")
             col.prop(brush, "show_multiplane_scrape_planes_preview")
 
-        if brush.sculpt_tool == 'SMOOTH':
+        elif sculpt_tool == 'SMOOTH':
             col = layout.column()
             col.prop(brush, "smooth_deform_type")
             if brush.smooth_deform_type == 'SURFACE':
@@ -726,9 +728,11 @@ def brush_settings(layout, context, brush, popover=False):
                 col.prop(brush, "surface_smooth_current_vertex")
                 col.prop(brush, "surface_smooth_iterations")
 
-        if brush.sculpt_tool == 'MASK':
+        elif sculpt_tool == 'MASK':
             layout.row().prop(brush, "mask_tool", expand=True)
 
+        # End sculpt_tool interface.
+
     # 3D and 2D Texture Paint Mode.
     elif mode in {'PAINT_TEXTURE', 'PAINT_2D'}:
         capabilities = brush.image_paint_capabilities



More information about the Bf-blender-cvs mailing list