diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-10-28 02:13:05 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-10-28 02:13:05 +0400 |
commit | cbb47c1dac270ee5aba2afbd916230ae5fa1b22f (patch) | |
tree | 7b5c5730969181d5be910c082fe6817e3b312088 /source/blender/makesrna/intern/rna_image_api.c | |
parent | 58a1ddcc9e5fe4b685ee328fa5318e1261f7c160 (diff) |
bugfix [#24287] Saving the render result through the API does not use the scene settings
use scene alpha and dither settings.
Diffstat (limited to 'source/blender/makesrna/intern/rna_image_api.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_image_api.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/source/blender/makesrna/intern/rna_image_api.c b/source/blender/makesrna/intern/rna_image_api.c index 74d61101273..6e495c5db8e 100644 --- a/source/blender/makesrna/intern/rna_image_api.c +++ b/source/blender/makesrna/intern/rna_image_api.c @@ -73,9 +73,17 @@ static void rna_Image_save_render(Image *image, bContext *C, ReportList *reports if (ibuf == NULL) { BKE_reportf(reports, RPT_ERROR, "Couldn't acquire buffer from image"); } - - if (!BKE_write_ibuf(NULL, ibuf, path, scene->r.imtype, scene->r.subimtype, scene->r.quality)) { - BKE_reportf(reports, RPT_ERROR, "Couldn't write image: %s", path); + else { + /* temp swap out the color */ + const unsigned char imb_depth_back= ibuf->depth; + const float dither_back= ibuf->dither; + ibuf->depth= scene->r.planes; + ibuf->dither= scene->r.dither_intensity; + if (!BKE_write_ibuf(NULL, ibuf, path, scene->r.imtype, scene->r.subimtype, scene->r.quality)) { + BKE_reportf(reports, RPT_ERROR, "Couldn't write image: %s", path); + } + ibuf->depth= imb_depth_back; + ibuf->dither= dither_back; } BKE_image_release_ibuf(image, lock); |