Context: remove active_gpencil_brush
[blender.git] / release / scripts / startup / bl_ui / properties_grease_pencil_common.py
index 32c0aa6ab0bd2a1318ecf7fecaa4bd7aca2a35b6..0f098bcc1292f1331c5df62e49bfa16a23632194 100644 (file)
@@ -45,7 +45,8 @@ def gpencil_stroke_placement_settings(context, layout):
 
 
 def gpencil_active_brush_settings_simple(context, layout):
-    brush = context.active_gpencil_brush
+    tool_settings = context.tool_settings
+    brush = tool_settings.gpencil_paint.brush
     if brush is None:
         layout.label(text="No Active Brush")
         return
@@ -324,10 +325,11 @@ class GreasePencilAppearancePanel:
         layout.use_property_split = True
         layout.use_property_decorate = False
 
+        tool_settings = context.tool_settings
         ob = context.active_object
 
         if ob.mode == 'PAINT_GPENCIL':
-            brush = context.active_gpencil_brush
+            brush = tool_settings.gpencil_paint.brush
             gp_settings = brush.gpencil_settings
 
             sub = layout.column(align=True)
@@ -348,7 +350,7 @@ class GreasePencilAppearancePanel:
                 layout.prop(brush, "cursor_color_add", text="Color")
 
         elif ob.mode in {'SCULPT_GPENCIL', 'WEIGHT_GPENCIL'}:
-            settings = context.tool_settings.gpencil_sculpt
+            settings = tool_settings.gpencil_sculpt
             brush = settings.brush
             tool = settings.sculpt_tool
 
@@ -452,7 +454,6 @@ class GPENCIL_MT_pie_settings_palette(Menu):
         gpd = context.gpencil_data
         gpl = context.active_gpencil_layer
         palcolor = None  # context.active_gpencil_palettecolor
-        # brush = context.active_gpencil_brush
 
         is_editmode = bool(gpd and gpd.use_stroke_edit_mode and context.editable_gpencil_strokes)