Cleanup: RNA boolean names (use prefix conventions)
[blender.git] / release / scripts / startup / bl_ui / space_view3d_toolbar.py
index b80085503e987389742166710f6d5e429d61cb28..2ba84ac166e18600b1bb05b47fa2b0583e8d4d27 100644 (file)
@@ -27,9 +27,9 @@ from .properties_grease_pencil_common import (
 )
 from .properties_paint_common import (
     UnifiedPaintPanel,
-    brush_texture_settings,
-    brush_texpaint_common,
     brush_mask_texture_settings,
+    brush_texpaint_common,
+    brush_texture_settings,
 )
 from bl_operators.presets import PresetMenu
 
@@ -112,7 +112,7 @@ class VIEW3D_PT_tools_meshedit_options(View3DPanel, Panel):
         row.active = ob.data.use_mirror_x
         row.prop(mesh, "use_mirror_topology")
 
-        layout.prop(tool_settings, "edge_path_live_unwrap")
+        layout.prop(tool_settings, "use_edge_path_live_unwrap")
         layout.prop(tool_settings, "use_mesh_automerge")
 
         layout.prop(tool_settings, "double_threshold")
@@ -222,7 +222,7 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
     def draw(self, context):
         layout = self.layout
 
-        toolsettings = context.tool_settings
+        tool_settings = context.tool_settings
         settings = self.paint_settings(context)
         brush = settings.brush
 
@@ -257,36 +257,26 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
         # Sculpt Mode #
 
         elif context.sculpt_object and brush:
+            from .properties_paint_common import (
+                brush_basic_sculpt_settings,
+            )
+
             capabilities = brush.sculpt_capabilities
 
             col = layout.column()
 
             col.separator()
 
-            row = col.row(align=True)
-
-            ups = toolsettings.unified_paint_settings
-            if ((ups.use_unified_size and ups.use_locked_size) or
-                    ((not ups.use_unified_size) and brush.use_locked_size)):
-                self.prop_unified_size(row, context, brush, "use_locked_size", icon='LOCKED')
-                self.prop_unified_size(row, context, brush, "unprojected_radius", slider=True, text="Radius")
-            else:
-                self.prop_unified_size(row, context, brush, "use_locked_size", icon='UNLOCKED')
-                self.prop_unified_size(row, context, brush, "size", slider=True, text="Radius")
-
-            self.prop_unified_size(row, context, brush, "use_pressure_size")
-
-            # strength, use_strength_pressure, and use_strength_attenuation
-            col.separator()
-            row = col.row(align=True)
-
-            if capabilities.has_space_attenuation:
-                row.prop(brush, "use_space_attenuation", toggle=True, icon_only=True)
-
-            self.prop_unified_strength(row, context, brush, "strength", text="Strength")
+            if not self.is_popover:
+                brush_basic_sculpt_settings(col, context, brush)
 
-            if capabilities.has_strength_pressure:
-                self.prop_unified_strength(row, context, brush, "use_pressure_strength")
+            # topology_rake_factor
+            if (capabilities.has_topology_rake and
+                context.sculpt_object.use_dynamic_topology_sculpting
+            ):
+                col.separator()
+                row = col.row()
+                row.prop(brush, "topology_rake_factor", slider=True)
 
             # auto_smooth_factor and use_inverse_smooth_pressure
             if capabilities.has_auto_smooth:
@@ -350,10 +340,6 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
             col.prop(brush, "use_frontface", text="Front Faces Only")
             col.prop(brush, "use_projected")
 
-            # direction
-            col.separator()
-            col.row().prop(brush, "direction", expand=True)
-
             # use_accumulate
             if capabilities.has_accumulate:
                 col.separator()
@@ -384,22 +370,14 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
 
         # Weight Paint Mode #
         elif context.weight_paint_object and brush:
+            from .properties_paint_common import (
+                brush_basic_wpaint_settings,
+            )
 
             col = layout.column()
 
-            row = col.row(align=True)
-            self.prop_unified_weight(row, context, brush, "weight", slider=True, text="Weight")
-
-            row = col.row(align=True)
-            self.prop_unified_size(row, context, brush, "size", slider=True, text="Radius")
-            self.prop_unified_size(row, context, brush, "use_pressure_size")
-
-            row = col.row(align=True)
-            self.prop_unified_strength(row, context, brush, "strength", text="Strength")
-            self.prop_unified_strength(row, context, brush, "use_pressure_strength")
-
-            col.separator()
-            col.prop(brush, "blend", text="Blend")
+            if not self.is_popover:
+                brush_basic_wpaint_settings(col, context, brush)
 
             if brush.weight_tool != 'SMEAR':
                 col.prop(brush, "use_accumulate")
@@ -415,11 +393,15 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
             col.prop(brush, "use_projected")
 
             col = layout.column()
-            col.prop(toolsettings, "use_auto_normalize", text="Auto Normalize")
-            col.prop(toolsettings, "use_multipaint", text="Multi-Paint")
+            col.prop(tool_settings, "use_auto_normalize", text="Auto Normalize")
+            col.prop(tool_settings, "use_multipaint", text="Multi-Paint")
 
         # Vertex Paint Mode #
         elif context.vertex_paint_object and brush:
+            from .properties_paint_common import (
+                brush_basic_vpaint_settings,
+            )
+
             col = layout.column()
             self.prop_unified_color_picker(col, context, brush, "color", value_slider=True)
             if settings.palette:
@@ -431,16 +413,10 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
             row.operator("paint.brush_colors_flip", icon='FILE_REFRESH', text="")
 
             col.separator()
-            row = col.row(align=True)
-            self.prop_unified_size(row, context, brush, "size", slider=True, text="Radius")
-            self.prop_unified_size(row, context, brush, "use_pressure_size")
 
-            row = col.row(align=True)
-            self.prop_unified_strength(row, context, brush, "strength", text="Strength")
-            self.prop_unified_strength(row, context, brush, "use_pressure_strength")
+            if not self.is_popover:
+                brush_basic_vpaint_settings(col, context, brush)
 
-            col.separator()
-            col.prop(brush, "blend", text="Blend")
             col.prop(brush, "use_alpha")
 
             if brush.vertex_tool != 'SMEAR':
@@ -543,6 +519,8 @@ class VIEW3D_PT_slots_projectpaint(View3DPanel, Panel):
                 layout.menu("VIEW3D_MT_tools_projectpaint_uvlayer", text=uv_text, translate=False)
             have_image = settings.canvas is not None
 
+            layout.prop(settings, "interpolation", text="")
+
         if settings.missing_uvs:
             layout.separator()
             split = layout.split()
@@ -575,8 +553,8 @@ class VIEW3D_PT_stencil_projectpaint(View3DPanel, Panel):
         layout.use_property_split = True
         layout.use_property_decorate = False
 
-        toolsettings = context.tool_settings
-        ipaint = toolsettings.image_paint
+        tool_settings = context.tool_settings
+        ipaint = tool_settings.image_paint
         ob = context.active_object
         mesh = ob.data
 
@@ -631,13 +609,15 @@ class VIEW3D_PT_tools_brush_overlay(Panel, View3DPaintPanel):
 
         col = layout.column()
 
-
         row = col.row(align=True)
 
         sub = row.row(align=True)
         sub.prop(brush, "cursor_overlay_alpha", text="Curve Alpha")
         sub.prop(brush, "use_cursor_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
-        row.prop(brush,"use_cursor_overlay", text="", toggle=True, icon='HIDE_OFF' if brush.use_cursor_overlay else 'HIDE_ON')
+        row.prop(
+            brush, "use_cursor_overlay", text="", toggle=True,
+            icon='HIDE_OFF' if brush.use_cursor_overlay else 'HIDE_ON',
+        )
 
         col.active = brush.brush_capabilities.has_overlay
 
@@ -648,7 +628,10 @@ class VIEW3D_PT_tools_brush_overlay(Panel, View3DPaintPanel):
             sub.prop(brush, "texture_overlay_alpha", text="Texture Alpha")
             sub.prop(brush, "use_primary_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
             if tex_slot.map_mode != 'STENCIL':
-                row.prop(brush, "use_primary_overlay", text="", toggle=True, icon='HIDE_OFF' if brush.use_primary_overlay else 'HIDE_ON')
+                row.prop(
+                    brush, "use_primary_overlay", text="", toggle=True,
+                    icon='HIDE_OFF' if brush.use_primary_overlay else 'HIDE_ON',
+                )
 
         if context.image_paint_object:
             row = col.row(align=True)
@@ -657,7 +640,10 @@ class VIEW3D_PT_tools_brush_overlay(Panel, View3DPaintPanel):
             sub.prop(brush, "mask_overlay_alpha", text="Mask Texture Alpha")
             sub.prop(brush, "use_secondary_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
             if tex_slot_mask.map_mode != 'STENCIL':
-                row.prop(brush, "use_secondary_overlay", text="", toggle=True, icon='HIDE_OFF' if brush.use_secondary_overlay else 'HIDE_ON')
+                row.prop(
+                    brush, "use_secondary_overlay", text="", toggle=True,
+                    icon='HIDE_OFF' if brush.use_secondary_overlay else 'HIDE_ON',
+                )
 
 
 # TODO, move to space_view3d.py
@@ -870,8 +856,8 @@ class VIEW3D_PT_sculpt_dyntopo(Panel, View3DPaintPanel):
         layout.use_property_split = True
         layout.use_property_decorate = False
 
-        toolsettings = context.tool_settings
-        sculpt = toolsettings.sculpt
+        tool_settings = context.tool_settings
+        sculpt = tool_settings.sculpt
         settings = self.paint_settings(context)
         brush = settings.brush
 
@@ -906,8 +892,8 @@ class VIEW3D_PT_sculpt_dyntopo_remesh(Panel, View3DPaintPanel):
         layout.use_property_split = True
         layout.use_property_decorate = False
 
-        toolsettings = context.tool_settings
-        sculpt = toolsettings.sculpt
+        tool_settings = context.tool_settings
+        sculpt = tool_settings.sculpt
 
         col = layout.column()
         col.active = context.sculpt_object.use_dynamic_topology_sculpting
@@ -925,6 +911,8 @@ class VIEW3D_PT_sculpt_dyntopo_remesh(Panel, View3DPaintPanel):
             col.operator("sculpt.detail_flood_fill")
 
 # TODO, move to space_view3d.py
+
+
 class VIEW3D_PT_sculpt_options(Panel, View3DPaintPanel):
     bl_context = ".sculpt_mode"  # dot on purpose (access from topbar)
     bl_label = "Options"
@@ -939,8 +927,8 @@ class VIEW3D_PT_sculpt_options(Panel, View3DPaintPanel):
         layout.use_property_split = True
         layout.use_property_decorate = False
 
-        toolsettings = context.tool_settings
-        sculpt = toolsettings.sculpt
+        tool_settings = context.tool_settings
+        sculpt = tool_settings.sculpt
 
         flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
 
@@ -972,6 +960,7 @@ class VIEW3D_PT_sculpt_options_unified(Panel, View3DPaintPanel):
 
         self.unified_paint_settings(layout, context)
 
+
 class VIEW3D_PT_sculpt_options_gravity(Panel, View3DPaintPanel):
     bl_context = ".sculpt_mode"  # dot on purpose (access from topbar)
     bl_parent_id = "VIEW3D_PT_sculpt_options"
@@ -986,8 +975,8 @@ class VIEW3D_PT_sculpt_options_gravity(Panel, View3DPaintPanel):
         layout.use_property_split = True
         layout.use_property_decorate = False
 
-        toolsettings = context.tool_settings
-        sculpt = toolsettings.sculpt
+        tool_settings = context.tool_settings
+        sculpt = tool_settings.sculpt
         capabilities = sculpt.brush.sculpt_capabilities
 
         col = layout.column()
@@ -1150,8 +1139,8 @@ class VIEW3D_PT_tools_weightpaint_symmetry(Panel, View3DPaintPanel):
 
     def draw(self, context):
         layout = self.layout
-        toolsettings = context.tool_settings
-        wpaint = toolsettings.weight_paint
+        tool_settings = context.tool_settings
+        wpaint = tool_settings.weight_paint
         draw_vpaint_symmetry(layout, wpaint)
 
 
@@ -1203,8 +1192,8 @@ class VIEW3D_PT_tools_vertexpaint_symmetry(Panel, View3DPaintPanel):
 
     def draw(self, context):
         layout = self.layout
-        toolsettings = context.tool_settings
-        vpaint = toolsettings.vertex_paint
+        tool_settings = context.tool_settings
+        vpaint = tool_settings.vertex_paint
         draw_vpaint_symmetry(layout, vpaint)
 
 
@@ -1222,8 +1211,8 @@ class VIEW3D_PT_tools_imagepaint_external(Panel, View3DPaintPanel):
         layout.use_property_split = True
         layout.use_property_decorate = False
 
-        toolsettings = context.tool_settings
-        ipaint = toolsettings.image_paint
+        tool_settings = context.tool_settings
+        ipaint = tool_settings.image_paint
 
         layout.prop(ipaint, "screen_grab_size", text="Screen Grab Size")
 
@@ -1247,8 +1236,8 @@ class VIEW3D_PT_tools_imagepaint_symmetry(Panel, View3DPaintPanel):
     def draw(self, context):
         layout = self.layout
 
-        toolsettings = context.tool_settings
-        ipaint = toolsettings.image_paint
+        tool_settings = context.tool_settings
+        ipaint = tool_settings.image_paint
 
         split = layout.split()
 
@@ -1281,8 +1270,8 @@ class VIEW3D_PT_tools_projectpaint(View3DPaintPanel, Panel):
         layout.use_property_split = True
         layout.use_property_decorate = False
 
-        toolsettings = context.tool_settings
-        ipaint = toolsettings.image_paint
+        tool_settings = context.tool_settings
+        ipaint = tool_settings.image_paint
 
         row = layout.row()
         row.prop(ipaint, "use_normal_falloff")
@@ -1302,6 +1291,7 @@ class VIEW3D_PT_tools_projectpaint(View3DPaintPanel, Panel):
         col = flow.column()
         col.prop(ipaint, "use_backface_culling")
 
+
 class VIEW3D_PT_tools_projectpaint_unified(Panel, View3DPaintPanel):
     bl_context = ".imagepaint"  # dot on purpose (access from topbar)
     bl_parent_id = "VIEW3D_PT_tools_projectpaint"
@@ -1314,6 +1304,7 @@ class VIEW3D_PT_tools_projectpaint_unified(Panel, View3DPaintPanel):
 
         self.unified_paint_settings(layout, context)
 
+
 class VIEW3D_PT_tools_projectpaint_cavity(View3DPaintPanel, Panel):
     bl_context = ".imagepaint"  # dot on purpose (access from topbar)
     bl_label = "Cavity Mask"
@@ -1321,16 +1312,16 @@ class VIEW3D_PT_tools_projectpaint_cavity(View3DPaintPanel, Panel):
     bl_options = {'DEFAULT_CLOSED'}
 
     def draw_header(self, context):
-        toolsettings = context.tool_settings
-        ipaint = toolsettings.image_paint
+        tool_settings = context.tool_settings
+        ipaint = tool_settings.image_paint
 
         self.layout.prop(ipaint, "use_cavity", text="")
 
     def draw(self, context):
         layout = self.layout
 
-        toolsettings = context.tool_settings
-        ipaint = toolsettings.image_paint
+        tool_settings = context.tool_settings
+        ipaint = tool_settings.image_paint
 
         layout.active = ipaint.use_cavity
 
@@ -1446,14 +1437,16 @@ class VIEW3D_PT_tools_normal(View3DPanel, Panel):
         layout.use_property_split = True
         layout.use_property_decorate = False  # No animation.
 
-        toolsettings = context.tool_settings
+        tool_settings = context.tool_settings
 
-        layout.prop(toolsettings, "normal_vector", text="Normal Vector")
-        layout.prop(toolsettings, "face_strength", text="Face Strength")
+        layout.prop(tool_settings, "normal_vector", text="Normal Vector")
+        layout.prop(tool_settings, "face_strength", text="Face Strength")
 
 # ********** grease pencil object tool panels ****************
 
 # Grease Pencil drawing brushes
+
+
 class VIEW3D_PT_tools_grease_pencil_brush(View3DPanel, Panel):
     bl_context = ".greasepencil_paint"
     bl_label = "Brush"
@@ -1476,15 +1469,15 @@ class VIEW3D_PT_tools_grease_pencil_brush(View3DPanel, Panel):
         layout.use_property_split = True
         layout.use_property_decorate = False
 
-        ts = context.scene.tool_settings
-        settings = ts.gpencil_paint
+        tool_settings = context.scene.tool_settings
+        gpencil_paint = tool_settings.gpencil_paint
 
         row = layout.row()
         col = row.column()
-        col.template_ID_preview(settings, "brush", new="brush.add_gpencil", rows=3, cols=8)
+        col.template_ID_preview(gpencil_paint, "brush", new="brush.add_gpencil", rows=3, cols=8)
 
         col = row.column()
-        brush = context.active_gpencil_brush
+        brush = gpencil_paint.brush
 
         sub = col.column(align=True)
         sub.operator("gpencil.brush_presets_create", icon='HELP', text="")
@@ -1492,55 +1485,14 @@ class VIEW3D_PT_tools_grease_pencil_brush(View3DPanel, Panel):
         if brush is not None:
             gp_settings = brush.gpencil_settings
 
-            # XXX: Items in "sub" currently show up beside the brush selector in a separate column
-            if brush.gpencil_tool == 'ERASE':
-                sub.prop(gp_settings, "use_default_eraser", text="")
-
-            # Brush details
-            if brush.gpencil_tool == 'ERASE':
-                row = layout.row(align=True)
-                row.prop(brush, "size", text="Radius")
-                row.prop(gp_settings, "use_pressure", text="", icon='STYLUS_PRESSURE')
-                row.prop(gp_settings, "use_occlude_eraser", text="", icon='XRAY')
-
-                if gp_settings.eraser_mode == 'SOFT':
-                    row = layout.row(align=True)
-                    row.prop(gp_settings, "pen_strength", slider=True)
-                    row.prop(gp_settings, "use_strength_pressure", text="", icon='STYLUS_PRESSURE')
-                    row = layout.row(align=True)
-                    row.prop(gp_settings, "eraser_strength_factor")
-                    row = layout.row(align=True)
-                    row.prop(gp_settings, "eraser_thickness_factor")
-            elif brush.gpencil_tool == 'FILL':
-                col = layout.column(align=True)
-                col.prop(gp_settings, "fill_leak", text="Leak Size")
-                col.separator()
-                col.prop(brush, "size", text="Thickness")
-                col.prop(gp_settings, "fill_simplify_level", text="Simplify")
-
-                col = layout.row(align=True)
-                col.template_ID(gp_settings, "material")
-
-                row = layout.row(align=True)
-                row.prop(gp_settings, "fill_draw_mode", text="Boundary Draw Mode")
-                row.prop(gp_settings, "show_fill_boundary", text="", icon='GRID')
-
-                col = layout.column(align=True)
-                col.enabled = gp_settings.fill_draw_mode != 'STROKE'
-                col.prop(gp_settings, "show_fill", text="Ignore Transparent Strokes")
-                sub = col.row(align=True)
-                sub.enabled = not gp_settings.show_fill
-                sub.prop(gp_settings, "fill_threshold", text="Threshold")
-            else:  # bgpsettings.tool == 'DRAW':
-                row = layout.row(align=True)
-                row.prop(brush, "size", text="Radius")
-                row.prop(gp_settings, "use_pressure", text="", icon='STYLUS_PRESSURE')
-                row = layout.row(align=True)
-                row.prop(gp_settings, "pen_strength", slider=True)
-                row.prop(gp_settings, "use_strength_pressure", text="", icon='STYLUS_PRESSURE')
-
-                row = layout.row(align=True)
-                row.template_ID(gp_settings, "material")
+            if brush.gpencil_tool in {'DRAW', 'FILL'}:
+                layout.row(align=True).template_ID(gp_settings, "material")
+
+            if not self.is_popover:
+                from .properties_paint_common import (
+                    brush_basic_gpencil_paint_settings,
+                )
+                brush_basic_gpencil_paint_settings(layout, context, brush, compact=True)
 
 
 # Grease Pencil drawing brushes options
@@ -1551,8 +1503,8 @@ class VIEW3D_PT_tools_grease_pencil_brush_option(View3DPanel, Panel):
 
     @classmethod
     def poll(cls, context):
-        brush = context.active_gpencil_brush
-        return brush is not None and brush.gpencil_tool != 'ERASE'
+        brush = context.tool_settings.gpencil_paint.brush
+        return brush is not None and brush.gpencil_tool not in {'ERASE', 'FILL'}
 
     def draw_header_preset(self, context):
         VIEW3D_PT_gpencil_brush_presets.draw_panel_header(self.layout)
@@ -1563,7 +1515,7 @@ class VIEW3D_PT_tools_grease_pencil_brush_option(View3DPanel, Panel):
         layout.use_property_split = True
         layout.use_property_decorate = False
 
-        brush = context.active_gpencil_brush
+        brush = context.tool_settings.gpencil_paint.brush
         gp_settings = brush.gpencil_settings
 
         if brush is not None:
@@ -1587,11 +1539,11 @@ class VIEW3D_PT_tools_grease_pencil_brush_stabilizer(View3DPanel, Panel):
 
     @classmethod
     def poll(cls, context):
-        brush = context.active_gpencil_brush
+        brush = context.tool_settings.gpencil_paint.brush
         return brush is not None and brush.gpencil_tool == 'DRAW'
 
     def draw_header(self, context):
-        brush = context.active_gpencil_brush
+        brush = context.tool_settings.gpencil_paint.brush
         gp_settings = brush.gpencil_settings
         self.layout.prop(gp_settings, "use_settings_stabilizer", text="")
 
@@ -1601,7 +1553,7 @@ class VIEW3D_PT_tools_grease_pencil_brush_stabilizer(View3DPanel, Panel):
         layout.use_property_split = True
         layout.use_property_decorate = False
 
-        brush = context.active_gpencil_brush
+        brush = context.tool_settings.gpencil_paint.brush
         gp_settings = brush.gpencil_settings
         layout.active = gp_settings.use_settings_stabilizer
 
@@ -1617,11 +1569,11 @@ class VIEW3D_PT_tools_grease_pencil_brush_settings(View3DPanel, Panel):
 
     @classmethod
     def poll(cls, context):
-        brush = context.active_gpencil_brush
+        brush = context.tool_settings.gpencil_paint.brush
         return brush is not None and brush.gpencil_tool != 'ERASE'
 
     def draw_header(self, context):
-        brush = context.active_gpencil_brush
+        brush = context.tool_settings.gpencil_paint.brush
         gp_settings = brush.gpencil_settings
         self.layout.prop(gp_settings, "use_settings_postprocess", text="")
 
@@ -1631,7 +1583,7 @@ class VIEW3D_PT_tools_grease_pencil_brush_settings(View3DPanel, Panel):
         layout.use_property_split = True
         layout.use_property_decorate = False
 
-        brush = context.active_gpencil_brush
+        brush = context.tool_settings.gpencil_paint.brush
         gp_settings = brush.gpencil_settings
         layout.active = gp_settings.use_settings_postprocess
 
@@ -1656,11 +1608,11 @@ class VIEW3D_PT_tools_grease_pencil_brush_random(View3DPanel, Panel):
 
     @classmethod
     def poll(cls, context):
-        brush = context.active_gpencil_brush
+        brush = context.tool_settings.gpencil_paint.brush
         return brush is not None and brush.gpencil_tool != 'ERASE'
 
     def draw_header(self, context):
-        brush = context.active_gpencil_brush
+        brush = context.tool_settings.gpencil_paint.brush
         gp_settings = brush.gpencil_settings
         self.layout.prop(gp_settings, "use_settings_random", text="")
 
@@ -1670,7 +1622,7 @@ class VIEW3D_PT_tools_grease_pencil_brush_random(View3DPanel, Panel):
         layout.use_property_split = True
         layout.use_property_decorate = False
 
-        brush = context.active_gpencil_brush
+        brush = context.tool_settings.gpencil_paint.brush
         gp_settings = brush.gpencil_settings
         layout.active = gp_settings.use_settings_random
 
@@ -1691,8 +1643,8 @@ class VIEW3D_PT_tools_grease_pencil_brushcurves(View3DPanel, Panel):
 
     @classmethod
     def poll(cls, context):
-        brush = context.active_gpencil_brush
-        return brush is not None and brush.gpencil_tool != 'ERASE'
+        brush = context.tool_settings.gpencil_paint.brush
+        return brush is not None and brush.gpencil_tool not in {'ERASE', 'FILL'}
 
     @staticmethod
     def draw(self, context):
@@ -1702,14 +1654,14 @@ class VIEW3D_PT_tools_grease_pencil_brushcurves(View3DPanel, Panel):
 class VIEW3D_PT_tools_grease_pencil_brushcurves_sensitivity(View3DPanel, Panel):
     bl_context = ".greasepencil_paint"
     bl_label = "Sensitivity"
-    bl_parent_id ="VIEW3D_PT_tools_grease_pencil_brushcurves"
+    bl_parent_id = "VIEW3D_PT_tools_grease_pencil_brushcurves"
 
     @staticmethod
     def draw(self, context):
         layout = self.layout
         layout.use_property_split = True
 
-        brush = context.active_gpencil_brush
+        brush = context.tool_settings.gpencil_paint.brush
         gp_settings = brush.gpencil_settings
 
         layout.template_curve_mapping(gp_settings, "curve_sensitivity", brush=True)
@@ -1718,14 +1670,14 @@ class VIEW3D_PT_tools_grease_pencil_brushcurves_sensitivity(View3DPanel, Panel):
 class VIEW3D_PT_tools_grease_pencil_brushcurves_strength(View3DPanel, Panel):
     bl_context = ".greasepencil_paint"
     bl_label = "Strength"
-    bl_parent_id ="VIEW3D_PT_tools_grease_pencil_brushcurves"
+    bl_parent_id = "VIEW3D_PT_tools_grease_pencil_brushcurves"
 
     @staticmethod
     def draw(self, context):
         layout = self.layout
         layout.use_property_split = True
 
-        brush = context.active_gpencil_brush
+        brush = context.tool_settings.gpencil_paint.brush
         gp_settings = brush.gpencil_settings
 
         layout.template_curve_mapping(gp_settings, "curve_strength", brush=True)
@@ -1734,14 +1686,14 @@ class VIEW3D_PT_tools_grease_pencil_brushcurves_strength(View3DPanel, Panel):
 class VIEW3D_PT_tools_grease_pencil_brushcurves_jitter(View3DPanel, Panel):
     bl_context = ".greasepencil_paint"
     bl_label = "Jitter"
-    bl_parent_id ="VIEW3D_PT_tools_grease_pencil_brushcurves"
+    bl_parent_id = "VIEW3D_PT_tools_grease_pencil_brushcurves"
 
     @staticmethod
     def draw(self, context):
         layout = self.layout
         layout.use_property_split = True
 
-        brush = context.active_gpencil_brush
+        brush = context.tool_settings.gpencil_paint.brush
         gp_settings = brush.gpencil_settings
 
         layout.template_curve_mapping(gp_settings, "curve_jitter", brush=True)
@@ -1824,12 +1776,12 @@ class VIEW3D_PT_tools_grease_pencil_weight_paint(View3DPanel, Panel):
         layout.template_icon_view(settings, "weight_tool", show_labels=True)
 
         col = layout.column()
-        col.prop(brush, "size", slider=True)
-        row = col.row(align=True)
-        row.prop(brush, "strength", slider=True)
-        row.prop(brush, "use_pressure_strength", text="")
 
-        col.prop(brush, "use_falloff")
+        if not self.is_popover:
+            from .properties_paint_common import (
+                brush_basic_gpencil_weight_settings,
+            )
+            brush_basic_gpencil_weight_settings(col, context, brush)
 
 
 # Grease Pencil Brush Appeareance (one for each mode)