Camera tracking integration
authorSergey Sharybin <sergey.vfx@gmail.com>
Sun, 24 Jul 2011 12:36:14 +0000 (12:36 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Sun, 24 Jul 2011 12:36:14 +0000 (12:36 +0000)
===========================

- Fixed incorrect mouse sliding when resizing area which isn't
  symmetrical to marker's position.
- Added "Clip" group to User Preferences -> Input lust.
  Now hotkeys can be investigated there and also, they can be changed there.

release/scripts/startup/bl_ui/space_userpref_keymap.py
source/blender/editors/space_clip/tracking_ops.c

index 85764c5530481807d0b46e6bd60ca900487df530..12cef0f5e6b69e7f9ea8071ac6a1b697693dfb7d 100644 (file)
@@ -95,6 +95,7 @@ KM_HIERARCHY = [
     ('Script', 'SCRIPTS_WINDOW', 'WINDOW', []),
     ('Text', 'TEXT_EDITOR', 'WINDOW', []),
     ('Console', 'CONSOLE', 'WINDOW', []),
+    ('Clip', 'CLIP_EDITOR', 'WINDOW', []),
 
     ('View3D Gesture Circle', 'EMPTY', 'WINDOW', []),
     ('Gesture Border', 'EMPTY', 'WINDOW', []),
index 3e06e68a678d6092a5ffce52cd8fada6b338cdcc..f328222b6717fa97226854a24a5eadba379ad8a4 100644 (file)
@@ -1767,7 +1767,8 @@ static SlideMarkerData *create_slide_marker_data(SpaceClip *sc, MovieTrackingTra
        data->width= width;
        data->height= height;
 
-       data->lock= 1;
+       if(act==SLIDE_ACTION_SIZE)
+               data->lock= 1;
 
        return data;
 }
@@ -1909,7 +1910,7 @@ static int slide_marker_modal(bContext *C, wmOperator *op, wmEvent *event)
                case RIGHTCTRLKEY:
                case LEFTSHIFTKEY:
                case RIGHTSHIFTKEY:
-                       if(data->area != TRACK_AREA_POINT)
+                       if(data->action == SLIDE_ACTION_SIZE)
                                if(ELEM(event->type, LEFTCTRLKEY, RIGHTCTRLKEY))
                                        data->lock= event->val==KM_RELEASE;
 
@@ -1923,7 +1924,9 @@ static int slide_marker_modal(bContext *C, wmOperator *op, wmEvent *event)
                        mdelta[1]= event->mval[1]-data->mval[1];
 
                        dx= mdelta[0]/data->width/sc->zoom;
-                       dy= mdelta[1]/data->height/sc->zoom;
+
+                       if(data->lock) dy= -dx/data->height*data->width;
+                       else dy= mdelta[1]/data->height/sc->zoom;
 
                        if(data->accurate) {
                                dx/= 5;
@@ -1943,13 +1946,6 @@ static int slide_marker_modal(bContext *C, wmOperator *op, wmEvent *event)
                                        data->min[1]= data->smin[1]+dy;
                                        data->max[1]= data->smax[1]-dy;
 
-                                       if(data->lock) {
-                                               float h= (data->max[0]-data->min[0])*data->width/data->height;
-
-                                               data->min[1]= data->spos[1]-h/2;
-                                               data->max[1]= data->spos[1]+h/2;
-                                       }
-
 
                                        if(data->area==TRACK_AREA_SEARCH) BKE_tracking_clamp_track(data->track, CLAMP_SEARCH_DIM);
                                        else BKE_tracking_clamp_track(data->track, CLAMP_PAT_DIM);