Revision: 39551
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39551
Author:   nazgul
Date:     2011-08-19 13:41:00 +0000 (Fri, 19 Aug 2011)
Log Message:
-----------
Camera tracking integration
===========================

- Fixing keyframes when tracking frame-by-frame.
- Fixed small typo in array initializer.

Modified Paths:
--------------
    branches/soc-2011-tomato/source/blender/blenkernel/intern/tracking.c

Modified: branches/soc-2011-tomato/source/blender/blenkernel/intern/tracking.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/intern/tracking.c        
2011-08-19 12:58:20 UTC (rev 39550)
+++ branches/soc-2011-tomato/source/blender/blenkernel/intern/tracking.c        
2011-08-19 13:41:00 UTC (rev 39551)
@@ -768,15 +768,19 @@
        return pixels;
 }
 
-static ImBuf *acquire_keyframed_ibuf(MovieTrackingContext *context, 
MovieTrackingTrack *track, MovieTrackingMarker *marker)
+static ImBuf *acquire_keyframed_ibuf(MovieTrackingContext *context, 
MovieTrackingTrack *track,
+                       MovieTrackingMarker *marker, MovieTrackingMarker 
**marker_keyed)
 {
        int framenr_old= context->user.framenr, framenr= marker->framenr;
        int a= marker-track->markers;
        ImBuf *ibuf;
 
+       *marker_keyed= marker;
+
        while(a>=0 && a<track->markersnr) {
-               if(marker->flag&MARKER_TRACKED) {
-                       framenr= marker->framenr;
+               if((track->markers[a].flag&MARKER_TRACKED)==0) {
+                       framenr= track->markers[a].framenr;
+                       *marker_keyed= &track->markers[a];
                        break;
                }
 
@@ -917,7 +921,7 @@
                        float pos[2];
                        double x1, y1, x2, y2;
                        ImBuf *ibuf= NULL;
-                       MovieTrackingMarker marker_new;
+                       MovieTrackingMarker marker_new, *marker_keyed;
 
                        if(context->settings.tracker==TRACKER_KLT) {
                                int wndx, wndy;
@@ -925,8 +929,9 @@
 
                                if(!track_context->patch) {
                                        /* calculate patch for keyframed 
position */
-                                       ibuf= acquire_keyframed_ibuf(context, 
track, marker);
-                                       track_context->patch= 
acquire_search_floatbuf(ibuf, track, marker, &width, &height, pos, origin);
+                                       ibuf= acquire_keyframed_ibuf(context, 
track, marker, &marker_keyed);
+                                       track_context->patch= 
acquire_search_floatbuf(ibuf, track, marker_keyed, &width, &height, pos, 
origin);
+
                                        IMB_freeImBuf(ibuf);
                                }
 
@@ -952,12 +957,12 @@
 
                                if(track_context->pattern==NULL) {
                                        unsigned char *image;
-                                       float warp[3][2]={0};
+                                       float warp[3][2]={{0}};
 
                                        /* calculate pattern for keyframed 
position */
 
-                                       ibuf= acquire_keyframed_ibuf(context, 
track, marker);
-                                       image= acquire_search_bytebuf(ibuf, 
track, marker, &width, &height, pos, origin);
+                                       ibuf= acquire_keyframed_ibuf(context, 
track, marker, &marker_keyed);
+                                       image= acquire_search_bytebuf(ibuf, 
track, marker_keyed, &width, &height, pos, origin);
 
                                        warp[0][0]= 1;
                                        warp[1][1]= 1;

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to