svn merge -r37793:37865 https://svn.blender.org/svnroot/bf-blender/trunk/blender
[blender.git] / release / scripts / startup / bl_ui / space_view3d_toolbar.py
index 7b015206f0df983050a32b337504a8ef16979dde..ac47380d363410ecee60463fda75a91575a0753e 100644 (file)
@@ -999,7 +999,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
@@ -1007,6 +1011,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: