From 3086300149464dae8f419cd2066afb5ffd34af56 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 18 Oct 2012 09:48:51 +0000 Subject: Fix #32896: No compositor tree update with image input color space change --- source/blender/blenkernel/intern/movieclip.c | 12 ++++++++++++ source/blender/editors/space_node/space_node.c | 9 +++++++++ source/blender/makesrna/intern/rna_color.c | 4 ++++ 3 files changed, 25 insertions(+) diff --git a/source/blender/blenkernel/intern/movieclip.c b/source/blender/blenkernel/intern/movieclip.c index 6f1c8d952de..4bd6676608e 100644 --- a/source/blender/blenkernel/intern/movieclip.c +++ b/source/blender/blenkernel/intern/movieclip.c @@ -1091,6 +1091,18 @@ void BKE_movieclip_reload(MovieClip *clip) movieclip_load_get_szie(clip); movieclip_calc_length(clip); + + /* same as for image update -- don't use notifiers because they are not 100% sure to succeeded + * (node trees which are not currently visible wouldn't be refreshed) + */ + { + Scene *scene; + for (scene = G.main->scene.first; scene; scene = scene->id.next) { + if (scene->nodetree) { + nodeUpdateID(scene->nodetree, &clip->id); + } + } + } } void BKE_movieclip_update_scopes(MovieClip *clip, MovieClipUser *user, MovieClipScopes *scopes) diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c index b70d66f60b4..76d1357a83c 100644 --- a/source/blender/editors/space_node/space_node.c +++ b/source/blender/editors/space_node/space_node.c @@ -254,6 +254,15 @@ static void node_area_listener(ScrArea *sa, wmNotifier *wmn) } } break; + + case NC_MOVIECLIP: + if (wmn->action == NA_EDITED) { + if (type == NTREE_COMPOSIT) { + if (nodeUpdateID(snode->nodetree, wmn->reference)) + ED_area_tag_refresh(sa); + } + } + break; } } diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c index 7fb4a1d3839..1ba2fc1ee7e 100644 --- a/source/blender/makesrna/intern/rna_color.c +++ b/source/blender/makesrna/intern/rna_color.c @@ -475,13 +475,17 @@ static void rna_ColorManagedColorspaceSettings_reload_update(Main *UNUSED(bmain) Image *ima = (Image *) id; BKE_image_signal(ima, NULL, IMA_SIGNAL_RELOAD); + WM_main_add_notifier(NC_IMAGE | ND_DISPLAY, &ima->id); + WM_main_add_notifier(NC_IMAGE | NA_EDITED, &ima->id); } else if (GS(id->name) == ID_MC) { MovieClip *clip = (MovieClip *) id; BKE_movieclip_reload(clip); + WM_main_add_notifier(NC_MOVIECLIP | ND_DISPLAY, &clip->id); + WM_main_add_notifier(NC_MOVIECLIP | NA_EDITED, &clip->id); } } -- cgit v1.2.3