diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-11-20 05:14:33 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-11-20 05:14:33 +0400 |
commit | 3c8d86e117b54914524cbc49a8678ecaad8671cf (patch) | |
tree | 8101c8b12f888ded58d7e489e7855e754f0cf065 /source/blender/modifiers/intern/MOD_uvproject.c | |
parent | 331dd678c75ba1ef4e714c989c8f1bfae35508c2 (diff) | |
parent | acf30220c9d63e0f060ee69115fe82016de025d4 (diff) |
svn merge ^/trunk/blender -r41961:41998
Diffstat (limited to 'source/blender/modifiers/intern/MOD_uvproject.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_uvproject.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/source/blender/modifiers/intern/MOD_uvproject.c b/source/blender/modifiers/intern/MOD_uvproject.c index 20174740215..de43bdb8131 100644 --- a/source/blender/modifiers/intern/MOD_uvproject.c +++ b/source/blender/modifiers/intern/MOD_uvproject.c @@ -46,6 +46,7 @@ #include "BLI_utildefines.h" +#include "BKE_camera.h" #include "BKE_DerivedMesh.h" #include "MOD_modifiertypes.h" @@ -195,20 +196,12 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd, free_uci= 1; } else { - float sensor= (cam->sensor_fit == CAMERA_SENSOR_FIT_VERT) ? (cam->sensor_y) : cam->sensor_x; + float sensor= camera_sensor_size(cam->sensor_fit, cam->sensor_x, cam->sensor_y); + int sensor_fit= camera_sensor_fit(cam->sensor_fit, aspx, aspy); float scale= (cam->type == CAM_PERSP) ? cam->clipsta * sensor / cam->lens : cam->ortho_scale; float xmax, xmin, ymax, ymin; - if(cam->sensor_fit==CAMERA_SENSOR_FIT_AUTO) { - if(aspect > 1.0f) { - xmax = 0.5f * scale; - ymax = xmax / aspect; - } else { - ymax = 0.5f * scale; - xmax = ymax * aspect; - } - } - else if(cam->sensor_fit==CAMERA_SENSOR_FIT_HOR) { + if(sensor_fit==CAMERA_SENSOR_FIT_HOR) { xmax = 0.5f * scale; ymax = xmax / aspect; } |