Merging r39717 through r39983 from trunk into soc-2011-tomato
[blender.git] / source / blender / blenkernel / intern / movieclip.c
index dfe76c441adc2857a46129559c67d76d2673d9e8..220a050fcc03a2f8eb9e98586173d60ee651bce6 100644 (file)
@@ -215,8 +215,8 @@ static ImBuf *movieclip_load_movie_file(MovieClip *clip, int framenr, int flag)
                else
                        BLI_path_abs(str, G.main->name);
 
-               clip->anim= openanim(str, IB_rect);
-
+               /* FIXME: make several stream accessible in image editor, too */
+               clip->anim= openanim(str, IB_rect, 0);
 
                if(clip->anim) {
                        if(clip->flag&MCLIP_USE_PROXY_CUSTOM_DIR) {
@@ -348,6 +348,7 @@ static MovieClip *movieclip_alloc(const char *name)
        clip->tracking.settings.keyframe1= 1;
        clip->tracking.settings.keyframe2= 30;
        clip->tracking.settings.dist= 1;
+       clip->tracking.settings.corr= 0.75;
 
        clip->tracking.stabilization.scaleinf= 1.f;
        clip->tracking.stabilization.locinf= 1.f;
@@ -672,40 +673,15 @@ void BKE_movieclip_select_track(MovieClip *clip, MovieTrackingTrack *track, int
                        cur= cur->next;
                }
        }
-
-       if(!TRACK_SELECTED(track))
-               BKE_movieclip_set_selection(clip, MCLIP_SEL_NONE, NULL);
 }
 
 void BKE_movieclip_deselect_track(MovieClip *clip, MovieTrackingTrack *track, int area)
 {
        BKE_tracking_track_flag(track, area, SELECT, 1);
-
-       if(!TRACK_SELECTED(track))
-               BKE_movieclip_set_selection(clip, MCLIP_SEL_NONE, NULL);
-}
-
-void BKE_movieclip_set_selection(MovieClip *clip, int type, void *sel)
-{
-       clip->sel_type= type;
-
-       if(type == MCLIP_SEL_NONE) clip->last_sel= NULL;
-       else clip->last_sel= sel;
-}
-
-void BKE_movieclip_last_selection(MovieClip *clip, int *type, void **sel)
-{
-       *type= clip->sel_type;
-
-       if(clip->sel_type == MCLIP_SEL_NONE) *sel= NULL;
-       else *sel= clip->last_sel;
 }
 
 void BKE_movieclip_update_scopes(MovieClip *clip, MovieClipUser *user, MovieClipScopes *scopes)
 {
-       void *sel;
-       int sel_type;
-
        if(scopes->ok) return;
 
        if(scopes->track_preview) {
@@ -717,10 +693,8 @@ void BKE_movieclip_update_scopes(MovieClip *clip, MovieClipUser *user, MovieClip
        scopes->track= NULL;
 
        if(clip) {
-               BKE_movieclip_last_selection(clip, &sel_type, &sel);
-
-               if(sel_type==MCLIP_SEL_TRACK) {
-                       MovieTrackingTrack *track= (MovieTrackingTrack*)sel;
+               if(clip->tracking.act_track) {
+                       MovieTrackingTrack *track= clip->tracking.act_track;
                        MovieTrackingMarker *marker= BKE_tracking_get_marker(track, user->framenr);
 
                        if(marker->flag&MARKER_DISABLED) {