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 | |
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')
-rw-r--r-- | release/scripts/startup/bl_ui/space_view3d.py | 17 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_view3d_toolbar.py | 10 |
2 files changed, 18 insertions, 9 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") diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index 503a1d806ac..52eb76d0710 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -997,7 +997,11 @@ class VIEW3D_PT_tools_brush_appearance(PaintPanel, bpy.types.Panel): @classmethod def poll(cls, context): - return (context.sculpt_object and context.tool_settings.sculpt) or (context.vertex_paint_object and context.tool_settings.vertex_paint) or (context.weight_paint_object and context.tool_settings.weight_paint) or (context.image_paint_object and context.tool_settings.image_paint) + ts = context.tool_settings + return ((context.sculpt_object and ts.sculpt) or + (context.vertex_paint_object and ts.vertex_paint) or + (context.weight_paint_object and ts.weight_paint) or + (context.image_paint_object and ts.image_paint)) def draw(self, context): layout = self.layout @@ -1005,6 +1009,10 @@ class VIEW3D_PT_tools_brush_appearance(PaintPanel, bpy.types.Panel): settings = __class__.paint_settings(context) brush = settings.brush + if brush is None: # unlikely but can happen + layout.label(text="Brush Unset") + return + col = layout.column() if context.sculpt_object and context.tool_settings.sculpt: |