Merge branch 'blender-v4.5-release'

This commit is contained in:
Falk David
2025-07-07 11:14:52 +02:00
4 changed files with 65 additions and 34 deletions

View File

@@ -1632,6 +1632,8 @@ def brush_basic_gpencil_paint_settings(layout, context, brush, *, compact=False)
tool_settings = context.tool_settings
settings = tool_settings.gpencil_paint
gp_settings = brush.gpencil_settings
ups = tool_settings.unified_paint_settings
brush_prop_owner = ups if ups.use_unified_size else brush
tool = context.workspace.tools.from_space_view3d_mode(context.mode, create=False)
if gp_settings is None:
return
@@ -1640,15 +1642,16 @@ def brush_basic_gpencil_paint_settings(layout, context, brush, *, compact=False)
if brush.gpencil_brush_type == 'ERASE':
row = layout.row(align=True)
row.prop(brush, "size", text="Radius")
row.prop(gp_settings, "use_pressure", text="", icon='STYLUS_PRESSURE')
row.prop(brush, "use_pressure_size", text="", icon='STYLUS_PRESSURE')
row.prop(gp_settings, "use_occlude_eraser", text="", icon='XRAY')
row = layout.row(align=True)
row.prop(gp_settings, "eraser_mode", expand=True)
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.prop(brush_prop_owner, "strength", slider=True)
row.prop(brush, "use_pressure_strength", text="", icon='STYLUS_PRESSURE')
row.prop(ups, "use_unified_strength", text="", icon='BRUSHES_ALL')
row = layout.row(align=True)
row.prop(gp_settings, "eraser_strength_factor")
row = layout.row(align=True)
@@ -1683,8 +1686,9 @@ def brush_basic_gpencil_paint_settings(layout, context, brush, *, compact=False)
col.template_curve_mapping(gp_settings, "curve_sensitivity", brush=True, use_negative_slope=True)
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.prop(brush_prop_owner, "strength", slider=True)
row.prop(brush, "use_pressure_strength", text="", icon='STYLUS_PRESSURE')
row.prop(ups, "use_unified_strength", text="", icon='BRUSHES_ALL')
if gp_settings.use_strength_pressure and not compact:
col = layout.column()
@@ -1882,18 +1886,21 @@ def brush_basic_gpencil_weight_settings(layout, _context, brush, *, compact=Fals
layout.prop(brush, "direction", expand=True, text="" if compact else "Direction")
def brush_basic_gpencil_vertex_settings(layout, _context, brush, *, compact=False):
def brush_basic_gpencil_vertex_settings(layout, context, brush, *, compact=False):
gp_settings = brush.gpencil_settings
ups = context.tool_settings.unified_paint_settings
brush_prop_owner = ups if ups.use_unified_size else brush
# Brush details
row = layout.row(align=True)
row.prop(brush, "size", text="Radius")
row.prop(gp_settings, "use_pressure", text="", icon='STYLUS_PRESSURE')
row.prop(brush, "use_pressure_size", text="", icon='STYLUS_PRESSURE')
if brush.gpencil_vertex_brush_type in {'DRAW', 'BLUR', 'SMEAR'}:
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.prop(brush_prop_owner, "strength", slider=True)
row.prop(brush, "use_pressure_strength", text="", icon='STYLUS_PRESSURE')
row.prop(ups, "use_unified_strength", text="", icon='BRUSHES_ALL')
if brush.gpencil_vertex_brush_type in {'DRAW', 'REPLACE'}:
row = layout.row(align=True)

View File

@@ -8460,12 +8460,22 @@ class VIEW3D_PT_greasepencil_draw_context_menu(Panel):
col.separator()
if brush.gpencil_brush_type not in {'FILL', 'CUTTER', 'ERASE'}:
radius = "size" if (brush.use_locked_size == 'VIEW') else "unprojected_radius"
layout.prop(brush, radius, text="Radius", slider=True)
if brush.use_locked_size == 'VIEW':
row = layout.row(align=True)
row.prop(brush, "size", slider=True)
row.prop(brush, "use_pressure_size", text="", icon='STYLUS_PRESSURE')
else:
row = layout.row(align=True)
row.prop(brush, "unprojected_radius", text="Size", slider=True)
row.prop(brush, "use_pressure_size", text="", icon='STYLUS_PRESSURE')
if brush.gpencil_brush_type == 'ERASE':
layout.prop(brush, "size", slider=True)
row = layout.row(align=True)
row.prop(brush, "size", slider=True)
row.prop(brush, "use_pressure_size", text="", icon='STYLUS_PRESSURE')
if brush.gpencil_brush_type not in {'ERASE', 'FILL', 'CUTTER'}:
layout.prop(gp_settings, "pen_strength")
row = layout.row(align=True)
row.prop(brush, "strength", slider=True)
row.prop(brush, "use_pressure_strength", text="", icon='STYLUS_PRESSURE')
layer = context.object.data.layers.active
@@ -8500,8 +8510,14 @@ class VIEW3D_PT_greasepencil_sculpt_context_menu(Panel):
ups = paint.unified_paint_settings
size_owner = ups if ups.use_unified_size else brush
strength_owner = ups if ups.use_unified_strength else brush
layout.prop(size_owner, "size", text="")
layout.prop(strength_owner, "strength", text="")
row = layout.row(align=True)
row.prop(size_owner, "size", text="")
row.prop(brush, "use_pressure_size", text="", icon='STYLUS_PRESSURE')
row.prop(ups, "use_unified_size", text="", icon='BRUSHES_ALL')
row = layout.row(align=True)
row.prop(strength_owner, "strength", text="")
row.prop(brush, "use_pressure_strength", text="", icon='STYLUS_PRESSURE')
row.prop(ups, "use_unified_strength", text="", icon='BRUSHES_ALL')
layer = context.object.data.layers.active
@@ -8544,9 +8560,12 @@ class VIEW3D_PT_greasepencil_vertex_paint_context_menu(Panel):
row.prop(brush, "use_pressure_size", text="", icon='STYLUS_PRESSURE')
if brush.gpencil_vertex_brush_type in {'DRAW', 'BLUR', 'SMEAR'}:
ups = tool_settings.unified_paint_settings
strength_owner = ups if ups.use_unified_strength else brush
row = layout.row(align=True)
row.prop(brush, "strength", slider=True)
row.prop(strength_owner, "strength", text="")
row.prop(brush, "use_pressure_strength", text="", icon='STYLUS_PRESSURE')
row.prop(ups, "use_unified_strength", text="", icon='BRUSHES_ALL')
layer = context.object.data.layers.active