diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2020-04-20 18:33:03 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2020-04-29 17:39:30 +0300 |
commit | b7bcd0a87c9df2f11d7249c64768e9526b2048bd (patch) | |
tree | 6851658f97036a8d7e0355b5bc20dfca33818e1a /source/blender/blenkernel/intern/movieclip.c | |
parent | 0cfd2d6f4b24a7703be4faf615eb47d9448d355c (diff) |
Tracking: Implement Nuke/Natron distortion model
Neither Nuke nor Natron support OpenCV's radial distortion model
which makes it impossible to have any kind of interoperability.
The new model is available under the distortion model menu in Lens
settings.
Differential Revision: https://developer.blender.org/D7484
Diffstat (limited to 'source/blender/blenkernel/intern/movieclip.c')
-rw-r--r-- | source/blender/blenkernel/intern/movieclip.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/movieclip.c b/source/blender/blenkernel/intern/movieclip.c index 7991559d1ce..4c7b791f103 100644 --- a/source/blender/blenkernel/intern/movieclip.c +++ b/source/blender/blenkernel/intern/movieclip.c @@ -460,6 +460,7 @@ typedef struct MovieClipCache { float principal[2]; float polynomial_k[3]; float division_k[2]; + float nuke_k[2]; short distortion_model; bool undistortion_used; @@ -908,6 +909,9 @@ static bool check_undistortion_cache_flags(const MovieClip *clip) if (!equals_v2v2(&camera->division_k1, cache->postprocessed.division_k)) { return false; } + if (!equals_v2v2(&camera->nuke_k1, cache->postprocessed.nuke_k)) { + return false; + } return true; } @@ -1010,6 +1014,7 @@ static void put_postprocessed_frame_to_cache( 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); + copy_v2_v2(cache->postprocessed.nuke_k, &camera->nuke_k1); cache->postprocessed.undistortion_used = true; } else { |