Blender V2.61 - r43446
|
#include <stdlib.h>
#include "DNA_camera_types.h"
#include "DNA_lamp_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_view3d_types.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "BKE_animsys.h"
#include "BKE_camera.h"
#include "BKE_object.h"
#include "BKE_global.h"
#include "BKE_library.h"
#include "BKE_main.h"
#include "BKE_screen.h"
Go to the source code of this file.
Classes | |
struct | CameraViewFrameData |
Typedefs | |
typedef struct CameraViewFrameData | CameraViewFrameData |
Functions | |
void * | add_camera (const char *name) |
Camera * | copy_camera (Camera *cam) |
void | make_local_camera (Camera *cam) |
void | free_camera (Camera *ca) |
void | object_camera_mode (RenderData *rd, Object *cam_ob) |
float | object_camera_dof_distance (Object *ob) |
float | camera_sensor_size (int sensor_fit, float sensor_x, float sensor_y) |
int | camera_sensor_fit (int sensor_fit, float sizex, float sizey) |
void | camera_params_init (CameraParams *params) |
void | camera_params_from_object (CameraParams *params, Object *ob) |
void | camera_params_from_view3d (CameraParams *params, View3D *v3d, RegionView3D *rv3d) |
void | camera_params_compute_viewplane (CameraParams *params, int winx, int winy, float xasp, float yasp) |
void | camera_params_compute_matrix (CameraParams *params) |
void | camera_view_frame_ex (Scene *scene, Camera *camera, float drawsize, const short do_clip, const float scale[3], float r_asp[2], float r_shift[2], float *r_drawsize, float r_vec[4][3]) |
void | camera_view_frame (Scene *scene, Camera *camera, float r_vec[4][3]) |
static void | camera_to_frame_view_cb (const float co[3], void *user_data) |
int | camera_view_frame_fit_to_scene (Scene *scene, struct View3D *v3d, Object *camera_ob, float r_co[3]) |
Definition in file camera.c.
typedef struct CameraViewFrameData CameraViewFrameData |
void* add_camera | ( | const char * | name | ) |
Definition at line 53 of file camera.c.
References alloc_libblock(), CAM_SHOWPASSEPARTOUT, Camera::clipend, Camera::clipsta, Camera::drawsize, Camera::flag, G, ID_CA, Camera::lens, Camera::ortho_scale, Camera::passepartalpha, Camera::sensor_x, and Camera::sensor_y.
Referenced by add_obdata_from_type(), and DocumentImporter::writeCamera().
void camera_params_compute_matrix | ( | CameraParams * | params | ) |
Definition at line 354 of file camera.c.
References CameraParams::clipend, CameraParams::clipsta, CameraParams::is_ortho, orthographic_m4(), perspective_m4(), CameraParams::viewplane, CameraParams::winmat, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by ED_view3d_draw_offscreen_imbuf(), ED_view3d_draw_offscreen_imbuf_simple(), project_paint_begin(), RE_SetCamera(), and RE_SetEnvmapCamera().
void camera_params_compute_viewplane | ( | CameraParams * | params, |
int | winx, | ||
int | winy, | ||
float | xasp, | ||
float | yasp | ||
) |
Definition at line 278 of file camera.c.
References camera_sensor_fit(), CAMERA_SENSOR_FIT_HOR, camera_sensor_size(), CameraParams::clipsta, CameraParams::field_odd, CameraParams::field_second, CameraParams::is_ortho, CameraParams::lens, CameraParams::offsetx, CameraParams::offsety, CameraParams::ortho_scale, CameraParams::sensor_fit, CameraParams::sensor_x, CameraParams::sensor_y, CameraParams::shiftx, CameraParams::shifty, CameraParams::use_fields, CameraParams::viewdx, CameraParams::viewdy, CameraParams::viewplane, rctf::xmax, rctf::xmin, CameraParams::ycor, rctf::ymax, rctf::ymin, and CameraParams::zoom.
Referenced by ED_view3d_draw_offscreen_imbuf(), ED_view3d_draw_offscreen_imbuf_simple(), ED_view3d_viewplane_get(), project_paint_begin(), RE_SetCamera(), RE_SetEnvmapCamera(), and view3d_camera_border().
void camera_params_from_object | ( | CameraParams * | params, |
Object * | ob | ||
) |
Definition at line 203 of file camera.c.
References acos(), CAM_ORTHO, Lamp::clipend, Camera::clipend, CameraParams::clipend, Lamp::clipsta, Camera::clipsta, CameraParams::clipsta, cosf, Object::data, CameraParams::is_ortho, Camera::lens, CameraParams::lens, M_PI, OB_CAMERA, OB_LAMP, Camera::ortho_scale, CameraParams::ortho_scale, Camera::sensor_fit, CameraParams::sensor_fit, Camera::sensor_x, CameraParams::sensor_x, Camera::sensor_y, CameraParams::sensor_y, Camera::shiftx, CameraParams::shiftx, Camera::shifty, CameraParams::shifty, sinf, Lamp::spotsize, TRUE, Camera::type, and Object::type.
Referenced by camera_params_from_view3d(), ED_view3d_draw_offscreen_imbuf(), ED_view3d_draw_offscreen_imbuf_simple(), ED_view3d_from_object(), followtrack_evaluate(), project_paint_begin(), RE_SetCamera(), RE_SetEnvmapCamera(), and view3d_camera_border().
void camera_params_from_view3d | ( | CameraParams * | params, |
View3D * | v3d, | ||
RegionView3D * | rv3d | ||
) |
Definition at line 242 of file camera.c.
References BKE_screen_view3d_zoom_to_fac(), RegionView3D::camdx, RegionView3D::camdy, View3D::camera, camera_params_from_object(), RegionView3D::camzoom, CameraParams::clipend, CameraParams::clipsta, RegionView3D::dist, View3D::far, CameraParams::is_ortho, CameraParams::lens, View3D::lens, View3D::near, CameraParams::offsetx, CameraParams::offsety, CameraParams::ortho_scale, RegionView3D::persp, RV3D_CAMOB, RV3D_ORTHO, CameraParams::shiftx, CameraParams::shifty, TRUE, and CameraParams::zoom.
Referenced by ED_view3d_clip_range_get(), ED_view3d_viewplane_get(), and view3d_camera_border().
void camera_params_init | ( | CameraParams * | params | ) |
Definition at line 191 of file camera.c.
References CAMERA_SENSOR_FIT_AUTO, DEFAULT_SENSOR_HEIGHT, DEFAULT_SENSOR_WIDTH, CameraParams::sensor_fit, CameraParams::sensor_x, CameraParams::sensor_y, and CameraParams::zoom.
Referenced by ED_view3d_clip_range_get(), ED_view3d_draw_offscreen_imbuf(), ED_view3d_draw_offscreen_imbuf_simple(), ED_view3d_from_object(), ED_view3d_viewplane_get(), followtrack_evaluate(), project_paint_begin(), RE_SetCamera(), RE_SetEnvmapCamera(), and view3d_camera_border().
int camera_sensor_fit | ( | int | sensor_fit, |
float | sizex, | ||
float | sizey | ||
) |
Definition at line 177 of file camera.c.
References CAMERA_SENSOR_FIT_AUTO, CAMERA_SENSOR_FIT_HOR, and CAMERA_SENSOR_FIT_VERT.
Referenced by camera_params_compute_viewplane(), camera_view_frame_ex(), drawviewborder(), and uvprojectModifier_do().
float camera_sensor_size | ( | int | sensor_fit, |
float | sensor_x, | ||
float | sensor_y | ||
) |
Definition at line 168 of file camera.c.
References CAMERA_SENSOR_FIT_VERT.
Referenced by camera_params_compute_viewplane(), and uvprojectModifier_do().
static void camera_to_frame_view_cb | ( | const float | co[3], |
void * | user_data | ||
) | [static] |
Definition at line 453 of file camera.c.
References data, dist_to_plane_v3(), CameraViewFrameData::dist_vals, CameraViewFrameData::frame_tx, i, CameraViewFrameData::normal_tx, and CameraViewFrameData::tot.
Referenced by camera_view_frame_fit_to_scene().
Definition at line 434 of file camera.c.
References camera_view_frame_ex(), and FALSE.
Referenced by camera_view_frame_fit_to_scene().
void camera_view_frame_ex | ( | Scene * | scene, |
Camera * | camera, | ||
float | drawsize, | ||
const short | do_clip, | ||
const float | scale[3], | ||
float | r_asp[2], | ||
float | r_shift[2], | ||
float * | r_drawsize, | ||
float | r_vec[4][3] | ||
) |
Definition at line 369 of file camera.c.
References CAM_ORTHO, camera_sensor_fit(), CAMERA_SENSOR_FIT_HOR, CAMERA_SENSOR_FIT_VERT, Camera::clipsta, Camera::lens, Camera::ortho_scale, Scene::r, Camera::sensor_fit, Camera::sensor_x, Camera::sensor_y, Camera::shiftx, Camera::shifty, Camera::type, RenderData::xasp, RenderData::xsch, RenderData::yasp, and RenderData::ysch.
Referenced by camera_view_frame(), and drawcamera().
int camera_view_frame_fit_to_scene | ( | Scene * | scene, |
struct View3D * | v3d, | ||
Object * | camera_ob, | ||
float | r_co[3] | ||
) |
Definition at line 470 of file camera.c.
References add_v3_v3v3(), BA_SELECT, BKE_scene_foreach_display_point(), camera_to_frame_view_cb(), camera_view_frame(), copy_m3_m4(), copy_v3_v3(), Object::data, CameraViewFrameData::dist_vals, dot_v3v3(), FALSE, FLT_MAX, CameraViewFrameData::frame_tx, i, isect_line_line_v3(), isect_plane_plane_v3(), len_v3(), madd_v3_v3fl(), mul_m3_v3(), mul_v3_fl(), mul_v3_v3fl(), normal_tri_v3(), CameraViewFrameData::normal_tx, normalize_m3(), normalize_v3(), Object::obmat, sub_v3_v3v3(), CameraViewFrameData::tot, and TRUE.
Referenced by view3d_camera_to_view_selected_exec().
Definition at line 72 of file camera.c.
References copy_libblock(), Camera::dof_ob, Camera::id, and id_lib_extern().
Referenced by id_copy(), make_local_camera(), object_add_duplicate_internal(), and single_obdata_users().
void free_camera | ( | Camera * | ca | ) |
Definition at line 130 of file camera.c.
References BKE_free_animdata().
Referenced by free_libblock().
void make_local_camera | ( | Camera * | cam | ) |
Definition at line 83 of file camera.c.
References BKE_id_lib_local_paths(), copy_camera(), Object::data, ELEM, FALSE, ListBase::first, G, Camera::id, Object::id, id_clear_lib_data(), ID::lib, ID::next, NULL, Main::object, TRUE, and ID::us.
Referenced by id_make_local().
float object_camera_dof_distance | ( | Object * | ob | ) |
Definition at line 149 of file camera.c.
References copy_m4_m4(), Object::data, Camera::dof_ob, fabsf, if(), invert_m4_m4(), mult_m4_m4m4(), normalize_m4(), OB_CAMERA, Object::obmat, Object::type, and Camera::YF_dofdist.
Referenced by defocus_blur(), and drawcamera().
void object_camera_mode | ( | RenderData * | rd, |
Object * | cam_ob | ||
) |
Definition at line 137 of file camera.c.
References CAM_ORTHO, CAM_PANORAMA, Object::data, Camera::flag, RenderData::mode, OB_CAMERA, R_ORTHO, R_PANORAMA, Camera::type, and Object::type.
Referenced by re_camera_params_get(), and RE_is_rendering_allowed().