diff --git a/scripts/startup/bl_ui/space_image.py b/scripts/startup/bl_ui/space_image.py index 78a65007c5c..33a719c1bcb 100644 --- a/scripts/startup/bl_ui/space_image.py +++ b/scripts/startup/bl_ui/space_image.py @@ -39,7 +39,7 @@ from bpy.app.translations import ( ) -class ImagePaintPanel: +class ImagePaintPanel(UnifiedPaintPanel): bl_space_type = 'IMAGE_EDITOR' bl_region_type = 'UI' @@ -1242,13 +1242,18 @@ class IMAGE_PT_paint_settings(Panel, ImagePaintPanel): bl_category = "Tool" bl_label = "Brush Settings" + @classmethod + def poll(cls, context): + settings = cls.paint_settings(context) + return settings and settings.brush is not None + def draw(self, context): layout = self.layout layout.use_property_split = True layout.use_property_decorate = False - settings = context.tool_settings.image_paint + settings = self.paint_settings(context) brush = settings.brush if brush: @@ -1262,13 +1267,18 @@ class IMAGE_PT_paint_settings_advanced(Panel, ImagePaintPanel): bl_label = "Advanced" bl_ui_units_x = 12 + @classmethod + def poll(cls, context): + settings = cls.paint_settings(context) + return settings and settings.brush is not None + def draw(self, context): layout = self.layout layout.use_property_split = True layout.use_property_decorate = False # No animation. - settings = context.tool_settings.image_paint + settings = self.paint_settings(context) brush = settings.brush if brush: brush_settings_advanced(layout.column(), context, settings, brush, self.is_popover)