Camera tracking integration
authorSergey Sharybin <sergey.vfx@gmail.com>
Sun, 7 Aug 2011 16:10:14 +0000 (16:10 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Sun, 7 Aug 2011 16:10:14 +0000 (16:10 +0000)
===========================

Corrected focal length initialization. Now it'll be 24mm, not 24px.

source/blender/blenkernel/intern/movieclip.c

index 2666bfbdd6c03606a2ecce71b64ff337c4c1baf5..3abc84b6cbb92570bc45989d04a55de0ed3d157b 100644 (file)
@@ -230,7 +230,6 @@ static MovieClip *movieclip_alloc(const char *name)
 
        clip->aspx= clip->aspy= 1.0f;
 
-       clip->tracking.camera.focal= 24.f;
        clip->tracking.camera.sensor_width= 35.0f;
        clip->tracking.camera.sensor_height= 18.0f;
        clip->tracking.camera.units= CAMERA_UNITS_MM;
@@ -298,6 +297,8 @@ MovieClip *BKE_add_movieclip_file(const char *name)
        if(width && height) {
                clip->tracking.camera.principal[0]= ((float)width)/2;
                clip->tracking.camera.principal[1]= ((float)height)/2;
+
+               clip->tracking.camera.focal= 24.f*width/clip->tracking.camera.sensor_width;
        }
 
        return clip;