Revision: 38305
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38305
Author:   nazgul
Date:     2011-07-11 12:38:44 +0000 (Mon, 11 Jul 2011)
Log Message:
-----------
Camera tracking integration
===========================

- Minor spelling fixes.
- Do not draw bundles for hidden tracks in SpaceClip.
- Pressing SHift when sliding marker with mouse makes movenment more accurate.
- New default values for maerker pattern/search areas.
  This makes tracking more stable.
- Pyramid level increased to 4. This would make tracking
  of blured imaged more accurate.

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

Modified: branches/soc-2011-tomato/source/blender/blenkernel/intern/tracking.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/intern/tracking.c        
2011-07-11 11:17:39 UTC (rev 38304)
+++ branches/soc-2011-tomato/source/blender/blenkernel/intern/tracking.c        
2011-07-11 12:38:44 UTC (rev 38305)
@@ -377,7 +377,7 @@
        MovieTrackingTrack *track;
 
 #ifdef WITH_LIBMV
-       context->region_tracker= libmv_regionTrackerNew(100, 3, 0.2);
+       context->region_tracker= libmv_regionTrackerNew(100, 4, 0.2);
 #endif
 
        context->settings= *settings;

Modified: branches/soc-2011-tomato/source/blender/editors/space_clip/clip_draw.c
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/space_clip/clip_draw.c      
2011-07-11 11:17:39 UTC (rev 38304)
+++ branches/soc-2011-tomato/source/blender/editors/space_clip/clip_draw.c      
2011-07-11 12:38:44 UTC (rev 38305)
@@ -574,7 +574,7 @@
 
                track= tracking->tracks.first;
                while(track) {
-                       if(track->flag&TRACK_HAS_BUNDLE) {
+                       if((track->flag&TRACK_HIDDEN)==0 && 
track->flag&TRACK_HAS_BUNDLE) {
                                marker= BKE_tracking_get_marker(track, framenr);
 
                                copy_v4_v4(vec, track->bundle_pos);

Modified: 
branches/soc-2011-tomato/source/blender/editors/space_clip/tracking_ops.c
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/space_clip/tracking_ops.c   
2011-07-11 11:17:39 UTC (rev 38304)
+++ branches/soc-2011-tomato/source/blender/editors/space_clip/tracking_ops.c   
2011-07-11 12:38:44 UTC (rev 38305)
@@ -127,7 +127,7 @@
        MovieTrackingTrack *track;
        MovieTrackingMarker marker;
        int width, height;
-       float pat[2]= {15.0f, 15.0f}, search[2]= {30.0f, 30.0f}; /* TODO: move 
to default setting? */
+       float pat[2]= {5.5f, 5.5f}, search[2]= {80.5f, 80.5f}; /* TODO: move to 
default setting? */
 
        ED_space_clip_size(sc, &width, &height);
 
@@ -328,7 +328,7 @@
 
 /********************** mouse select operator *********************/
 
-static int mouse_on_size(float co[2], float x1, float y1, float x2, float y2, 
float epsx, float epsy)
+static int mouse_on_side(float co[2], float x1, float y1, float x2, float y2, 
float epsx, float epsy)
 {
        if(x1>x2) SWAP(float, x1, x2);
        if(y1>y2) SWAP(float, y1, y2);
@@ -338,10 +338,10 @@
 
 static int mouse_on_rect(float co[2], float pos[2], float min[2], float 
max[2], float epsx, float epsy)
 {
-       return mouse_on_size(co, pos[0]+min[0], pos[1]+min[1], pos[0]+max[0], 
pos[1]+min[1], epsx, epsy) ||
-              mouse_on_size(co, pos[0]+min[0], pos[1]+min[1], pos[0]+min[0], 
pos[1]+max[1], epsx, epsy) ||
-              mouse_on_size(co, pos[0]+min[0], pos[1]+max[1], pos[0]+max[0], 
pos[1]+max[1], epsx, epsy) ||
-              mouse_on_size(co, pos[0]+max[0], pos[1]+min[1], pos[0]+max[0], 
pos[1]+max[1], epsx, epsy);
+       return mouse_on_side(co, pos[0]+min[0], pos[1]+min[1], pos[0]+max[0], 
pos[1]+min[1], epsx, epsy) ||
+              mouse_on_side(co, pos[0]+min[0], pos[1]+min[1], pos[0]+min[0], 
pos[1]+max[1], epsx, epsy) ||
+              mouse_on_side(co, pos[0]+min[0], pos[1]+max[1], pos[0]+max[0], 
pos[1]+max[1], epsx, epsy) ||
+              mouse_on_side(co, pos[0]+max[0], pos[1]+min[1], pos[0]+max[0], 
pos[1]+max[1], epsx, epsy);
 }
 
 static int track_mouse_area(SpaceClip *sc, float co[2], MovieTrackingTrack 
*track)
@@ -1251,7 +1251,7 @@
        float *min, *max, *pos;
        float smin[2], smax[2], spos[2];
 
-       int keep_square;
+       int keep_square, accurate;
 } SlideMarkerData;
 
 static SlideMarkerData *create_slide_marker_data(MovieTrackingTrack *track, 
MovieTrackingMarker *marker, wmEvent *event, int area, int width, int height)
@@ -1374,9 +1374,15 @@
        switch(event->type) {
                case LEFTCTRLKEY:
                case RIGHTCTRLKEY:
+               case LEFTSHIFTKEY:
+               case RIGHTSHIFTKEY:
                        if(data->area != TRACK_AREA_POINT)
-                               data->keep_square= event->val==KM_PRESS;
+                               if(ELEM(event->type, LEFTCTRLKEY, RIGHTCTRLKEY))
+                                       data->keep_square= event->val==KM_PRESS;
 
+                       if(ELEM(event->type, LEFTSHIFTKEY, RIGHTSHIFTKEY))
+                               data->accurate= event->val==KM_PRESS;
+
                        /* no break! update area size */
 
                case MOUSEMOVE:
@@ -1386,6 +1392,11 @@
                        dx= mdelta[0]/data->width/sc->zoom;
                        dy= mdelta[1]/data->height/sc->zoom;
 
+                       if(data->accurate) {
+                               dx/= 5;
+                               dy/= 5;
+                       }
+
                        if(data->area == TRACK_AREA_POINT) {
                                data->pos[0]= data->spos[0]+dx;
                                data->pos[1]= data->spos[1]+dy;

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

Reply via email to