Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2019-02-18 17:22:02 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-02-18 18:38:17 +0300
commit286c34b4abb0436fb370c8d49fd73738dabc0fcf (patch)
tree270d6811a708e5466bdf91640d1c78ba29016545 /source
parenta6443b5d1ed600c953ffffe91a62ded77631bbb7 (diff)
Fix image filepath changes not refreshing all image users.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/bpath.c8
-rw-r--r--source/blender/blenkernel/intern/image.c26
-rw-r--r--source/blender/editors/space_image/image_ops.c1
3 files changed, 18 insertions, 17 deletions
diff --git a/source/blender/blenkernel/intern/bpath.c b/source/blender/blenkernel/intern/bpath.c
index de4ef8bdcb4..e85cb700bce 100644
--- a/source/blender/blenkernel/intern/bpath.c
+++ b/source/blender/blenkernel/intern/bpath.c
@@ -411,13 +411,6 @@ static bool rewrite_path_alloc(char **path, BPathVisitor visit_cb, const char *a
}
}
-/* fix the image user "ok" tag after updating paths, so ImBufs get loaded */
-static void bpath_traverse_image_user_cb(Image *ima, ImageUser *iuser, void *customdata)
-{
- if (ima == customdata)
- iuser->ok = 1;
-}
-
/* Run visitor function 'visit' on all paths contained in 'id'. */
void BKE_bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int flag, void *bpath_user_data)
{
@@ -441,7 +434,6 @@ void BKE_bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int
!BKE_image_is_dirty(ima))
{
BKE_image_signal(bmain, ima, NULL, IMA_SIGNAL_RELOAD);
- BKE_image_walk_all_users(bmain, ima, bpath_traverse_image_user_cb);
}
}
}
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index eb4d7751a5c..948d22f5146 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -2775,6 +2775,19 @@ static void image_tag_frame_recalc(Image *ima, ImageUser *iuser, void *customdat
if (ima == changed_image && BKE_image_is_animated(ima)) {
iuser->flag |= IMA_NEED_FRAME_RECALC;
+ iuser->ok = 1;
+ }
+}
+
+static void image_tag_reload(Image *ima, ImageUser *iuser, void *customdata)
+{
+ Image *changed_image = customdata;
+
+ if (ima == changed_image) {
+ iuser->ok = 1;
+ if (iuser->scene) {
+ image_update_views_format(ima, iuser);
+ }
}
}
@@ -2847,9 +2860,9 @@ void BKE_image_signal(Main *bmain, Image *ima, ImageUser *iuser, int signal)
BKE_image_free_buffers(ima);
ima->ok = 1;
- if (iuser)
- iuser->ok = 1;
-
+ if (iuser) {
+ image_tag_frame_recalc(ima, iuser, ima);
+ }
BKE_image_walk_all_users(bmain, ima, image_tag_frame_recalc);
break;
@@ -2886,12 +2899,9 @@ void BKE_image_signal(Main *bmain, Image *ima, ImageUser *iuser, int signal)
BKE_image_free_buffers(ima);
if (iuser) {
- iuser->ok = 1;
- if (iuser->scene) {
- image_update_views_format(ima, iuser);
- }
+ image_tag_reload(ima, iuser, ima);
}
-
+ BKE_image_walk_all_users(bmain, ima, image_tag_reload);
break;
case IMA_SIGNAL_USER_NEW_IMAGE:
if (iuser) {
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c
index af5e286f503..07470bce899 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -2346,7 +2346,6 @@ static int image_reload_exec(bContext *C, wmOperator *UNUSED(op))
/* XXX unpackImage frees image buffers */
ED_preview_kill_jobs(CTX_wm_manager(C), CTX_data_main(C));
- // XXX other users?
BKE_image_signal(bmain, ima, (sima) ? &sima->iuser : NULL, IMA_SIGNAL_RELOAD);
DEG_id_tag_update(&ima->id, 0);