From 98869c514ad130896cbdc10efdbac0ea0d8ee66e Mon Sep 17 00:00:00 2001 From: Sean Kim Date: Mon, 18 Aug 2025 01:16:42 +0200 Subject: [PATCH] Fix: Annotate tool in Image Editor shows brush properties & errors Pull Request: https://projects.blender.org/blender/blender/pulls/144658 --- scripts/startup/bl_ui/space_image.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) 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)