Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-10-28 02:13:05 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-10-28 02:13:05 +0400
commitcbb47c1dac270ee5aba2afbd916230ae5fa1b22f (patch)
tree7b5c5730969181d5be910c082fe6817e3b312088 /source/blender/makesrna/intern/rna_image_api.c
parent58a1ddcc9e5fe4b685ee328fa5318e1261f7c160 (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.c14
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);