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>2020-04-08 18:19:02 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2020-04-08 18:19:21 +0300
commitb0f229dd276bffa838da0efb580eee9f3c61b79d (patch)
treedfdc72083f116c61ab5e7345328bac9e46c78ad1
parent020d1e23aee934dfad5fabc4038362cb8adf6c2a (diff)
Tracking: Fix missing distortion update on focal length change
-rw-r--r--source/blender/blenkernel/intern/movieclip.c6
1 files changed, 6 insertions, 0 deletions
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);