GPencil: Show Display Cursor popover for Eraser

The Eraser tool was not showing the display cursor popover.

This commit fixes this inconsistency.
This commit is contained in:
Antonio Vazquez 2022-12-27 16:45:09 +01:00
parent 87594726ab
commit 6aad3c7297
3 changed files with 8 additions and 13 deletions

View File

@ -69,11 +69,8 @@ class GreasePencilDisplayPanel:
ob = context.active_object
brush = context.tool_settings.gpencil_paint.brush
if ob and ob.type == 'GPENCIL' and brush:
if context.mode == 'PAINT_GPENCIL':
return brush.gpencil_tool != 'ERASE'
else:
# GP Sculpt, Vertex and Weight Paint always have Brush Tip panel.
return True
return True
return False
def draw_header(self, context):

View File

@ -1287,9 +1287,6 @@ def brush_basic_gpencil_paint_settings(layout, context, brush, *, compact=False)
row = layout.row(align=True)
row.prop(gp_settings, "eraser_thickness_factor")
row = layout.row(align=True)
row.prop(settings, "show_brush", text="Display Cursor")
# FIXME: tools must use their own UI drawing!
elif brush.gpencil_tool == 'FILL':
use_property_split_prev = layout.use_property_split

View File

@ -99,12 +99,13 @@ class VIEW3D_HT_tool_header(Header):
elif tool_mode == 'PAINT_GPENCIL':
if is_valid_context:
brush = context.tool_settings.gpencil_paint.brush
if brush and brush.gpencil_tool != 'ERASE':
if brush.gpencil_tool != 'TINT':
layout.popover("VIEW3D_PT_tools_grease_pencil_brush_advanced")
if brush:
if brush.gpencil_tool != 'ERASE':
if brush.gpencil_tool != 'TINT':
layout.popover("VIEW3D_PT_tools_grease_pencil_brush_advanced")
if brush.gpencil_tool not in {'FILL', 'TINT'}:
layout.popover("VIEW3D_PT_tools_grease_pencil_brush_stroke")
if brush.gpencil_tool not in {'FILL', 'TINT'}:
layout.popover("VIEW3D_PT_tools_grease_pencil_brush_stroke")
layout.popover("VIEW3D_PT_tools_grease_pencil_paint_appearance")
elif tool_mode == 'SCULPT_GPENCIL':