diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2015-02-26 17:10:19 +0300 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2015-02-26 17:10:19 +0300 |
commit | 46fe39ff312cd13e3a8955a7244e7bd4c8cf6dac (patch) | |
tree | 11d5e6465de2869d8ec37953110ed87467b430e5 /source/blender/blenkernel/intern/image.c | |
parent | 13c275ce8477c94d53b3799c28b48011b59db2fb (diff) |
Fix T43479 animated textures lost after going to a frame before animated
frame start.
Issue here is that if we failed to get an image from the cache, we would
try to load from file. This would fail when the queried frame was less
than the animated sequence start frame, and invalidate the OK state of
the image.
Solution is that when loading from cache succeeds, we also reset the OK
state of the image for animated textures.
The fix might be relevant elsewhere too, but kept it isolated just in
case.
Diffstat (limited to 'source/blender/blenkernel/intern/image.c')
-rw-r--r-- | source/blender/blenkernel/intern/image.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 5807ea555c2..9b00a0150ad 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -2977,6 +2977,16 @@ static ImBuf *image_get_cached_ibuf(Image *ima, ImageUser *iuser, int *r_frame, ima->tpageflag |= IMA_TPAGE_REFRESH; } ima->lastframe = frame; + + /* counter the fact that image is set as invalid when loading a frame + * that is not in the cache (through image_acquire_ibuf for instance), + * yet we have valid frames in the cache loaded */ + if (ibuf) { + ima->ok = IMA_OK_LOADED; + + if (iuser) + iuser->ok = ima->ok; + } } else if (ima->type == IMA_TYPE_MULTILAYER) { frame = iuser ? iuser->framenr : ima->lastframe; |