[Bf-blender-cvs] [d12e7818104] blender2.8: Fix T57083: Grease Pencil / Texture Paint Crash in 2.8

Antonioya noreply at git.blender.org
Mon Oct 8 10:32:55 CEST 2018


Commit: d12e7818104d01af2bec39cec430456a32d6b69c
Author: Antonioya
Date:   Mon Oct 8 10:32:41 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBd12e7818104d01af2bec39cec430456a32d6b69c

Fix T57083: Grease Pencil / Texture Paint Crash in 2.8

The brush of texture paint hadn't gp_icon

===================================================================

M	release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
M	source/blender/editors/interface/interface_icons.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
index 01e9ac33491..601224af84b 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -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
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c
index 162687c64ff..fb8c6ec4c56 100644
--- a/source/blender/editors/interface/interface_icons.c
+++ b/source/blender/editors/interface/interface_icons.c
@@ -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;



More information about the Bf-blender-cvs mailing list