Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/blender/blender_camera.cpp
| Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | struct BlenderCamera { | ||||
| float2 pixelaspect; | float2 pixelaspect; | ||||
| float aperture_ratio; | float aperture_ratio; | ||||
| PanoramaType panorama_type; | PanoramaType panorama_type; | ||||
| float fisheye_fov; | float fisheye_fov; | ||||
| float fisheye_lens; | float fisheye_lens; | ||||
| float latitude_min; | |||||
| float latitude_max; | |||||
| float longitude_min; | |||||
| float longitude_max; | |||||
| enum { AUTO, HORIZONTAL, VERTICAL } sensor_fit; | enum { AUTO, HORIZONTAL, VERTICAL } sensor_fit; | ||||
| float sensor_width; | float sensor_width; | ||||
| float sensor_height; | float sensor_height; | ||||
| int full_width; | int full_width; | ||||
| int full_height; | int full_height; | ||||
| ▲ Show 20 Lines • Show All 78 Lines • ▼ Show 20 Lines | switch(RNA_enum_get(&ccamera, "panorama_type")) | ||||
| case 0: | case 0: | ||||
| default: | default: | ||||
| bcam->panorama_type = PANORAMA_EQUIRECTANGULAR; | bcam->panorama_type = PANORAMA_EQUIRECTANGULAR; | ||||
| break; | break; | ||||
| } | } | ||||
| bcam->fisheye_fov = RNA_float_get(&ccamera, "fisheye_fov"); | bcam->fisheye_fov = RNA_float_get(&ccamera, "fisheye_fov"); | ||||
| bcam->fisheye_lens = RNA_float_get(&ccamera, "fisheye_lens"); | bcam->fisheye_lens = RNA_float_get(&ccamera, "fisheye_lens"); | ||||
| bcam->latitude_min = RNA_float_get(&ccamera, "latitude_min"); | |||||
| bcam->latitude_max = RNA_float_get(&ccamera, "latitude_max"); | |||||
| bcam->longitude_min = RNA_float_get(&ccamera, "longitude_min"); | |||||
| bcam->longitude_max = RNA_float_get(&ccamera, "longitude_max"); | |||||
| bcam->ortho_scale = b_camera.ortho_scale(); | bcam->ortho_scale = b_camera.ortho_scale(); | ||||
| bcam->lens = b_camera.lens(); | bcam->lens = b_camera.lens(); | ||||
| /* allow f/stop number to change aperture_size but still | /* allow f/stop number to change aperture_size but still | ||||
| * give manual control over aperture radius */ | * give manual control over aperture radius */ | ||||
| int aperture_type = RNA_enum_get(&ccamera, "aperture_type"); | int aperture_type = RNA_enum_get(&ccamera, "aperture_type"); | ||||
| ▲ Show 20 Lines • Show All 169 Lines • ▼ Show 20 Lines | static void blender_camera_sync(Camera *cam, BlenderCamera *bcam, int width, int height) | ||||
| /* type */ | /* type */ | ||||
| cam->type = bcam->type; | cam->type = bcam->type; | ||||
| /* panorama */ | /* panorama */ | ||||
| cam->panorama_type = bcam->panorama_type; | cam->panorama_type = bcam->panorama_type; | ||||
| cam->fisheye_fov = bcam->fisheye_fov; | cam->fisheye_fov = bcam->fisheye_fov; | ||||
| cam->fisheye_lens = bcam->fisheye_lens; | cam->fisheye_lens = bcam->fisheye_lens; | ||||
| cam->latitude_min = bcam->latitude_min; | |||||
| cam->latitude_max = bcam->latitude_max; | |||||
| cam->longitude_min = bcam->longitude_min; | |||||
| cam->longitude_max = bcam->longitude_max; | |||||
| /* anamorphic lens bokeh */ | /* anamorphic lens bokeh */ | ||||
| cam->aperture_ratio = bcam->aperture_ratio; | cam->aperture_ratio = bcam->aperture_ratio; | ||||
| /* perspective */ | /* perspective */ | ||||
| cam->fov = 2.0f * atanf((0.5f * sensor_size) / bcam->lens / aspectratio); | cam->fov = 2.0f * atanf((0.5f * sensor_size) / bcam->lens / aspectratio); | ||||
| cam->focaldistance = bcam->focaldistance; | cam->focaldistance = bcam->focaldistance; | ||||
| cam->aperturesize = bcam->aperturesize; | cam->aperturesize = bcam->aperturesize; | ||||
| ▲ Show 20 Lines • Show All 253 Lines • Show Last 20 Lines | |||||