[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [42074] trunk/blender/source/blender: 2. 6 Various code cleanup:

Thomas Dinges blender at dingto.org
Tue Nov 22 18:43:32 CET 2011


Revision: 42074
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=42074
Author:   dingto
Date:     2011-11-22 17:43:32 +0000 (Tue, 22 Nov 2011)
Log Message:
-----------
2.6 Various code cleanup: 
* Removed some old code for image packing, done via Operators now.
* Removed some comments. 

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/ocean.c
    trunk/blender/source/blender/editors/space_image/image_buttons.c
    trunk/blender/source/blender/editors/space_node/drawnode.c
    trunk/blender/source/blender/makesrna/intern/rna_ui_api.c

Modified: trunk/blender/source/blender/blenkernel/intern/ocean.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/ocean.c	2011-11-22 17:26:40 UTC (rev 42073)
+++ trunk/blender/source/blender/blenkernel/intern/ocean.c	2011-11-22 17:43:32 UTC (rev 42074)
@@ -1208,8 +1208,6 @@
 	imf.depth=  R_IMF_CHAN_DEPTH_16;
 	imf.exr_codec= R_IMF_EXR_CODEC_ZIP; /* ZIP */
 
-
-
 	for (f=och->start, i=0; f<=och->end; f++, i++) {
 
 		/* create a new imbuf to store image for this frame */
@@ -1301,18 +1299,18 @@
 
 		/* write the images */
 		cache_filename(string, och->bakepath, och->relbase, f, CACHE_TYPE_DISPLACE);
-		if(0 == BKE_write_ibuf(ibuf_disp, string, &imf))  // 2 == ZIP exr codec
+		if(0 == BKE_write_ibuf(ibuf_disp, string, &imf))
 			printf("Cannot save Displacement File Output to %s\n", string);
 
 		if (o->_do_jacobian) {
 			cache_filename(string, och->bakepath, och->relbase,  f, CACHE_TYPE_FOAM);
-			if(0 == BKE_write_ibuf(ibuf_foam, string, &imf))  // 2 == ZIP exr codec
+			if(0 == BKE_write_ibuf(ibuf_foam, string, &imf))
 				printf("Cannot save Foam File Output to %s\n", string);
 		}
 
 		if (o->_do_normals) {
 			cache_filename(string, och->bakepath,  och->relbase, f, CACHE_TYPE_NORMAL);
-			if(0 == BKE_write_ibuf(ibuf_normal, string, &imf))  // 2 == ZIP exr codec
+			if(0 == BKE_write_ibuf(ibuf_normal, string, &imf))
 				printf("Cannot save Normal File Output to %s\n", string);
 		}
 

Modified: trunk/blender/source/blender/editors/space_image/image_buttons.c
===================================================================
--- trunk/blender/source/blender/editors/space_image/image_buttons.c	2011-11-22 17:26:40 UTC (rev 42073)
+++ trunk/blender/source/blender/editors/space_image/image_buttons.c	2011-11-22 17:43:32 UTC (rev 42074)
@@ -488,38 +488,6 @@
 }
 
 #if 0
-static void image_pack_cb(bContext *C, void *ima_v, void *iuser_v) 
-{
-	if(ima_v) {
-		Image *ima= ima_v;
-		if(ima->source!=IMA_SRC_SEQUENCE && ima->source!=IMA_SRC_MOVIE) {
-			if (ima->packedfile) {
-				if (G.fileflags & G_AUTOPACK) {
-					if (okee("Disable AutoPack ?")) {
-						G.fileflags &= ~G_AUTOPACK;
-					}
-				}
-				
-				if ((G.fileflags & G_AUTOPACK) == 0) {
-					unpackImage(NULL, ima, PF_ASK); /* XXX report errors */
-					ED_undo_push(C, "Unpack image");
-				}
-			} 
-			else {
-				ImBuf *ibuf= BKE_image_get_ibuf(ima, iuser_v);
-				if (ibuf && (ibuf->userflags & IB_BITMAPDIRTY)) {
-					// XXX error("Can't pack painted image. Save image or use Repack as PNG");
-				} else {
-					ima->packedfile = newPackedFile(NULL, ima->name); /* XXX report errors */
-					ED_undo_push(C, "Pack image");
-				}
-			}
-		}
-	}
-}
-#endif
-
-#if 0
 static void image_freecache_cb(bContext *C, void *ima_v, void *unused) 
 {
 	Scene *scene= CTX_data_scene(C);
@@ -676,8 +644,6 @@
 	if(!compact)
 		uiTemplateID(layout, C, ptr, propname, "IMAGE_OT_new", "IMAGE_OT_open", NULL);
 
-	// XXX missing: reload, pack
-
 	if(ima) {
 		uiBlockSetNFunc(block, rna_update_cb, MEM_dupallocN(cb), NULL);
 

Modified: trunk/blender/source/blender/editors/space_node/drawnode.c
===================================================================
--- trunk/blender/source/blender/editors/space_node/drawnode.c	2011-11-22 17:26:40 UTC (rev 42073)
+++ trunk/blender/source/blender/editors/space_node/drawnode.c	2011-11-22 17:43:32 UTC (rev 42074)
@@ -1001,7 +1001,6 @@
 
 static void node_shader_buts_tex_image(uiLayout *layout, bContext *C, PointerRNA *ptr)
 {
-	//uiItemR(layout, ptr, "image", 0, "", ICON_NONE);
 	uiTemplateID(layout, C, ptr, "image", NULL, "IMAGE_OT_open", NULL);
 	uiItemR(layout, ptr, "color_space", 0, "", ICON_NONE);
 }
@@ -1637,10 +1636,9 @@
 	NodeImageFile *nif= node->storage;
 	PointerRNA imfptr;
 
-	uiLayout *col, *row;
+	uiLayout *row;
 
-	col= uiLayoutColumn(layout, 0);
-	uiItemR(col, ptr, "filepath", 0, "", ICON_NONE);
+	uiItemR(layout, ptr, "filepath", 0, "", ICON_NONE);
 
 	RNA_pointer_create(NULL, &RNA_ImageFormatSettings, &nif->im_format, &imfptr);
 	uiTemplateImageSettings(layout, &imfptr);

Modified: trunk/blender/source/blender/makesrna/intern/rna_ui_api.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_ui_api.c	2011-11-22 17:26:40 UTC (rev 42073)
+++ trunk/blender/source/blender/makesrna/intern/rna_ui_api.c	2011-11-22 17:43:32 UTC (rev 42074)
@@ -399,11 +399,8 @@
 
 	func= RNA_def_function(srna, "template_image_settings", "uiTemplateImageSettings");
 	RNA_def_function_ui_description(func, "User interface for setting image format options");
-	// RNA_def_function_flag(func, FUNC_USE_CONTEXT);
-	// api_ui_item_rna_common(func);
 	parm= RNA_def_pointer(func, "image_settings", "ImageFormatSettings", "", "");
 	RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL);
-	// RNA_def_boolean(func, "compact", 0, "", "Use more compact layout");
 
 	func= RNA_def_function(srna, "template_movieclip", "uiTemplateMovieClip");
 	RNA_def_function_ui_description(func, "Item(s). User interface for selecting movie clips and their source paths");




More information about the Bf-blender-cvs mailing list