Camera tracking integration
authorSergey Sharybin <sergey.vfx@gmail.com>
Sun, 30 Oct 2011 23:35:01 +0000 (23:35 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Sun, 30 Oct 2011 23:35:01 +0000 (23:35 +0000)
===========================

- Hopefully last fix for sensor-related compilation error.
- Set SAD correlation and KLT pyramid level for tracks created
  on previous version of Blender.
- Do not flip current frame number when it's getting to close to
  right boundary of clip editor.

source/blender/blenloader/intern/readfile.c
source/blender/editors/space_clip/clip_draw.c
source/blender/editors/space_view3d/view3d_intern.h

index 03e1ca25c077f3e83d3402fc207250da0d3c0a26..aaeb46d9e9c62b9f61daf2ff78a667bbc29b2e05 100644 (file)
 #include "BKE_screen.h"
 #include "BKE_sequencer.h"
 #include "BKE_texture.h" // for open_plugin_tex
+#include "BKE_tracking.h"
 #include "BKE_utildefines.h" // SWITCH_INT DATA ENDB DNA1 O_BINARY GLOB USER TEST REND
 #include "BKE_sound.h"
 
@@ -12368,6 +12369,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                        }
 
                        for (clip= main->movieclip.first; clip; clip= clip->id.next) {
+                               MovieTrackingTrack *track;
+
                                if(clip->aspx<1.0f) {
                                        clip->aspx= 1.0f;
                                        clip->aspy= 1.0f;
@@ -12383,6 +12386,17 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
 
                                if(clip->tracking.camera.pixel_aspect<0.01f)
                                        clip->tracking.camera.pixel_aspect= 1.f;
+
+                               track= clip->tracking.tracks.first;
+                               while(track) {
+                                       if(track->pyramid_levels==0)
+                                               track->pyramid_levels= 2;
+
+                                       if(track->minimum_correlation==0.0f)
+                                               track->minimum_correlation= 0.75f;
+
+                                       track= track->next;
+                               }
                        }
                }
        }
index 90a48ec0be7b47b194b32c7b14c49c30031b1848..9010ba473759787f9927dd37c251a3c710dcdbe5 100644 (file)
@@ -175,19 +175,11 @@ static void draw_movieclip_cache(SpaceClip *sc, ARegion *ar, MovieClip *clip, Sc
        fontsize= BLF_height(fontid, str);
        fontwidth= BLF_width(fontid, str);
 
-       if(x+fontwidth+6.0f<=ar->winx) {
-               glRecti(x, 8, x+fontwidth+6, 12+fontsize);
+       glRecti(x, 8, x+fontwidth+6, 12+fontsize);
 
-               UI_ThemeColor(TH_TEXT);
-               BLF_position(fontid, x+2.0f, 10.0f, 0.0f);
-               BLF_draw(fontid, str, strlen(str));
-       } else {
-               glRecti(x+framelen, 8.0f, x+framelen-fontwidth-6.0f, 12.0f+fontsize);
-
-               UI_ThemeColor(TH_TEXT);
-               BLF_position(fontid, x-2.0f-fontwidth+framelen, 10.0f, 0.0f);
-               BLF_draw(fontid, str, strlen(str));
-       }
+       UI_ThemeColor(TH_TEXT);
+       BLF_position(fontid, x+2.0f, 10.0f, 0.0f);
+       BLF_draw(fontid, str, strlen(str));
 }
 
 static void draw_movieclip_notes(SpaceClip *sc, ARegion *ar)
index 1afbd57c6e68c4830b3ad9df542d70c2b7049224..5aa8d95912d9bcc192a4c3cfcfbb7a8050934ef2 100644 (file)
@@ -136,7 +136,7 @@ void draw_depth_gpencil(Scene *scene, ARegion *ar, View3D *v3d);
 void view3d_clr_clipping(void);
 void view3d_set_clipping(RegionView3D *rv3d);
 void add_view3d_after(ListBase *lb, Base *base, int flag);
-void view3d_viewborder_size_get(struct Scene *scene, struct Objecy *camob, struct ARegion *ar, float size_r[2]);
+void view3d_viewborder_size_get(struct Scene *scene, struct Object *camob, struct ARegion *ar, float size_r[2]);
 
 void circf(float x, float y, float rad);
 void circ(float x, float y, float rad);