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-12-01 02:38:31 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-12-01 02:38:31 +0300
commit89abb9f2d2470cf808fd1f42c67d82355d1ade8e (patch)
tree267d5be53e0598558e1aef69dd94a84c10350d71 /source/blender/editors/space_image
parentd9c23d8d5d1cddfe48fbeecee0a23dacd2d60d59 (diff)
bugfix [#22638] Alpha channel not saved when using texture paint
check for alpha channel while saving images that have been painted onto. It would be nicer to do this while in paint mode except this isn't so simple with project paint using multiple images at once.
Diffstat (limited to 'source/blender/editors/space_image')
-rw-r--r--source/blender/editors/space_image/image_ops.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c
index d2cf3365423..be917f43735 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -888,6 +888,13 @@ static void save_image_doit(bContext *C, SpaceImage *sima, Scene *scene, wmOpera
ibuf->depth= 24;
}
}
+ else {
+ /* TODO, better solution, if a 24bit image is painted onto it may contain alpha */
+ if(ibuf->userflags & IB_BITMAPDIRTY) { /* it has been painted onto */
+ /* checks each pixel, not ideal */
+ ibuf->depth= BKE_alphatest_ibuf(ibuf) ? 32 : 24;
+ }
+ }
if(scene->r.scemode & R_EXTENSION) {
BKE_add_image_extension(path, sima->imtypenr);