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>2011-11-13 21:16:04 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2011-11-13 21:16:04 +0400
commit36898304849fb9d29b189f0b0a7e6931492efcc1 (patch)
tree9683d4af21d8f06490f0f7754db4dceb7b3f9e63 /source/blender
parentb9cc1f7590a2dd4d473900d20369015f0bb80778 (diff)
Camera solving: fixed incorrect warnings about failure of solving some frames
Error was caused y not very accurate calculating which frames should be solved.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/intern/tracking.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/tracking.c b/source/blender/blenkernel/intern/tracking.c
index 65b27f725bc..d65840720cd 100644
--- a/source/blender/blenkernel/intern/tracking.c
+++ b/source/blender/blenkernel/intern/tracking.c
@@ -1289,8 +1289,27 @@ static int retrieve_libmv_reconstruct(MovieTracking *tracking, struct libmv_Reco
}
if(track->markersnr) {
- if(track->markers[0].framenr<sfra) sfra= track->markers[0].framenr;
- if(track->markers[track->markersnr-1].framenr>efra) efra= track->markers[track->markersnr-1].framenr;
+ int first= 0, last= track->markersnr;
+ MovieTrackingMarker *first_marker= &track->markers[0];
+ MovieTrackingMarker *last_marker= &track->markers[track->markersnr-1];
+
+ /* find first not-disabled marker */
+ while(first<track->markersnr-1 && first_marker->flag&MARKER_DISABLED) {
+ first++;
+ first_marker++;
+ }
+
+ /* find last not-disabled marker */
+ while(last>=0 && last_marker->flag&MARKER_DISABLED) {
+ last--;
+ last_marker--;
+ }
+
+ if(first<track->markersnr-1)
+ sfra= MIN2(sfra, first_marker->framenr);
+
+ if(last>=0)
+ efra= MAX2(efra, last_marker->framenr);
}
track= track->next;