diff options
Diffstat (limited to 'intern/cycles/blender/blender_camera.cpp')
-rw-r--r-- | intern/cycles/blender/blender_camera.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/intern/cycles/blender/blender_camera.cpp b/intern/cycles/blender/blender_camera.cpp index 5a447a347a3..21efba4cdf0 100644 --- a/intern/cycles/blender/blender_camera.cpp +++ b/intern/cycles/blender/blender_camera.cpp @@ -95,8 +95,8 @@ static void blender_camera_init(BlenderCamera *bcam, bcam->type = CAMERA_PERSPECTIVE; bcam->zoom = 1.0f; bcam->pixelaspect = make_float2(1.0f, 1.0f); - bcam->sensor_width = 32.0f; - bcam->sensor_height = 18.0f; + bcam->sensor_width = 36.0f; + bcam->sensor_height = 24.0f; bcam->sensor_fit = BlenderCamera::AUTO; bcam->shuttertime = 1.0f; bcam->motion_position = Camera::MOTION_POSITION_CENTER; @@ -228,12 +228,17 @@ static void blender_camera_from_object(BlenderCamera *bcam, bcam->sensor_fit = BlenderCamera::HORIZONTAL; else bcam->sensor_fit = BlenderCamera::VERTICAL; - - bcam->motion_steps = object_motion_steps(b_ob, b_ob); } - else { - /* from lamp not implemented yet */ + else if(b_ob_data.is_a(&RNA_Light)) { + /* Can also look through spot light. */ + BL::SpotLight b_light(b_ob_data); + float lens = 16.0f / tanf(b_light.spot_size() * 0.5f); + if (lens > 0.0f) { + bcam->lens = lens; + } } + + bcam->motion_steps = object_motion_steps(b_ob, b_ob); } static Transform blender_camera_matrix(const Transform& tfm, @@ -643,7 +648,7 @@ static void blender_camera_from_view(BlenderCamera *bcam, if(b_rv3d.view_perspective() == BL::RegionView3D::view_perspective_CAMERA) { /* camera view */ - BL::Object b_ob = (b_v3d.lock_camera_and_layers())? b_scene.camera(): b_v3d.camera(); + BL::Object b_ob = (b_v3d.use_local_camera())? b_v3d.camera(): b_scene.camera(); if(b_ob) { blender_camera_from_object(bcam, b_engine, b_ob, skip_panorama); @@ -779,7 +784,7 @@ static void blender_camera_border(BlenderCamera *bcam, return; } - BL::Object b_ob = (b_v3d.lock_camera_and_layers())? b_scene.camera(): b_v3d.camera(); + BL::Object b_ob = (b_v3d.use_local_camera())? b_v3d.camera(): b_scene.camera(); if(!b_ob) return; |