Fix T73580: Gpencil crash when try to draw without eraser brush available
This commit is contained in:
parent
93a46f7d08
commit
db0121a009
Notes:
blender-bot
2023-02-13 23:34:12 +01:00
Referenced by issue #73580, Greasepencil issue when deleting brush from active tool (incl crash drawing then)
|
@ -996,6 +996,8 @@ def brush_basic_texpaint_settings(layout, context, brush, *, compact=False):
|
|||
def brush_basic_gpencil_paint_settings(layout, context, brush, *, compact=False):
|
||||
gp_settings = brush.gpencil_settings
|
||||
tool = context.workspace.tools.from_space_view3d_mode(context.mode, create=False)
|
||||
if gp_settings is None:
|
||||
return
|
||||
|
||||
# Brush details
|
||||
if brush.gpencil_tool == 'ERASE':
|
||||
|
|
|
@ -1963,6 +1963,9 @@ static Brush *gp_get_default_eraser(Main *bmain, ToolSettings *ts)
|
|||
Paint *paint = &ts->gp_paint->paint;
|
||||
Brush *brush_old = paint->brush;
|
||||
for (Brush *brush = bmain->brushes.first; brush; brush = brush->id.next) {
|
||||
if (brush->gpencil_settings == NULL) {
|
||||
continue;
|
||||
}
|
||||
if ((brush->ob_mode == OB_MODE_PAINT_GPENCIL) && (brush->gpencil_tool == GPAINT_TOOL_ERASE)) {
|
||||
/* save first eraser to use later if no default */
|
||||
if (brush_dft == NULL) {
|
||||
|
|
Loading…
Reference in New Issue