From 0e2c8cdcdd13a49560e6f105de530c2ef94ed4e4 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 21 Nov 2011 20:19:58 +0000 Subject: move image settings into their own structure so the interface can be shared where image saving settings are needed. currently file out node and render output share this struct & UI. --- source/blender/blenloader/intern/readfile.c | 67 +++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index b1ddb894e67..dcde4ac421b 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -7348,6 +7348,67 @@ static void do_versions_nodetree_convert_angle(bNodeTree *ntree) } } +void do_versions_image_settings_2_60(Scene *sce) +{ + /* note: rd->subimtype is moved into indervidual settings now and no longer + * exists */ + RenderData *rd= &sce->r; + ImageFormatData *imf= &sce->r.im_format; + + imf->imtype= rd->imtype; + imf->planes= rd->planes; + imf->compress= rd->quality; + imf->quality= rd->quality; + + /* default, was stored in multiple places, may override later */ + imf->depth= R_IMF_CHAN_DEPTH_8; + + /* openexr */ + imf->exr_codec = rd->quality & 7; /* strange but true! 0-4 are valid values */ + + switch (imf->imtype) { + case R_OPENEXR: + imf->depth= (rd->subimtype & R_OPENEXR_HALF) ? R_IMF_CHAN_DEPTH_16 : R_IMF_CHAN_DEPTH_32; + if (rd->subimtype & R_PREVIEW_JPG) { + imf->flag |= R_IMF_FLAG_PREVIEW_JPG; + } + if (rd->subimtype & R_OPENEXR_ZBUF) { + imf->flag |= R_IMF_FLAG_ZBUF; + } + break; + case R_TIFF: + if (rd->subimtype & R_TIFF_16BIT) { + imf->depth= R_IMF_CHAN_DEPTH_16; + } + break; + case R_JP2: + if (rd->subimtype & R_JPEG2K_16BIT) { + imf->depth= R_IMF_CHAN_DEPTH_16; + } + else if (rd->subimtype & R_JPEG2K_12BIT) { + imf->depth= R_IMF_CHAN_DEPTH_12; + } + + if (rd->subimtype & R_JPEG2K_YCC) { + imf->jp2_flag |= R_IMF_JP2_FLAG_YCC; + } + if (rd->subimtype & R_JPEG2K_CINE_PRESET) { + imf->jp2_flag |= R_IMF_JP2_FLAG_CINE_PRESET; + } + if (rd->subimtype & R_JPEG2K_CINE_48FPS) { + imf->jp2_flag |= R_IMF_JP2_FLAG_CINE_48; + } + break; + case R_CINEON: + case R_DPX: + if (rd->subimtype & R_CINEON_LOG) { + imf->cineon_flag |= R_IMF_CINEON_FLAG_LOG; + } + break; + } + +} + static void do_versions(FileData *fd, Library *lib, Main *main) { /* WATCH IT!!!: pointers from libdata have not been converted */ @@ -12544,6 +12605,12 @@ static void do_versions(FileData *fd, Library *lib, Main *main) /* put compatibility code here until next subversion bump */ { + Scene *sce; + for(sce = main->scene.first; sce; sce = sce->id.next) { + if (sce->r.im_format.depth == 0) { + do_versions_image_settings_2_60(sce); + } + } } /* WATCH IT!!!: pointers from libdata have not been converted yet here! */ -- cgit v1.2.3