diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc index 3f7db5f7349..b62340583c4 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc @@ -1895,10 +1895,19 @@ void DepsgraphNodeBuilder::build_image(Image *image) if (built_map_.checkIsBuiltAndTag(image)) { return; } + build_parameters(&image->id); build_idproperties(image->id.properties); - add_operation_node( - &image->id, NodeType::GENERIC_DATABLOCK, OperationCode::GENERIC_DATABLOCK_UPDATE); + + add_operation_node(&image->id, + NodeType::GENERIC_DATABLOCK, + OperationCode::GENERIC_DATABLOCK_UPDATE, + [image](::Depsgraph *depsgraph) { + if (image->id.recalc & ID_RECALC_SOURCE) { + printf("Image source changed\n"); + BKE_image_free_buffers(image); + } + }); } void DepsgraphNodeBuilder::build_cachefile(CacheFile *cache_file) diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc b/source/blender/depsgraph/intern/depsgraph_tag.cc index 2df65bf15aa..f1c96484494 100644 --- a/source/blender/depsgraph/intern/depsgraph_tag.cc +++ b/source/blender/depsgraph/intern/depsgraph_tag.cc @@ -203,7 +203,12 @@ void depsgraph_tag_to_component_opcode(const ID *id, *component_type = NodeType::PARAMETERS; break; case ID_RECALC_SOURCE: - *component_type = NodeType::PARAMETERS; + if (id_type == ID_IM) { + *component_type = NodeType::GENERIC_DATABLOCK; + } + else { + *component_type = NodeType::PARAMETERS; + } break; case ID_RECALC_GEOMETRY_ALL_MODES: case ID_RECALC_ALL: diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c index acc1efe8d12..19ce946fa89 100644 --- a/source/blender/makesrna/intern/rna_color.c +++ b/source/blender/makesrna/intern/rna_color.c @@ -625,7 +625,7 @@ static void rna_ColorManagedColorspaceSettings_reload_update(Main *bmain, if (GS(id->name) == ID_IM) { Image *ima = (Image *)id; - DEG_id_tag_update(&ima->id, 0); + DEG_id_tag_update(&ima->id, ID_RECALC_SOURCE); BKE_image_signal(bmain, ima, NULL, IMA_SIGNAL_COLORMANAGE);