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>2021-01-28 10:27:53 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-01-28 10:27:53 +0300
commitfcda0c7eb9ffe5234af741796491bd93c3d7bd84 (patch)
treec998e992c602a3e291a8f439f366ab4882125c4a
parentc1c77b7b9aabf5736b3a18895ed0c81518ad2d79 (diff)
parent9509e18564452c1f95a8967accbb1aeb6094d222 (diff)
Merge branch 'blender-v2.92-release'
-rw-r--r--source/blender/makesrna/intern/rna_image.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c
index 1e84ded6cde..b3272f44826 100644
--- a/source/blender/makesrna/intern/rna_image.c
+++ b/source/blender/makesrna/intern/rna_image.c
@@ -128,6 +128,17 @@ static void rna_Image_colormanage_update(Main *bmain, Scene *UNUSED(scene), Poin
WM_main_add_notifier(NC_IMAGE | NA_EDITED, &ima->id);
}
+static void rna_Image_alpha_mode_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+ Image *ima = (Image *)ptr->owner_id;
+ /* When operating on a generated image, avoid re-generating when changing the alpha-mode
+ * as it doesn't impact generated images, causing them to reload pixel data, see T82785. */
+ if (ima->source == IMA_SRC_GENERATED) {
+ return;
+ }
+ rna_Image_colormanage_update(bmain, scene, ptr);
+}
+
static void rna_Image_views_format_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
Image *ima = (Image *)ptr->owner_id;
@@ -1133,7 +1144,7 @@ static void rna_def_image(BlenderRNA *brna)
"Alpha Mode",
"Representation of alpha in the image file, to convert to and from "
"when saving and loading the image");
- RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_colormanage_update");
+ RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_alpha_mode_update");
prop = RNA_def_property(srna, "use_half_precision", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", IMA_HIGH_BITDEPTH);