[Bf-blender-cvs] [b0f229dd276] master: Tracking: Fix missing distortion update on focal length change

Sergey Sharybin noreply at git.blender.org
Wed Apr 8 17:19:30 CEST 2020


Commit: b0f229dd276bffa838da0efb580eee9f3c61b79d
Author: Sergey Sharybin
Date:   Wed Apr 8 17:19:02 2020 +0200
Branches: master
https://developer.blender.org/rBb0f229dd276bffa838da0efb580eee9f3c61b79d

Tracking: Fix missing distortion update on focal length change

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

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

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

diff --git a/source/blender/blenkernel/intern/movieclip.c b/source/blender/blenkernel/intern/movieclip.c
index 847466915ab..193fe859def 100644
--- a/source/blender/blenkernel/intern/movieclip.c
+++ b/source/blender/blenkernel/intern/movieclip.c
@@ -456,6 +456,7 @@ typedef struct MovieClipCache {
     int flag;
 
     /* cache for undistorted shot */
+    float focal_length;
     float principal[2];
     float polynomial_k[3];
     float division_k[2];
@@ -887,6 +888,10 @@ static bool check_undistortion_cache_flags(const MovieClip *clip)
   const MovieClipCache *cache = clip->cache;
   const MovieTrackingCamera *camera = &clip->tracking.camera;
 
+  if (camera->focal != cache->postprocessed.focal_length) {
+    return false;
+  }
+
   /* check for distortion model changes */
   if (!equals_v2v2(camera->principal, cache->postprocessed.principal)) {
     return false;
@@ -1001,6 +1006,7 @@ static void put_postprocessed_frame_to_cache(
 
   if (need_undistortion_postprocess(user, flag)) {
     cache->postprocessed.distortion_model = camera->distortion_model;
+    cache->postprocessed.focal_length = camera->focal;
     copy_v2_v2(cache->postprocessed.principal, camera->principal);
     copy_v3_v3(cache->postprocessed.polynomial_k, &camera->k1);
     copy_v2_v2(cache->postprocessed.division_k, &camera->division_k1);



More information about the Bf-blender-cvs mailing list