From 0c9df3d47050903386b6dd0a41ad67cbe52c396f Mon Sep 17 00:00:00 2001 From: Omar Emara Date: Tue, 13 Feb 2024 13:31:49 +0100 Subject: [PATCH] Fix: Image does not update when file path changes Images do not update in the compositor and other places when their file path changes or their generated options change. This is because the compositor relies on depsgraph updates, which weren't tagged in this case. Fix this by tagging appropriately in RNA. Pull Request: https://projects.blender.org/blender/blender/pulls/118187 --- source/blender/makesrna/intern/rna_image.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/blender/makesrna/intern/rna_image.cc b/source/blender/makesrna/intern/rna_image.cc index 80e6471c32e..ec67020092a 100644 --- a/source/blender/makesrna/intern/rna_image.cc +++ b/source/blender/makesrna/intern/rna_image.cc @@ -95,7 +95,7 @@ static void rna_Image_source_set(PointerRNA *ptr, int value) } DEG_id_tag_update(&ima->id, 0); - DEG_id_tag_update(&ima->id, ID_RECALC_EDITORS); + DEG_id_tag_update(&ima->id, ID_RECALC_EDITORS | ID_RECALC_SOURCE); DEG_relations_tag_update(G_MAIN); } } @@ -106,7 +106,7 @@ static void rna_Image_reload_update(Main *bmain, Scene * /*scene*/, PointerRNA * BKE_image_signal(bmain, ima, nullptr, IMA_SIGNAL_RELOAD); WM_main_add_notifier(NC_IMAGE | NA_EDITED, &ima->id); DEG_id_tag_update(&ima->id, 0); - DEG_id_tag_update(&ima->id, ID_RECALC_EDITORS); + DEG_id_tag_update(&ima->id, ID_RECALC_EDITORS | ID_RECALC_SOURCE); } static int rna_Image_generated_type_get(PointerRNA *ptr) @@ -191,6 +191,7 @@ static void rna_Image_generated_update(Main *bmain, Scene * /*scene*/, PointerRN Image *ima = (Image *)ptr->owner_id; BKE_image_signal(bmain, ima, nullptr, IMA_SIGNAL_FREE); BKE_image_partial_update_mark_full_update(ima); + DEG_id_tag_update(&ima->id, ID_RECALC_EDITORS | ID_RECALC_SOURCE); } static void rna_Image_colormanage_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr) @@ -230,6 +231,7 @@ static void rna_Image_views_format_update(Main *bmain, Scene *scene, PointerRNA BKE_image_release_ibuf(ima, ibuf, lock); BKE_image_partial_update_mark_full_update(ima); + DEG_id_tag_update(&ima->id, ID_RECALC_EDITORS | ID_RECALC_SOURCE); } static void rna_ImageUser_update(Main *bmain, Scene *scene, PointerRNA *ptr)