DO not reset clip's focal length when changing path to footage
authorSergey Sharybin <sergey.vfx@gmail.com>
Mon, 18 Jun 2012 18:22:49 +0000 (18:22 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Mon, 18 Jun 2012 18:22:49 +0000 (18:22 +0000)
source/blender/blenkernel/intern/movieclip.c

index 90b56e2..04edc58 100644 (file)
@@ -463,7 +463,6 @@ static void movieclip_load_get_szie(MovieClip *clip)
                clip->tracking.camera.principal[0] = ((float)width) / 2.0f;
                clip->tracking.camera.principal[1] = ((float)height) / 2.0f;
 
-               clip->tracking.camera.focal = 24.0f * width / clip->tracking.camera.sensor_width;
        }
 }
 
@@ -518,6 +517,11 @@ MovieClip *BKE_movieclip_file_add(const char *name)
                clip->source = MCLIP_SRC_SEQUENCE;
 
        movieclip_load_get_szie(clip);
+       if (clip->lastsize[0]) {
+               int width = clip->lastsize[0];
+
+               clip->tracking.camera.focal = 24.0f * width / clip->tracking.camera.sensor_width;
+       }
 
        movieclip_calc_length(clip);