[Bf-blender-cvs] [7b635ac] soc-2013-paint: Fix crash reported on irc by nudelZ, entering texture paint mode in cycles crashes. Ensuring data does not work in node materials, don't set image on image editors.

Antony Riakiotakis noreply at git.blender.org
Tue May 27 00:18:52 CEST 2014


Commit: 7b635ac3d36bf37fdd1e0433815c4b3e4721dcf7
Author: Antony Riakiotakis
Date:   Tue May 27 01:18:30 2014 +0300
https://developer.blender.org/rB7b635ac3d36bf37fdd1e0433815c4b3e4721dcf7

Fix crash reported on irc by nudelZ, entering texture paint mode in
cycles crashes. Ensuring data does not work in node materials, don't set
image on image editors.

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

M	source/blender/editors/sculpt_paint/paint_image.c

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

diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index 15c2f41..5c7df32 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -1447,14 +1447,16 @@ static int texture_paint_toggle_exec(bContext *C, wmOperator *op)
 		/* set the current material active paint slot on image editor */
 		ma = give_current_material(ob, ob->actcol);
 
-		for (sc = bmain->screen.first; sc; sc = sc->id.next) {
-			ScrArea *sa;
-			for (sa = sc->areabase.first; sa; sa = sa->next) {
-				SpaceLink *sl;
-				for (sl = sa->spacedata.first; sl; sl = sl->next) {
-					if (sl->spacetype == SPACE_IMAGE) {
-						SpaceImage *sima = (SpaceImage *)sl;
-						ED_space_image_set(sima, scene, scene->obedit, ma->texpaintslot[ma->paint_active_slot].ima);
+		if (ma->tot_slots > 0) {
+			for (sc = bmain->screen.first; sc; sc = sc->id.next) {
+				ScrArea *sa;
+				for (sa = sc->areabase.first; sa; sa = sa->next) {
+					SpaceLink *sl;
+					for (sl = sa->spacedata.first; sl; sl = sl->next) {
+						if (sl->spacetype == SPACE_IMAGE) {
+							SpaceImage *sima = (SpaceImage *)sl;
+							ED_space_image_set(sima, scene, scene->obedit, ma->texpaintslot[ma->paint_active_slot].ima);
+						}
 					}
 				}
 			}




More information about the Bf-blender-cvs mailing list