Fix T57083: Grease Pencil / Texture Paint Crash in 2.8
The brush of texture paint hadn't gp_icon
This commit is contained in:
@@ -65,7 +65,7 @@ def generate_from_brushes_ex(
|
||||
|
||||
for brush_type in brush_category_layout:
|
||||
for brush in context.blend_data.brushes:
|
||||
if getattr(brush, brush_test_attr) and brush.gpencil_settings.gp_icon == brush_type[0]:
|
||||
if brush.gpencil_settings and getattr(brush, brush_test_attr) and brush.gpencil_settings.gp_icon == brush_type[0]:
|
||||
category = brush_type[0]
|
||||
name = brush.name
|
||||
text = name
|
||||
|
||||
@@ -1672,7 +1672,10 @@ static int ui_id_brush_get_icon(const bContext *C, ID *id)
|
||||
}
|
||||
|
||||
/* reset the icon */
|
||||
if (ob != NULL && ob->mode & OB_MODE_GPENCIL_PAINT) {
|
||||
if ((ob != NULL) &&
|
||||
(ob->mode & OB_MODE_GPENCIL_PAINT) &&
|
||||
(br->gpencil_settings != NULL))
|
||||
{
|
||||
switch (br->gpencil_settings->icon_id) {
|
||||
case GP_BRUSH_ICON_PENCIL:
|
||||
br->id.icon_id = ICON_GPBRUSH_PENCIL;
|
||||
|
||||
Reference in New Issue
Block a user