Camera tracking integration

===========================

Fix for UV Project modifier: use sensor size from projector's camera
rather than from scene's camera.
This commit is contained in:
Sergey Sharybin 2011-10-21 09:18:07 +00:00
parent ed3be3b950
commit 119b5bbb33

@ -162,14 +162,6 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
float scax= umd->scalex ? umd->scalex : 1.0f;
float scay= umd->scaley ? umd->scaley : 1.0f;
int free_uci= 0;
float sensor_x= 32.0f;
Scene *scene= umd->modifier.scene;
if(scene && scene->camera && scene->camera->type == OB_CAMERA) {
Camera *camera= (Camera*)scene->camera->data;
sensor_x= camera->sensor_x;
}
aspect = aspx / aspy;
@ -205,7 +197,7 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
free_uci= 1;
}
else {
float scale= (cam->type == CAM_PERSP) ? cam->clipsta * sensor_x / cam->lens : cam->ortho_scale;
float scale= (cam->type == CAM_PERSP) ? cam->clipsta * cam->sensor_x / cam->lens : cam->ortho_scale;
float xmax, xmin, ymax, ymin;
if(aspect > 1.0f) {