diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-09-18 19:52:28 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-09-18 19:52:28 +0400 |
commit | 9787a2e55aecef7cad850b7e3bccf62af7220a21 (patch) | |
tree | 56494c3f742603608cc22140e9ea65621680b5c3 /release/ui | |
parent | 9435727712e39d728b83de9c4709679c32006405 (diff) |
UI: fix some python errors in sculpt/paint modes when there is no brush.
Diffstat (limited to 'release/ui')
-rw-r--r-- | release/ui/space_image.py | 33 | ||||
-rw-r--r-- | release/ui/space_view3d_toolbar.py | 8 |
2 files changed, 22 insertions, 19 deletions
diff --git a/release/ui/space_image.py b/release/ui/space_image.py index 50ccda34c6a..b14bec0e40e 100644 --- a/release/ui/space_image.py +++ b/release/ui/space_image.py @@ -419,22 +419,23 @@ class IMAGE_PT_paint(bpy.types.Panel): row.item_enumR(settings, "tool", 'CLONE') row.item_enumR(settings, "tool", 'SMEAR') - col = layout.column() - col.itemR(brush, "color", text="") + if brush: + col = layout.column() + col.itemR(brush, "color", text="") - row = col.row(align=True) - row.itemR(brush, "size", slider=True) - row.itemR(brush, "use_size_pressure", toggle=True, text="") - - row = col.row(align=True) - row.itemR(brush, "strength", slider=True) - row.itemR(brush, "use_strength_pressure", toggle=True, text="") + row = col.row(align=True) + row.itemR(brush, "size", slider=True) + row.itemR(brush, "use_size_pressure", toggle=True, text="") + + row = col.row(align=True) + row.itemR(brush, "strength", slider=True) + row.itemR(brush, "use_strength_pressure", toggle=True, text="") - row = col.row(align=True) - row.itemR(brush, "jitter", slider=True) - row.itemR(brush, "use_jitter_pressure", toggle=True, text="") + row = col.row(align=True) + row.itemR(brush, "jitter", slider=True) + row.itemR(brush, "use_jitter_pressure", toggle=True, text="") - col.itemR(brush, "blend", text="Blend") + col.itemR(brush, "blend", text="Blend") class IMAGE_PT_paint_stroke(bpy.types.Panel): __space_type__ = 'IMAGE_EDITOR' @@ -444,7 +445,8 @@ class IMAGE_PT_paint_stroke(bpy.types.Panel): def poll(self, context): sima = context.space_data - return sima.show_paint + settings = context.tool_settings.image_paint + return sima.show_paint and settings.brush def draw(self, context): layout = self.layout @@ -471,7 +473,8 @@ class IMAGE_PT_paint_curve(bpy.types.Panel): def poll(self, context): sima = context.space_data - return sima.show_paint + settings = context.tool_settings.image_paint + return sima.show_paint and settings.brush def draw(self, context): layout = self.layout diff --git a/release/ui/space_view3d_toolbar.py b/release/ui/space_view3d_toolbar.py index 6f17ad925cf..9492437b863 100644 --- a/release/ui/space_view3d_toolbar.py +++ b/release/ui/space_view3d_toolbar.py @@ -379,7 +379,7 @@ class VIEW3D_PT_tools_brush(PaintPanel): # Sculpt Mode # - elif context.sculpt_object and settings.brush: + elif context.sculpt_object and brush: col = layout.column() col.itemS() col.itemR(brush, "sculpt_tool", expand=True) @@ -412,7 +412,7 @@ class VIEW3D_PT_tools_brush(PaintPanel): # Texture Paint Mode # - elif context.texture_paint_object: + elif context.texture_paint_object and brush: col = layout.column(align=True) col.item_enumR(settings, "tool", 'DRAW') col.item_enumR(settings, "tool", 'SOFTEN') @@ -438,7 +438,7 @@ class VIEW3D_PT_tools_brush(PaintPanel): # Weight Paint Mode # - elif context.weight_paint_object: + elif context.weight_paint_object and brush: layout.itemR(context.tool_settings, "vertex_group_weight", text="Weight", slider=True) col = layout.column() @@ -456,7 +456,7 @@ class VIEW3D_PT_tools_brush(PaintPanel): # Vertex Paint Mode # - elif context.vertex_paint_object: + elif context.vertex_paint_object and brush: col = layout.column() col.itemR(brush, "color", text="") |