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
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-02-17 12:16:29 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-02-17 12:16:29 +0400
commitb83577aaec35270552e392b8d299e659b147fda3 (patch)
treeb04a2dd64643cd1af928daa730e2f1b7e4b2dae0
parent9d0b7b168fdd69108f095cefed6c3feb0e327ea2 (diff)
Camera tracking: fix for missing cache invalidation when disabling/enabling channels for stabilized shot
-- svn merge -r44140:44141 ^/branches/soc-2011-tomato
-rw-r--r--source/blender/blenkernel/intern/movieclip.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/movieclip.c b/source/blender/blenkernel/intern/movieclip.c
index 03fe18e4bd8..c93c03a4424 100644
--- a/source/blender/blenkernel/intern/movieclip.c
+++ b/source/blender/blenkernel/intern/movieclip.c
@@ -277,6 +277,7 @@ typedef struct MovieClipCache {
struct {
ImBuf *ibuf;
int framenr;
+ int postprocess_flag;
float loc[2], scale, angle;
int proxy;
@@ -702,7 +703,7 @@ ImBuf *BKE_movieclip_get_postprocessed_ibuf(MovieClip *clip, MovieClipUser *user
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 @@ static ImBuf *get_stable_cached_frame(MovieClip *clip, MovieClipUser *user, int
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 @@ static ImBuf *get_stable_cached_frame(MovieClip *clip, MovieClipUser *user, int
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 @@ static ImBuf *put_stabilized_frame_to_cache(MovieClip *clip, MovieClipUser *user
cache->stabilized.render_flag = 0;
}
+ cache->stabilized.postprocess_flag = postprocess_flag;
+
IMB_refImBuf(stableibuf);
return stableibuf;
@@ -786,10 +793,10 @@ ImBuf *BKE_movieclip_get_stable_ibuf(MovieClip *clip, MovieClipUser *user, float
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;