[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [29758] branches/soc-2010-jwilkins: == Reverted Image Icons ==

Jason Wilkins Jason.A.Wilkins at gmail.com
Mon Jun 28 05:05:40 CEST 2010


Revision: 29758
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=29758
Author:   jwilkins
Date:     2010-06-28 05:05:40 +0200 (Mon, 28 Jun 2010)

Log Message:
-----------
== Reverted Image Icons ==
Serious error causes a crash for .blend files saved with icons for brushes when being reloaded or unloaded.

Reverted the image icon stuff until I can get a handle on what it is.

Modified Paths:
--------------
    branches/soc-2010-jwilkins/release/scripts/ui/space_view3d_toolbar.py
    branches/soc-2010-jwilkins/source/blender/blenkernel/intern/brush.c
    branches/soc-2010-jwilkins/source/blender/blenkernel/intern/icons.c
    branches/soc-2010-jwilkins/source/blender/editors/interface/interface_icons.c
    branches/soc-2010-jwilkins/source/blender/editors/render/render_preview.c
    branches/soc-2010-jwilkins/source/blender/makesdna/DNA_brush_types.h
    branches/soc-2010-jwilkins/source/blender/makesrna/intern/rna_brush.c

Modified: branches/soc-2010-jwilkins/release/scripts/ui/space_view3d_toolbar.py
===================================================================
--- branches/soc-2010-jwilkins/release/scripts/ui/space_view3d_toolbar.py	2010-06-28 03:03:05 UTC (rev 29757)
+++ branches/soc-2010-jwilkins/release/scripts/ui/space_view3d_toolbar.py	2010-06-28 03:05:40 UTC (rev 29758)
@@ -878,9 +878,9 @@
             sub = col.column()
             sub.prop(brush, "add_col", text="Color")
 
-        col.separator()
-        col.label(text="Icon:")
-        col.template_ID_preview(brush, "image_icon", open="image.open", rows=3, cols=4)
+        #col.separator()
+        #col.label(text="Icon:")
+        #col.template_ID_preview(brush, "image_icon", open="image.open", rows=3, cols=4)
 
         col.separator()
         split = self.layout.split()

Modified: branches/soc-2010-jwilkins/source/blender/blenkernel/intern/brush.c
===================================================================
--- branches/soc-2010-jwilkins/source/blender/blenkernel/intern/brush.c	2010-06-28 03:03:05 UTC (rev 29757)
+++ branches/soc-2010-jwilkins/source/blender/blenkernel/intern/brush.c	2010-06-28 03:05:40 UTC (rev 29758)
@@ -131,7 +131,10 @@
 	brush->id.flag |= LIB_FAKEUSER;
 	brush_toggled_fake_user(brush);
 	
-	return brush;	
+	//brush->preview = NULL;
+	//brush->image_icon = NULL;
+
+	return brush;
 }
 
 Brush *copy_brush(Brush *brush)
@@ -158,7 +161,7 @@
 {
 	if(brush->mtex.tex) brush->mtex.tex->id.us--;
 
-	BKE_previewimg_free(&brush->preview);
+	// BKE_previewimg_free(&brush->preview);  // XXX:image_icon
 
 	curvemapping_free(brush->curve);
 }

Modified: branches/soc-2010-jwilkins/source/blender/blenkernel/intern/icons.c
===================================================================
--- branches/soc-2010-jwilkins/source/blender/blenkernel/intern/icons.c	2010-06-28 03:03:05 UTC (rev 29757)
+++ branches/soc-2010-jwilkins/source/blender/blenkernel/intern/icons.c	2010-06-28 03:05:40 UTC (rev 29758)
@@ -176,7 +176,7 @@
 	} else if (GS(id->name) == ID_IM) {
 		Image *img  = (Image*)id;
 		BKE_previewimg_free(&img->preview);
-	} else if (GS(id->name) == ID_BR) {
+	} /* else if (GS(id->name) == ID_BR) {
 		Brush *br = (Brush*)id;
 		if (br->image_icon) {
 			BKE_previewimg_free(&br->preview);
@@ -185,7 +185,7 @@
 			if (br->mtex.tex)
 				BKE_previewimg_free(&br->mtex.tex->preview);
 		}
-	}
+	} */  // XXX:image_icon
 }
 
 PreviewImage* BKE_previewimg_get(ID *id) 
@@ -212,7 +212,7 @@
 		Image *img  = (Image*)id;
 		if (!img->preview) img->preview = BKE_previewimg_create();
 		prv_img = img->preview;
-	} else if (GS(id->name) == ID_BR) {
+	} /* else if (GS(id->name) == ID_BR) {
 		Brush *br = (Brush*)id;
 		if (br->image_icon) {
 			if (!br->preview)
@@ -226,7 +226,7 @@
 
 			prv_img = br->mtex.tex ? br->mtex.tex->preview : NULL;
 		}
-	}
+	} */  // XXX:image_icon
 
 	return prv_img;
 }

Modified: branches/soc-2010-jwilkins/source/blender/editors/interface/interface_icons.c
===================================================================
--- branches/soc-2010-jwilkins/source/blender/editors/interface/interface_icons.c	2010-06-28 03:03:05 UTC (rev 29757)
+++ branches/soc-2010-jwilkins/source/blender/editors/interface/interface_icons.c	2010-06-28 03:05:40 UTC (rev 29758)
@@ -977,7 +977,7 @@
 		case ID_IM: /* fall through */
 		case ID_WO: /* fall through */
 		case ID_LA: /* fall through */
-		case ID_BR: /* fall through */
+		//case ID_BR: /* fall through */  // XXX:image_icon
 			iconid= BKE_icon_getid(id);
 			/* checks if not exists, or changed */
 			ui_id_icon_render(C, id, preview);

Modified: branches/soc-2010-jwilkins/source/blender/editors/render/render_preview.c
===================================================================
--- branches/soc-2010-jwilkins/source/blender/editors/render/render_preview.c	2010-06-28 03:03:05 UTC (rev 29757)
+++ branches/soc-2010-jwilkins/source/blender/editors/render/render_preview.c	2010-06-28 03:05:40 UTC (rev 29758)
@@ -291,7 +291,7 @@
 		
 		sce->r.color_mgt_flag = scene->r.color_mgt_flag;
 		/* exception: don't color manage texture previews or icons */
-		if((sp && sp->pr_method==PR_ICON_RENDER) || (id_type == ID_TE  || (id_type==ID_BR && id && ((Brush*)id)->image_icon==NULL)))
+		if((sp && sp->pr_method==PR_ICON_RENDER) || (id_type == ID_TE  /*|| (id_type==ID_BR && id && ((Brush*)id)->image_icon==NULL)*/)) // XXX:image_icon
 			sce->r.color_mgt_flag &= ~R_COLOR_MANAGEMENT;
 		if((sp && sp->pr_method==PR_ICON_RENDER) && id_type != ID_WO)
 			sce->r.alphamode= R_ALPHAPREMUL;
@@ -379,8 +379,8 @@
 				}
 			}
 		}
-		else if(id_type==ID_TE || (id_type==ID_BR && id && ((Brush*)id)->image_icon==NULL)) {
-			Tex *tex= id_type==ID_BR ? ((Brush*)id)->mtex.tex : (Tex*)id;
+		else if(id_type==ID_TE /*|| (id_type==ID_BR && id && ((Brush*)id)->image_icon==NULL)*/) {  // XXX:image_icon
+			Tex *tex= /*id_type==ID_BR ? ((Brush*)id)->mtex.tex : */ (Tex*)id;  // XXX:image_icon
 			
 			sce->lay= 1<<MA_TEXTURE;
 			
@@ -452,7 +452,7 @@
 	int gamma_correct=0;
 	int offx=0, newx= rect->xmax-rect->xmin, newy= rect->ymax-rect->ymin;
 
-	if (id && (GS(id->name) != ID_TE  || !(GS(id->name)==ID_BR && ((Brush*)id)->image_icon==NULL))) {
+	if (id && (GS(id->name) != ID_TE /* || !(GS(id->name)==ID_BR && ((Brush*)id)->image_icon==NULL)*/)) {  // XXX:image_icon
 		/* exception: don't color manage texture previews - show the raw values */
 		if (sce) gamma_correct = sce->r.color_mgt_flag & R_COLOR_MANAGEMENT;
 	}
@@ -902,7 +902,7 @@
 	}
 	else if(sp->pr_method==PR_NODE_RENDER) {
 		if(idtype == ID_MA) sce->r.scemode |= R_MATNODE_PREVIEW;
-		else if(idtype == ID_TE  || (idtype==ID_BR && ((Brush*)id)->image_icon==NULL)) sce->r.scemode |= R_TEXNODE_PREVIEW;
+		else if(idtype == ID_TE /* || (idtype==ID_BR && ((Brush*)id)->image_icon==NULL)*/) sce->r.scemode |= R_TEXNODE_PREVIEW; // XXX:image_icon
 		sce->r.mode |= R_OSA;
 	}
 	else {	/* PR_BUTS_RENDER */
@@ -1044,8 +1044,8 @@
 	ID *id= sp->id;
 	short idtype= GS(id->name);
 
-	if(idtype == ID_IM || (idtype == ID_BR && ((Brush*)id)->image_icon)) {
-		Image *ima= idtype==ID_BR ? ((Brush*)id)->image_icon : (Image*)id;
+	if(idtype == ID_IM /*|| (idtype == ID_BR && ((Brush*)id)->image_icon)*/) {  // XXX:image_icon
+		Image *ima= /* idtype==ID_BR ? ((Brush*)id)->image_icon : */ (Image*)id;  // XXX:image_icon
 		ImBuf *ibuf= NULL;
 		ImageUser iuser;
 

Modified: branches/soc-2010-jwilkins/source/blender/makesdna/DNA_brush_types.h
===================================================================
--- branches/soc-2010-jwilkins/source/blender/makesdna/DNA_brush_types.h	2010-06-28 03:03:05 UTC (rev 29757)
+++ branches/soc-2010-jwilkins/source/blender/makesdna/DNA_brush_types.h	2010-06-28 03:05:40 UTC (rev 29758)
@@ -53,8 +53,8 @@
 	struct BrushClone clone;
 	struct CurveMapping *curve;	/* falloff curve */
 	struct MTex mtex;
-	struct Image *image_icon;
-	struct PreviewImage *preview;
+	//struct Image *image_icon;  // XXX:image_icon
+	//struct PreviewImage *preview;  // XXX:image_icon
 
 	int strength_multiplier;		/* increases the strength by a multiplier */
 

Modified: branches/soc-2010-jwilkins/source/blender/makesrna/intern/rna_brush.c
===================================================================
--- branches/soc-2010-jwilkins/source/blender/makesrna/intern/rna_brush.c	2010-06-28 03:03:05 UTC (rev 29757)
+++ branches/soc-2010-jwilkins/source/blender/makesrna/intern/rna_brush.c	2010-06-28 03:05:40 UTC (rev 29758)
@@ -509,11 +509,11 @@
 	RNA_def_property_ui_text(prop, "Subract Color", "Color of cursor when subtracting");
 	RNA_def_property_update(prop, 0, "rna_Brush_update");
 
-	prop= RNA_def_property(srna, "image_icon", PROP_POINTER, PROP_NONE);
-	RNA_def_property_pointer_sdna(prop, NULL, "image_icon");
-	RNA_def_property_flag(prop, PROP_EDITABLE);
-	RNA_def_property_ui_text(prop, "Image Icon", "");
-	RNA_def_property_update(prop, NC_IMAGE, "rna_Brush_update");
+	//prop= RNA_def_property(srna, "image_icon", PROP_POINTER, PROP_NONE);
+	//RNA_def_property_pointer_sdna(prop, NULL, "image_icon");
+	//RNA_def_property_flag(prop, PROP_EDITABLE);
+	//RNA_def_property_ui_text(prop, "Image Icon", "");
+	//RNA_def_property_update(prop, NC_IMAGE, "rna_Brush_update");
 
 	/* clone tool */
 	prop= RNA_def_property(srna, "clone_image", PROP_POINTER, PROP_NONE);





More information about the Bf-blender-cvs mailing list