[Bf-blender-cvs] [46fe39f] master: Fix T43479 animated textures lost after going to a frame before animated frame start.

Antony Riakiotakis noreply at git.blender.org
Thu Feb 26 15:10:31 CET 2015


Commit: 46fe39ff312cd13e3a8955a7244e7bd4c8cf6dac
Author: Antony Riakiotakis
Date:   Thu Feb 26 15:10:19 2015 +0100
Branches: master
https://developer.blender.org/rB46fe39ff312cd13e3a8955a7244e7bd4c8cf6dac

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.

===================================================================

M	source/blender/blenkernel/intern/image.c

===================================================================

diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index 5807ea5..9b00a01 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;




More information about the Bf-blender-cvs mailing list