diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-07-18 17:28:33 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-07-18 17:37:32 +0400 |
commit | 9a45c9dadf435ac6c1329372dc08f21b1af242c6 (patch) | |
tree | 91bc74aa7ac5ca8bedfdc8f19016be2dcba6bf98 /source | |
parent | b98448918160f05feb725c29a9c6b7c2cf4257f8 (diff) |
Fix T41109: Reloading image that has been modified outside Blender does not update image in Image Texture nodes
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/depsgraph.c | 17 | ||||
-rw-r--r-- | source/blender/editors/space_image/image_ops.c | 2 |
2 files changed, 19 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c index 24b580672d1..95e608a5d4d 100644 --- a/source/blender/blenkernel/intern/depsgraph.c +++ b/source/blender/blenkernel/intern/depsgraph.c @@ -2502,6 +2502,23 @@ static void dag_id_flush_update(Main *bmain, Scene *sce, ID *id) } } + /* Not pretty to iterate all the nodes here, but it's as good as it + * could be with the current depsgraph design/ + */ + if (idtype == ID_IM) { + FOREACH_NODETREE(bmain, ntree, parent_id) { + if (ntree->type == NTREE_SHADER) { + bNode *node; + for (node = ntree->nodes.first; node; node = node->next) { + if (node->id == id) { + lib_id_recalc_tag(bmain, &ntree->id); + break; + } + } + } + } FOREACH_NODETREE_END + } + if (idtype == ID_MSK) { if (sce->nodetree) { bNode *node; diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 7c021cf6645..4ae05d8f64f 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -48,6 +48,7 @@ #include "BKE_colortools.h" #include "BKE_context.h" +#include "BKE_depsgraph.h" #include "BKE_icons.h" #include "BKE_image.h" #include "BKE_global.h" @@ -1866,6 +1867,7 @@ static int image_reload_exec(bContext *C, wmOperator *UNUSED(op)) // XXX other users? BKE_image_signal(ima, (sima) ? &sima->iuser : NULL, IMA_SIGNAL_RELOAD); + DAG_id_tag_update(&ima->id, 0); WM_event_add_notifier(C, NC_IMAGE | NA_EDITED, ima); |