Fixed issue with non-updating frame in clip editor when toggling undistorted render...
authorSergey Sharybin <sergey.vfx@gmail.com>
Fri, 8 Jun 2012 17:16:32 +0000 (17:16 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Fri, 8 Jun 2012 17:16:32 +0000 (17:16 +0000)
Also corrected some typos in movieclip.

source/blender/blenkernel/intern/movieclip.c
source/blender/editors/space_clip/clip_editor.c

index 985fc433c13ffbde18c913daddb3373be5b8f1e4..abdc8835d43fc5a4a34b61edcc0a087c075b509f 100644 (file)
@@ -314,7 +314,7 @@ typedef struct MovieClipCache {
                /* cache for undistorted shot */
                float principal[2];
                float k1, k2, k3;
-               short undistoriton_used;
+               short undistortion_used;
 
                int proxy;
                short render_flag;
@@ -627,7 +627,7 @@ static ImBuf *get_postprocessed_cached_frame(MovieClip *clip, MovieClipUser *use
                if (!check_undistortion_cache_flags(clip))
                        return NULL;
        }
-       else if (cache->postprocessed.undistoriton_used)
+       else if (cache->postprocessed.undistortion_used)
                return NULL;
 
        IMB_refImBuf(cache->postprocessed.ibuf);
@@ -660,11 +660,11 @@ static ImBuf *put_postprocessed_frame_to_cache(MovieClip *clip, MovieClipUser *u
        if (need_undistortion_postprocess(user, flag)) {
                copy_v2_v2(cache->postprocessed.principal, camera->principal);
                copy_v3_v3(&cache->postprocessed.k1, &camera->k1);
-               cache->postprocessed.undistoriton_used = TRUE;
+               cache->postprocessed.undistortion_used = TRUE;
                postproc_ibuf = get_undistorted_ibuf(clip, NULL, ibuf);
        }
        else {
-               cache->postprocessed.undistoriton_used = FALSE;
+               cache->postprocessed.undistortion_used = FALSE;
        }
 
        if (postprocess_flag) {
index bcda1d59555c8fd8680c6748f8f5d137a29d9ff0..504d96df0729893f5e44fce69421a5008d61afbd 100644 (file)
@@ -522,6 +522,7 @@ typedef struct SpaceClipDrawContext {
 
        /* fields to check if cache is still valid */
        int framenr, start_frame;
+       short render_size, render_flag;
 } SpaceClipDrawContext;
 
 int ED_space_clip_texture_buffer_supported(SpaceClip *sc)
@@ -559,6 +560,8 @@ int ED_space_clip_load_movieclip_buffer(SpaceClip *sc, ImBuf *ibuf)
         * so not changed image buffer pointer means unchanged image content */
        need_rebind |= context->texture_ibuf != ibuf;
        need_rebind |= context->framenr != sc->user.framenr;
+       need_rebind |= context->render_size != sc->user.render_size;
+       need_rebind |= context->render_flag != sc->user.render_flag;
        need_rebind |= context->start_frame != clip->start_frame;
 
        if (need_rebind) {
@@ -614,6 +617,8 @@ int ED_space_clip_load_movieclip_buffer(SpaceClip *sc, ImBuf *ibuf)
                context->image_width = ibuf->x;
                context->image_height = ibuf->y;
                context->framenr = sc->user.framenr;
+               context->render_size = sc->user.render_size;
+               context->render_flag = sc->user.render_flag;
                context->start_frame = clip->start_frame;
        }
        else {