2.6 Various code cleanup:

* Removed some old code for image packing, done via Operators now.
* Removed some comments.
This commit is contained in:
Thomas Dinges
2011-11-22 17:43:32 +00:00
parent 5f2c9c660c
commit 470cfd4aeb
4 changed files with 5 additions and 46 deletions

View File

@@ -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);
}

View File

@@ -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);

View File

@@ -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);

View File

@@ -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");