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:
authorIRIE Shinsuke <irieshinsuke@yahoo.co.jp>2014-03-31 09:20:55 +0400
committerIRIE Shinsuke <irieshinsuke@yahoo.co.jp>2014-03-31 12:37:55 +0400
commit6316306cc07c77d4cf6fff52bc8a35ba102b8f56 (patch)
tree39e114bac8220770be52ca1078a0d4318ad82b92 /source/blender
parent2fc7d04804fc9411647466d6765e2716e56a9cc8 (diff)
Fix bug in image texture UI: "Use Alpha" checkbox doesn't appear if file format is BMP.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/BKE_image.h2
-rw-r--r--source/blender/blenkernel/intern/image.c6
-rw-r--r--source/blender/editors/space_image/image_buttons.c2
-rw-r--r--source/blender/makesrna/intern/rna_scene.c4
4 files changed, 8 insertions, 6 deletions
diff --git a/source/blender/blenkernel/BKE_image.h b/source/blender/blenkernel/BKE_image.h
index e36d4bab566..f7fd7450734 100644
--- a/source/blender/blenkernel/BKE_image.h
+++ b/source/blender/blenkernel/BKE_image.h
@@ -73,7 +73,7 @@ int BKE_imtype_supports_zbuf(const char imtype);
int BKE_imtype_supports_compress(const char imtype);
int BKE_imtype_supports_quality(const char imtype);
int BKE_imtype_requires_linear_float(const char imtype);
-char BKE_imtype_valid_channels(const char imtype);
+char BKE_imtype_valid_channels(const char imtype, bool write_file);
char BKE_imtype_valid_depths(const char imtype);
char BKE_imtype_from_arg(const char *arg);
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index 7d8ada0fa68..b74424a1d28 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -1161,16 +1161,18 @@ int BKE_imtype_requires_linear_float(const char imtype)
return 0;
}
-char BKE_imtype_valid_channels(const char imtype)
+char BKE_imtype_valid_channels(const char imtype, bool write_file)
{
char chan_flag = IMA_CHAN_FLAG_RGB; /* assume all support rgb */
/* alpha */
switch (imtype) {
+ case R_IMF_IMTYPE_BMP:
+ if (write_file) break;
+ /* fall-through */
case R_IMF_IMTYPE_TARGA:
case R_IMF_IMTYPE_IRIS:
case R_IMF_IMTYPE_PNG:
- /* case R_IMF_IMTYPE_BMP: */ /* read but not write */
case R_IMF_IMTYPE_RADHDR:
case R_IMF_IMTYPE_TIFF:
case R_IMF_IMTYPE_OPENEXR:
diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c
index 21f54a86df4..f88cdaf6713 100644
--- a/source/blender/editors/space_image/image_buttons.c
+++ b/source/blender/editors/space_image/image_buttons.c
@@ -753,7 +753,7 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, const char
if (ibuf) {
int imtype = BKE_ftype_to_imtype(ibuf->ftype);
- char valid_channels = BKE_imtype_valid_channels(imtype);
+ char valid_channels = BKE_imtype_valid_channels(imtype, false);
has_alpha = (valid_channels & IMA_CHAN_FLAG_ALPHA) != 0;
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 90d14a7ba6f..0c70e332053 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -729,7 +729,7 @@ static void rna_ImageFormatSettings_file_format_set(PointerRNA *ptr, int value)
ID *id = ptr->id.data;
const char is_render = (id && GS(id->name) == ID_SCE);
/* see note below on why this is */
- const char chan_flag = BKE_imtype_valid_channels(imf->imtype) | (is_render ? IMA_CHAN_FLAG_BW : 0);
+ const char chan_flag = BKE_imtype_valid_channels(imf->imtype, true) | (is_render ? IMA_CHAN_FLAG_BW : 0);
imf->imtype = value;
@@ -800,7 +800,7 @@ static EnumPropertyItem *rna_ImageFormatSettings_color_mode_itemf(bContext *UNUS
* where 'BW' will force grayscale even if the output format writes
* as RGBA, this is age old blender convention and not sure how useful
* it really is but keep it for now - campbell */
- char chan_flag = BKE_imtype_valid_channels(imf->imtype) | (is_render ? IMA_CHAN_FLAG_BW : 0);
+ char chan_flag = BKE_imtype_valid_channels(imf->imtype, true) | (is_render ? IMA_CHAN_FLAG_BW : 0);
#ifdef WITH_FFMPEG
/* a WAY more crappy case than B&W flag: depending on codec, file format MIGHT support