Blender
V3.3
|
Camera data-block and utility functions. More...
Go to the source code of this file.
Classes | |
struct | CameraParams |
Macros | |
#define | CAMERA_PARAM_ZOOM_INIT_CAMOB 1.0f |
#define | CAMERA_PARAM_ZOOM_INIT_PERSP 2.0f |
Typedefs | |
typedef struct CameraParams | CameraParams |
Camera data-block and utility functions.
Definition in file BKE_camera.h.
#define CAMERA_PARAM_ZOOM_INIT_CAMOB 1.0f |
Definition at line 76 of file BKE_camera.h.
#define CAMERA_PARAM_ZOOM_INIT_PERSP 2.0f |
Definition at line 77 of file BKE_camera.h.
typedef struct CameraParams CameraParams |
Camera Parameters:
Intermediate struct for storing camera parameters from various sources, to unify computation of view-plane, window matrix, ... etc.
Definition at line 203 of file camera.c.
References BKE_id_new(), and ID_CA.
Referenced by BKE_object_obdata_add_from_type(), blender::io::usd::USDCameraReader::create_object(), blender::io::alembic::AbcCameraReader::readObjectData(), and DocumentImporter::writeCamera().
Definition at line 1182 of file camera.c.
References Camera::bg_images, BKE_camera_background_image_remove(), ListBase::first, and CameraBGImage::next.
struct CameraBGImage* BKE_camera_background_image_copy | ( | struct CameraBGImage * | bgpic_src, |
const int | copy_flag | ||
) |
Duplicate a background image, in a ID management compatible way.
copy_flag | The usual ID copying flags, see LIB_ID_CREATE_ /LIB_ID_COPY_ enums in BKE_lib_id.h . |
Definition at line 1157 of file camera.c.
References CAM_BGIMG_FLAG_OVERRIDE_LIBRARY_LOCAL, CameraBGImage::clip, CameraBGImage::flag, id_us_plus(), CameraBGImage::ima, LIB_ID_COPY_NO_LIB_OVERRIDE_LOCAL_DATA_FLAG, LIB_ID_CREATE_NO_USER_REFCOUNT, MEM_dupallocN, CameraBGImage::next, NULL, and CameraBGImage::prev.
Referenced by camera_copy_data().
struct CameraBGImage* BKE_camera_background_image_new | ( | struct Camera * | cam | ) |
Definition at line 1143 of file camera.c.
References CameraBGImage::alpha, Camera::bg_images, BLI_addtail(), CAM_BGIMG_FLAG_EXPANDED, CAM_BGIMG_FLAG_OVERRIDE_LIBRARY_LOCAL, CameraBGImage::flag, ImageUser::flag, IMA_ANIM_ALWAYS, CameraBGImage::iuser, MEM_callocN, and CameraBGImage::scale.
Referenced by background_image_add_exec(), and background_image_add_invoke().
void BKE_camera_background_image_remove | ( | struct Camera * | cam, |
struct CameraBGImage * | bgpic | ||
) |
Definition at line 1175 of file camera.c.
References Camera::bg_images, BLI_remlink(), and MEM_freeN.
Referenced by background_image_remove_exec(), and BKE_camera_background_image_clear().
void BKE_camera_multiview_model_matrix | ( | const struct RenderData * | rd, |
const struct Object * | camera, | ||
const char * | viewname, | ||
float | r_modelmat[4][4] | ||
) |
void BKE_camera_multiview_model_matrix_scaled | ( | const struct RenderData * | rd, |
const struct Object * | camera, | ||
const char * | viewname, | ||
float | r_modelmat[4][4] | ||
) |
Referenced by camera_stereoscopy_extra().
void BKE_camera_multiview_params | ( | const struct RenderData * | rd, |
struct CameraParams * | params, | ||
const struct Object * | camera, | ||
const char * | viewname | ||
) |
Referenced by ED_view3d_draw_offscreen_imbuf(), ED_view3d_draw_offscreen_imbuf_simple(), and RE_SetCamera().
struct Object* BKE_camera_multiview_render | ( | const struct Scene * | scene, |
struct Object * | camera, | ||
const char * | viewname | ||
) |
Returns the camera to be used for render.
Referenced by camera_stereoscopy_extra(), check_valid_camera_multiview(), ED_view3d_draw_offscreen_imbuf(), ED_view3d_draw_offscreen_imbuf_simple(), RE_GetCamera(), screen_opengl_render_doit(), screen_opengl_views_setup(), view3d_stereo3d_setup(), and view3d_stereo3d_setup_offscreen().
float BKE_camera_multiview_shift_x | ( | const struct RenderData * | rd, |
const struct Object * | camera, | ||
const char * | viewname | ||
) |
Referenced by camera_offaxis_shiftx_get(), RE_engine_get_camera_shift_x(), and view3d_stereo3d_setup().
bool BKE_camera_multiview_spherical_stereo | ( | const struct RenderData * | rd, |
const struct Object * | camera | ||
) |
Referenced by RE_engine_get_spherical_stereo().
void BKE_camera_multiview_view_matrix | ( | const struct RenderData * | rd, |
const struct Object * | camera, | ||
bool | is_left, | ||
float | r_viewmat[4][4] | ||
) |
The view matrix is used by the viewport drawing, it is basically the inverted model matrix.
Referenced by view3d_stereo3d_setup(), and view3d_stereo3d_setup_offscreen().
void BKE_camera_multiview_window_matrix | ( | const struct RenderData * | rd, |
const struct Object * | camera, | ||
const char * | viewname, | ||
float | r_winmat[4][4] | ||
) |
Get the camera's DOF value, takes the DOF object into account.
Referenced by blender::compositor::ConvertDepthToRadiusOperation::determine_focal_distance(), blender::io::usd::USDCameraWriter::do_write(), EEVEE_depth_of_field_init(), GPENCIL_cache_init(), OVERLAY_camera_cache_populate(), and workbench_dof_engine_init().
void BKE_camera_params_compute_matrix | ( | CameraParams * | params | ) |
View-plane is assumed to be already computed.
Definition at line 429 of file camera.c.
References orthographic_m4(), params, perspective_m4(), rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by BKE_camera_multiview_window_matrix(), camera_frame_fit_data_init(), ED_view3d_draw_offscreen_imbuf(), ED_view3d_draw_offscreen_imbuf_simple(), blender::io::gpencil::GpencilIO::prepare_camera_params(), proj_paint_state_viewport_init(), RE_GetCameraWindowWithOverscan(), RE_SetCamera(), and uvprojectModifier_do().
void BKE_camera_params_compute_viewplane | ( | CameraParams * | params, |
int | winx, | ||
int | winy, | ||
float | aspx, | ||
float | aspy | ||
) |
Definition at line 364 of file camera.c.
References BKE_camera_sensor_fit(), BKE_camera_sensor_size(), CAMERA_SENSOR_FIT_HOR, float(), params, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by BKE_camera_multiview_window_matrix(), camera_frame_fit_data_init(), ED_view3d_draw_offscreen_imbuf(), ED_view3d_draw_offscreen_imbuf_simple(), ED_view3d_viewplane_get(), blender::io::gpencil::GpencilIO::prepare_camera_params(), proj_paint_state_viewport_init(), RE_SetCamera(), uvprojectModifier_do(), and view3d_camera_border().
void BKE_camera_params_from_object | ( | CameraParams * | params, |
const struct Object * | cam_ob | ||
) |
Referenced by ED_view3d_draw_offscreen_imbuf(), ED_view3d_draw_offscreen_imbuf_simple(), ED_view3d_from_object(), ED_view3d_radius_to_dist(), followtrack_evaluate_using_2d_position(), blender::io::gpencil::GpencilIO::prepare_camera_params(), proj_paint_state_viewport_init(), RE_SetCamera(), uvprojectModifier_do(), and view3d_camera_border().
void BKE_camera_params_from_view3d | ( | CameraParams * | params, |
const struct Depsgraph * | depsgraph, | ||
const struct View3D * | v3d, | ||
const struct RegionView3D * | rv3d | ||
) |
Referenced by ED_view3d_clip_range_get(), ED_view3d_viewplane_get(), and view3d_camera_border().
void BKE_camera_params_init | ( | CameraParams * | params | ) |
Definition at line 265 of file camera.c.
References CAMERA_SENSOR_FIT_AUTO, DEFAULT_SENSOR_HEIGHT, DEFAULT_SENSOR_WIDTH, and params.
Referenced by BKE_camera_multiview_window_matrix(), camera_frame_fit_data_init(), ED_view3d_clip_range_get(), ED_view3d_draw_offscreen_imbuf(), ED_view3d_draw_offscreen_imbuf_simple(), ED_view3d_from_object(), ED_view3d_radius_to_dist(), ED_view3d_viewplane_get(), followtrack_evaluate_using_2d_position(), blender::io::gpencil::GpencilIO::prepare_camera_params(), proj_paint_state_viewport_init(), RE_SetCamera(), uvprojectModifier_do(), and view3d_camera_border().
Definition at line 246 of file camera.c.
References CAMERA_SENSOR_FIT_AUTO, CAMERA_SENSOR_FIT_HOR, and CAMERA_SENSOR_FIT_VERT.
Referenced by BKE_camera_params_compute_viewplane(), BKE_camera_view_frame_ex(), blender::io::usd::camera_sensor_size_for_render(), drawviewborder(), ED_view3d_win_to_3d(), lineart_create_render_buffer(), lineart_main_load_geometries(), and WIDGETGROUP_camera_refresh().
Definition at line 236 of file camera.c.
References CAMERA_SENSOR_FIT_VERT.
Referenced by BKE_camera_params_compute_viewplane(), BKE_camera_params_from_view3d(), camera_frame_fit_calc_from_data(), ED_view3d_radius_to_dist(), EEVEE_depth_of_field_init(), GPENCIL_cache_init(), blender::compositor::ConvertDepthToRadiusOperation::init_execution(), lineart_main_load_geometries(), WIDGETGROUP_camera_refresh(), and workbench_dof_engine_init().
void BKE_camera_view_frame | ( | const struct Scene * | scene, |
const struct Camera * | camera, | ||
float | r_vec[4][3] | ||
) |
Referenced by image_camera_background_matrix_get().
void BKE_camera_view_frame_ex | ( | const struct Scene * | scene, |
const struct Camera * | camera, | ||
float | drawsize, | ||
bool | do_clip, | ||
const float | scale[3], | ||
float | r_asp[2], | ||
float | r_shift[2], | ||
float * | r_drawsize, | ||
float | r_vec[4][3] | ||
) |
Referenced by OVERLAY_camera_cache_populate().
bool BKE_camera_view_frame_fit_to_coords | ( | const struct Depsgraph * | depsgraph, |
const float(*) | cos[3], | ||
int | num_cos, | ||
struct Object * | camera_ob, | ||
float | r_co[3], | ||
float * | r_scale | ||
) |
bool BKE_camera_view_frame_fit_to_scene | ( | struct Depsgraph * | depsgraph, |
const struct Scene * | scene, | ||
struct Object * | camera_ob, | ||
float | r_co[3], | ||
float * | r_scale, | ||
float * | r_clip_start, | ||
float * | r_clip_end | ||
) |
r_scale | only valid/useful for orthographic cameras. |
Referenced by view3d_camera_to_view_selected_impl().