From 470cfd4aeb010b4a674d27ace3cfffad2ca6c4f0 Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Tue, 22 Nov 2011 17:43:32 +0000 Subject: 2.6 Various code cleanup: * Removed some old code for image packing, done via Operators now. * Removed some comments. --- source/blender/blenkernel/intern/ocean.c | 8 ++--- source/blender/editors/space_image/image_buttons.c | 34 ---------------------- source/blender/editors/space_node/drawnode.c | 6 ++-- source/blender/makesrna/intern/rna_ui_api.c | 3 -- 4 files changed, 5 insertions(+), 46 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/ocean.c b/source/blender/blenkernel/intern/ocean.c index b8f96fa732d..52e4406017b 100644 --- a/source/blender/blenkernel/intern/ocean.c +++ b/source/blender/blenkernel/intern/ocean.c @@ -1208,8 +1208,6 @@ void BKE_bake_ocean(struct Ocean *o, struct OceanCache *och, void (*update_cb)(v 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 @@ void BKE_bake_ocean(struct Ocean *o, struct OceanCache *och, void (*update_cb)(v /* 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); } diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c index adedcde66a6..720102a2b7c 100644 --- a/source/blender/editors/space_image/image_buttons.c +++ b/source/blender/editors/space_image/image_buttons.c @@ -487,38 +487,6 @@ static void image_multi_decpass_cb(bContext *C, void *rr_v, void *iuser_v) } } -#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) { @@ -676,8 +644,6 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, const char 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); diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 47cfa5c763d..29f67844827 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -1001,7 +1001,6 @@ static void node_shader_buts_attribute(uiLayout *layout, bContext *UNUSED(C), Po 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 @@ static void node_composit_buts_file_output(uiLayout *layout, bContext *UNUSED(C) 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); diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index 3c759bc007b..96667c95042 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -399,11 +399,8 @@ void RNA_api_ui_layout(StructRNA *srna) 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"); -- cgit v1.2.3