diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-01-11 17:18:24 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-01-11 17:18:24 +0400 |
commit | 3376cd93fa8f430810841a6c554304cac4d90c7f (patch) | |
tree | dac948a42fe236e786872c2c3420dced0d8016f4 /source/blender/makesrna | |
parent | 778774ba16c4fc1ee142018e4b370b53a8c6e987 (diff) |
Fix: toggling premultiply or color management not updating packed images.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_image.c | 13 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 2 |
2 files changed, 12 insertions, 3 deletions
diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c index 9e7f4a349e7..7059c001283 100644 --- a/source/blender/makesrna/intern/rna_image.c +++ b/source/blender/makesrna/intern/rna_image.c @@ -107,6 +107,15 @@ static void rna_Image_fields_update(Main *UNUSED(bmain), Scene *UNUSED(scene), P BKE_image_release_ibuf(ima, lock); } +static void rna_Image_free_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) +{ + Image *ima= ptr->id.data; + BKE_image_signal(ima, NULL, IMA_SIGNAL_FREE); + WM_main_add_notifier(NC_IMAGE|NA_EDITED, &ima->id); + DAG_id_tag_update(&ima->id, 0); +} + + static void rna_Image_reload_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { Image *ima= ptr->id.data; @@ -476,12 +485,12 @@ static void rna_def_image(BlenderRNA *brna) prop= RNA_def_property(srna, "use_premultiply", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_DO_PREMUL); RNA_def_property_ui_text(prop, "Premultiply", "Convert RGB from key alpha to premultiplied alpha"); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_reload_update"); + RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_free_update"); prop= RNA_def_property(srna, "use_color_unpremultiply", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_CM_PREDIVIDE); RNA_def_property_ui_text(prop, "Color Unpremultiply", "For premultiplied alpha images, do color space conversion on colors without alpha, to avoid fringing for images with light backgrounds"); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_reload_update"); + RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_Image_free_update"); prop= RNA_def_property(srna, "is_dirty", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_Image_dirty_get", NULL); diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index feb8d0cb549..84cf50a3755 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -999,7 +999,7 @@ static void rna_RenderSettings_color_management_update(Main *bmain, Scene *UNUSE WM_main_add_notifier(NC_NODE|NA_EDITED, node); if (node->type == CMP_NODE_IMAGE) - BKE_image_signal((Image *)node->id, NULL, IMA_SIGNAL_RELOAD); + BKE_image_signal((Image *)node->id, NULL, IMA_SIGNAL_FREE); } } } |