[Bf-blender-cvs] [768cb61181f] greasepencil-object: Fix segment fault with material previews

Antonio Vazquez noreply at git.blender.org
Fri Jul 20 19:44:11 CEST 2018


Commit: 768cb61181f7afa5d9cebd19e776a21618d9b8e3
Author: Antonio Vazquez
Date:   Fri Jul 20 19:43:15 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rB768cb61181f7afa5d9cebd19e776a21618d9b8e3

Fix segment fault with material previews

This fix solves the issue with multiple previews at the same time. Maybe there wll be a more general solutions in render preview module, but we need keep the system running.

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

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

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

diff --git a/release/scripts/startup/bl_ui/properties_material_gpencil.py b/release/scripts/startup/bl_ui/properties_material_gpencil.py
index c7cc6f9298e..a18678196fc 100644
--- a/release/scripts/startup/bl_ui/properties_material_gpencil.py
+++ b/release/scripts/startup/bl_ui/properties_material_gpencil.py
@@ -137,7 +137,7 @@ class MATERIAL_PT_gpencil_slots(Panel):
         row = layout.row()
 
         if ob:
-            row.template_ID(ob, "active_material", new="material.new", live_icon=True)
+            row.template_ID(ob, "active_material", new="material.new")
 
             if slot:
                 icon_link = 'MESH_DATA' if slot.link == 'DATA' else 'OBJECT_DATA'
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c
index 371899beeab..9092e4bf253 100644
--- a/source/blender/editors/interface/interface_icons.c
+++ b/source/blender/editors/interface/interface_icons.c
@@ -1672,13 +1672,23 @@ static int ui_id_screen_get_icon(const bContext *C, ID *id)
 int ui_id_icon_get(const bContext *C, ID *id, const bool big)
 {
 	int iconid = 0;
+	bool use_job = true;
+	Material *ma = NULL;
 
 	/* icon */
 	switch (GS(id->name)) {
 		case ID_BR:
 			iconid = ui_id_brush_get_icon(C, id);
 			break;
-		case ID_MA: /* fall through */
+		case ID_MA:
+			ma = (Material *)id;
+			/* grease pencil cannot use jobs or crash */
+			if (ma->gp_style != NULL) {
+				use_job =false;
+			}
+			iconid = BKE_icon_id_ensure(id);
+			UI_id_icon_render(C, NULL, id, big, use_job);
+			break;
 		case ID_TE: /* fall through */
 		case ID_IM: /* fall through */
 		case ID_WO: /* fall through */



More information about the Bf-blender-cvs mailing list