diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-05-22 13:15:01 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-05-22 13:15:01 +0400 |
commit | 1ae392913833edd2b11cef5b682f04ac8e70c4c4 (patch) | |
tree | 0f8f991eaa527cada11ddae00ebb381e8a2c46b2 /source/blender/compositor/operations/COM_MovieDistortionOperation.cpp | |
parent | 40b7b9655afca32bf3fdae9bd6f58e7b377ddade (diff) |
Fix for movie distoriton node in tiles
Now it works in the same way as non-tiles node in cases when image's
resolution is not equal to resolution used for calibration.
Also add some additional checks for distortion cache, so now it should
be updating properly when camera intrinsics are changing.
Potentially added support of overscan, but currently all needed computation
is commented out.
Diffstat (limited to 'source/blender/compositor/operations/COM_MovieDistortionOperation.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_MovieDistortionOperation.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/source/blender/compositor/operations/COM_MovieDistortionOperation.cpp b/source/blender/compositor/operations/COM_MovieDistortionOperation.cpp index 1699707ab3a..ebea9e8b4a2 100644 --- a/source/blender/compositor/operations/COM_MovieDistortionOperation.cpp +++ b/source/blender/compositor/operations/COM_MovieDistortionOperation.cpp @@ -24,8 +24,8 @@ extern "C" { #include "BKE_tracking.h" - -#include "BLI_linklist.h" + #include "BKE_movieclip.h" + #include "BLI_linklist.h" } @@ -46,14 +46,23 @@ void MovieDistortionOperation::initExecution() { this->inputOperation = this->getInputSocketReader(0); if (this->movieClip) { + MovieClipUser clipUser = {0}; + int calibration_width, calibration_height; + + BKE_movieclip_user_set_frame(&clipUser, this->framenumber); + BKE_movieclip_get_size(this->movieClip, &clipUser, &calibration_width, &calibration_height); + for (int i = 0 ; i < s_cache.size() ; i ++) { DistortionCache *c = (DistortionCache*)s_cache[i]; - if (c->isCacheFor(this->movieClip, this->width, this->height, this->distortion)) { + if (c->isCacheFor(this->movieClip, this->width, this->height, + calibration_width, calibration_height, this->distortion)) + { this->cache = c; return; } } - DistortionCache *newC = new DistortionCache(this->movieClip, this->width, this->height, this->distortion); + DistortionCache *newC = new DistortionCache(this->movieClip, this->width, this->height, + calibration_width, calibration_height, this->distortion); s_cache.push_back(newC); this->cache = newC; } |