[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [44141] branches/soc-2011-tomato/source/ blender/blenkernel/intern/movieclip.c: Tomato: fix for missing cache invalidation when disabling/ enabling channels for stabilized shot

Sergey Sharybin sergey.vfx at gmail.com
Thu Feb 16 08:45:12 CET 2012


Revision: 44141
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=44141
Author:   nazgul
Date:     2012-02-16 07:45:01 +0000 (Thu, 16 Feb 2012)
Log Message:
-----------
Tomato: fix for missing cache invalidation when disabling/enabling channels for stabilized shot

Modified Paths:
--------------
    branches/soc-2011-tomato/source/blender/blenkernel/intern/movieclip.c

Modified: branches/soc-2011-tomato/source/blender/blenkernel/intern/movieclip.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/intern/movieclip.c	2012-02-16 07:11:50 UTC (rev 44140)
+++ branches/soc-2011-tomato/source/blender/blenkernel/intern/movieclip.c	2012-02-16 07:45:01 UTC (rev 44141)
@@ -277,6 +277,7 @@
 	struct {
 		ImBuf *ibuf;
 		int framenr;
+		int postprocess_flag;
 
 		float loc[2], scale, angle;
 		int proxy;
@@ -702,7 +703,7 @@
 	return movieclip_get_postprocessed_ibuf(clip, user, clip->flag, postprocess_flag, 0);
 }
 
-static ImBuf *get_stable_cached_frame(MovieClip *clip, MovieClipUser *user, int framenr)
+static ImBuf *get_stable_cached_frame(MovieClip *clip, MovieClipUser *user, int framenr, int postprocess_flag)
 {
 	MovieClipCache *cache = clip->cache;
 	ImBuf *stableibuf;
@@ -723,6 +724,9 @@
 	if(cache->stabilized.render_flag!=render_flag || cache->stabilized.proxy!=proxy)
 		return NULL;
 
+	if(cache->stabilized.postprocess_flag != postprocess_flag)
+		return NULL;
+
 	stableibuf = cache->stabilized.ibuf;
 
 	BKE_tracking_stabilization_data(&clip->tracking, framenr, stableibuf->x, stableibuf->y, tloc, &tscale, &tangle);
@@ -740,7 +744,8 @@
 	return stableibuf;
 }
 
-static ImBuf *put_stabilized_frame_to_cache(MovieClip *clip, MovieClipUser *user, ImBuf *ibuf, int framenr)
+static ImBuf *put_stabilized_frame_to_cache(MovieClip *clip, MovieClipUser *user, ImBuf *ibuf,
+                                            int framenr, int postprocess_flag)
 {
 	MovieClipCache *cache = clip->cache;
 	ImBuf *stableibuf;
@@ -768,6 +773,8 @@
 		cache->stabilized.render_flag = 0;
 	}
 
+	cache->stabilized.postprocess_flag = postprocess_flag;
+
 	IMB_refImBuf(stableibuf);
 
 	return stableibuf;
@@ -786,10 +793,10 @@
 	if(clip->tracking.stabilization.flag&TRACKING_2D_STABILIZATION) {
 		MovieClipCache *cache= clip->cache;
 
-		stableibuf= get_stable_cached_frame(clip, user, framenr);
+		stableibuf= get_stable_cached_frame(clip, user, framenr, postprocess_flag);
 
 		if(!stableibuf)
-			stableibuf= put_stabilized_frame_to_cache(clip, user, ibuf, framenr);
+			stableibuf= put_stabilized_frame_to_cache(clip, user, ibuf, framenr, postprocess_flag);
 
 		if(loc)		copy_v2_v2(loc, cache->stabilized.loc);
 		if(scale)	*scale= cache->stabilized.scale;




More information about the Bf-blender-cvs mailing list