diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-06-27 07:36:14 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-06-27 07:36:14 +0400 |
commit | 33e554799bd69e888b5114ba92871f8de94a8597 (patch) | |
tree | f2b73a8258d44c5da4222c927f014ced61701265 /release/scripts/startup/bl_ui/space_view3d.py | |
parent | 4b1cceddbde5a9c887928c6234aee21f4c62d4ce (diff) |
Minor warning cleanup & fix
- comment/remove assignments from values to themselves.
- add case break statements (no functional change but some source code checkers notice).
- fix python errors when the sculpt brush is None.
Diffstat (limited to 'release/scripts/startup/bl_ui/space_view3d.py')
-rw-r--r-- | release/scripts/startup/bl_ui/space_view3d.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index aead20f76e3..b989085939f 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -1106,17 +1106,18 @@ class VIEW3D_MT_sculpt(bpy.types.Menu): layout.operator_menu_enum("brush.curve_preset", "shape") layout.separator() - sculpt_tool = brush.sculpt_tool + if brush is not None: # unlikely but can happen + sculpt_tool = brush.sculpt_tool - if sculpt_tool != 'GRAB': - layout.prop_menu_enum(brush, "stroke_method") + if sculpt_tool != 'GRAB': + layout.prop_menu_enum(brush, "stroke_method") - if sculpt_tool in {'DRAW', 'PINCH', 'INFLATE', 'LAYER', 'CLAY'}: - layout.prop_menu_enum(brush, "direction") + if sculpt_tool in {'DRAW', 'PINCH', 'INFLATE', 'LAYER', 'CLAY'}: + layout.prop_menu_enum(brush, "direction") - if sculpt_tool == 'LAYER': - layout.prop(brush, "use_persistent") - layout.operator("sculpt.set_persistent_base") + if sculpt_tool == 'LAYER': + layout.prop(brush, "use_persistent") + layout.operator("sculpt.set_persistent_base") layout.separator() layout.prop(sculpt, "use_threaded", text="Threaded Sculpt") |