Camera tracking integration
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 3 Aug 2011 19:05:58 +0000 (19:05 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 3 Aug 2011 19:05:58 +0000 (19:05 +0000)
===========================

- Fixed crash when Display->Stable is enabled before
  loading clip.
- Fixed bug with location influence on stabilization data.

source/blender/blenkernel/intern/tracking.c
source/blender/editors/space_clip/space_clip.c

index ab90bfad3b65db241ea191e287c3469c1faa4406..09a28f87fc312c57de5af6da28497dd426869cd1 100644 (file)
@@ -1308,7 +1308,6 @@ static float stabilization_auto_scale_factor(MovieTracking *tracking)
 static void calculate_stabdata(MovieTrackingStabilization *stab, float width, float height,
                        float firstmedian[2], float curmedian[2], float loc[2], float *scale)
 {
-       mul_v2_fl(loc, stab->locinf);
        *scale= (stab->scale-1.f)*stab->scaleinf+1.f;
 
        loc[0]= (firstmedian[0]-curmedian[0])*width*(*scale);
@@ -1316,8 +1315,11 @@ static void calculate_stabdata(MovieTrackingStabilization *stab, float width, fl
 
        loc[0]-= (firstmedian[0]*(*scale)-firstmedian[0])*width;
        loc[1]-= (firstmedian[1]*(*scale)-firstmedian[1])*height;
+
+       mul_v2_fl(loc, stab->locinf);
 }
 
+
 static ImBuf* stabilize_acquire_ibuf(ImBuf *cacheibuf, ImBuf *srcibuf, int fill)
 {
        int flags;
index 597f0c32b609cf4a2da8f8be9618a2c829f930e6..c880ffb3b0878de0ac34bf7e1b59a15c24d873e5 100644 (file)
@@ -88,9 +88,12 @@ static void clip_stabilization_tag_refresh(ScrArea *sa)
 {
        SpaceClip *sc= (SpaceClip *)sa->spacedata.first;
        MovieClip *clip= ED_space_clip(sc);
-       MovieTrackingStabilization *stab= &clip->tracking.stabilization;
 
-       stab->ok= 0;
+       if(clip) {
+               MovieTrackingStabilization *stab= &clip->tracking.stabilization;
+
+               stab->ok= 0;
+       }
 }
 
 /* ******************** default callbacks for clip space ***************** */