92 float r_text_color[4],
93 float r_shadow_color[4])
96 r_text_color[3] = 1.0f;
97 r_shadow_color[3] = 0.8f;
107 if (text_lightness > 0.5f) {
118 if (text_lightness > 0.4f) {
158 return use_persp_range ? (v3d->
clip_start * 1.5f) : v3d->
grid * 0.001f;
172 const bool use_ortho_factor,
181 if (use_ortho_factor && params.
is_ortho) {
223 *r_pixsize = params.
viewdx;
246 printf(
"view3d_region_operator_needs_gpu error, wrong region\n");
263 float viewdist = rv3d->
dist;
287 if (area ==
nullptr) {
292 if (region ==
nullptr) {
313 for (
int val = 0; val < 4; val++) {
315 if (is_flip) [[unlikely]] {
327 memset(bb->
vec, 0,
sizeof(bb->
vec));
331 for (
int val = 0; val < 4; val++) {
344 for (
int val = 0; val < 8; val++) {
352 int flip_sign = (ob) ?
is_negative_m4(ob->object_to_world().ptr()) :
false;
369 const float co[3],
int ,
int ,
int ,
void *user_data_p)
379 float planes[6 + 6][4];
382 for (
int i = 0; i < 3; i++) {
383 float *plane_min = planes[(i * 2) + 0];
384 float *plane_max = planes[(i * 2) + 1];
387 plane_min[i] = -1.0f;
388 plane_min[3] = +
min[i];
389 plane_max[i] = +1.0f;
390 plane_max[3] = -
max[i];
396 for (
int i = 0; i < clip_len; i++) {
405 const float eps_coplanar = 1e-4f;
406 const float eps_isect = 1e-6f;
425 int a, flag = -1, fl;
427 for (a = 0; a < 8; a++) {
468 float persmatob[4][4];
578 const float camzoom_init = rv3d->
camzoom;
582 zoomfac = zoomfac *
scale;
586 return (rv3d->
camzoom != camzoom_init);
592 const float camdxy_init[2] = {rv3d->
camdx, rv3d->
camdy};
595 event_ofs[0] / (region->
winx * zoomfac),
596 event_ofs[1] / (region->
winy * zoomfac),
609 xy = rot_invert * xy;
619 return (camdxy_init[0] != rv3d->
camdx) || (camdxy_init[1] != rv3d->
camdy);
639 const bool calc_dist)
671 float view_mat[4][4];
672 float diff_mat[4][4];
673 float parent_mat[4][4];
675 while (root_parent->
parent) {
676 root_parent = root_parent->
parent;
688 mul_m4_m4m4(parent_mat, diff_mat, root_parent_eval->object_to_world().ptr());
698 ob_update = ob_update->
parent;
720 const Scene *scene,
ID *id_key,
bContext *
C,
const bool do_rotate,
const bool do_translate)
730 Object *camera_object =
reinterpret_cast<Object *
>(id_key);
735 switch (camera_object->
rotmode) {
737 rna_paths.
append({
"rotation_quaternion"});
741 rna_paths.
append({
"rotation_axis_angle"});
745 rna_paths.
append({
"rotation_euler"});
750 rna_paths.
append({
"location"});
769 while (root_parent->
parent) {
770 root_parent = root_parent->
parent;
772 id_key = &root_parent->
id;
805 const bool undo_group)
845 BoundBox *bb = MEM_new<BoundBox>(
"clipbb");
847 float x1 = 0.0f, y1 = 0.0f, z1 = 0.0f, ofs[3] = {0.0f, 0.0f, 0.0f};
872 ofs[2] = rv3d->
ofs[2];
885 for (
int val = 0; val < 8; val++) {
886 if (
ELEM(val, 0, 3, 4, 7)) {
887 bb->
vec[val][0] = -x1 - ofs[0];
890 bb->
vec[val][0] = x1 - ofs[0];
893 if (
ELEM(val, 0, 1, 4, 5)) {
894 bb->
vec[val][1] = -y1 - ofs[1];
897 bb->
vec[val][1] = y1 - ofs[1];
901 bb->
vec[val][2] = -z1 - ofs[2];
904 bb->
vec[val][2] = z1 - ofs[2];
917 for (
int val = 0; val < 6; val++) {
918 clip[val][3] = -
dot_v3v3(clip[val], bb->
vec[val % 5]);
928 memcpy(rv3d->
clip, clip,
sizeof(clip));
932 rv3d->
clipbb = MEM_dupalloc(bb);
946 const float axis_eps = 0.5f;
950 float view_axis_all[4][3] = {
951 {1.0f, 0.0f, 0.0f}, {0.0f, 1.0f, 0.0f}, {1.0f, 0.0f, 0.0f}, {0.0f, 1.0f, 0.0f}};
953 float *view_src_x = &view_axis_all[0][0];
954 float *view_src_y = &view_axis_all[1][0];
956 float *view_dst_x = &view_axis_all[2][0];
957 float *view_dst_y = &view_axis_all[3][0];
980 for (i = 0; i < 3; i++) {
981 if (((
fabsf(view_src_x[i]) > axis_eps) || (
fabsf(view_src_y[i]) > axis_eps)) &&
982 ((
fabsf(view_dst_x[i]) > axis_eps) || (
fabsf(view_dst_y[i]) > axis_eps)))
984 rv3d_dst->
ofs[i] = rv3d_src->
ofs[i];
1039 ARegion *region_sync =
nullptr;
1055 for (; region; region = region->
prev) {
1067 region_sync = region;
1077 int index_qsplit = 0;
1121 if (autodepth_last) {
1136 const bool has_depth)
1156 if (autodepth_last ==
nullptr) {
1160 if (autodepth_last->
has_depth ==
false) {
1179 rect.
xmin = mval[0];
1180 rect.
ymin = mval[1];
1181 rect.
xmax = mval[0] + 1;
1182 rect.
ymax = mval[1] + 1;
1191 MEM_SAFE_DELETE(depth_temp.
depths);
1198 float mouse_worldloc[3],
1199 const float fallback_depth_pt[3])
1202 int margin_arr[] = {0, 2, 4};
1203 bool depth_ok =
false;
1209 depth_ok = (depth_close !=
FLT_MAX);
1210 }
while ((depth_ok ==
false) && (i <
ARRAY_SIZE(margin_arr)));
1213 float centx =
float(mval[0]) + 0.5f;
1214 float centy =
float(mval[1]) + 0.5f;
1221 if (fallback_depth_pt) {
1230 float mouse_worldloc[3],
1232 const float *force_depth)
1237 depth = *force_depth;
1247 float centx =
float(mval[0]) + 0.5f;
1248 float centy =
float(mval[1]) + 0.5f;
1266 data->depth = depth;
1273 const ViewDepths *vd,
const int mval_sta[2],
const int mval_end[2],
int margin,
float *r_depth)
1284 data.margin = margin;
1292 *r_depth =
data.depth;
1294 return (*r_depth != 1.0f);
1307 return radius * (1.0f /
tanf(
angle / 2.0f));
1317 const Depsgraph *depsgraph,
1319 const bool use_aspect,
1331 float lens, sensor_size, zoom;
1373 winx = region->
winx;
1374 winy = region->
winy;
1378 float aspect = winx / winy;
1379 if (aspect < 1.0f) {
1380 aspect = 1.0f / aspect;
1397 const float fallback_dist)
1399 float pos[4] = {0.0f, 0.0f, 0.0f, 1.0f};
1400 float dir[4] = {0.0f, 0.0f, 1.0f, 0.0f};
1409 if ((dist <
FLT_EPSILON) && (fallback_dist != 0.0f)) {
1410 dist = fallback_dist;
1437 const float dist_co[3],
1438 const float dist_min)
1443 float tvec[3] = {0.0f, 0.0f, -1.0f};
1446 float dist_co_local[3];
1448 sub_v3_v3v3(dist_co_local, dist_co, dist_co_local);
1449 const float delta =
dot_v3v3(tvec, dist_co_local);
1450 const float dist_new = rv3d->
dist + delta;
1451 if (dist_new >= dist_min) {
1453 rv3d->
dist = dist_new;
1472 {0.5f, -0.5f, -0.5f, 0.5f},
1474 {-0.5f, 0.5f, -0.5f, 0.5f},
1478 {0.5f, 0.5f, -0.5f, -0.5f},
1480 {0.5f, 0.5f, 0.5f, 0.5f},
1483 {0.5f, -0.5f, 0.5f, 0.5f},
1485 {-0.5f, -0.5f, -0.5f, 0.5f},
1491 {0.5f, -0.5f, -0.5f, -0.5f},
1493 {0.5f, 0.5f, -0.5f, 0.5f},
1497 {1.0f, 0.0f, 0.0f, 0.0f},
1503 {0.0f, -1.0f, 0.0f, 0.0f},
1524 const float epsilon,
1556 const float delta_test =
fabsf(
1558 if (delta_best > delta_test) {
1559 delta_best = delta_test;
1574 const float epsilon,
1584 return is_axis_view;
1631 constexpr float angle_threshold = 0.02f;
1677 const float mat[4][4],
float ofs[3],
float quat[4],
const float *dist,
const float roll)
1682 BLI_assert(dist ==
nullptr || ofs !=
nullptr);
1710 float mat[4][4],
const float ofs[3],
const float quat[4],
const float dist,
const float roll)
1712 float quat_no_roll[4];
1713 const float *quat_p = quat;
1718 quat_p = quat_no_roll;
1721 const float iviewquat[4] = {-quat_p[0], quat_p[1], quat_p[2], quat_p[3]};
1722 float dvec[3] = {0.0f, 0.0f, dist};
1743 *r_lens = params.
lens;
1750 const float quat[4],
1762 Depsgraph *depsgraph,
1765 float *r_clip_start,
1773 depsgraph, scene, camera_ob_eval, co, &
scale, r_clip_start, r_clip_end))
1776 float obmat_new[4][4];
1777 bool is_ortho_camera =
false;
1780 ((id_cast<Camera *>(camera_ob_eval->
data))->type ==
CAM_ORTHO))
1782 (id_cast<Camera *>(camera_ob->
data))->ortho_scale =
scale;
1783 is_ortho_camera =
true;
1786 copy_m4_m4(obmat_new, camera_ob_eval->object_to_world().ptr());
1796 if (is_ortho_camera) {
1807 Depsgraph *depsgraph,
1815 Depsgraph *depsgraph,
1822 bmain, depsgraph, scene, camera_ob, &clip_start, &clip_end))
1825 (id_cast<Camera *>(camera_ob->
data))->clip_start = clip_start;
1826 (id_cast<Camera *>(camera_ob->
data))->clip_end = clip_end;
1830 (id_cast<Camera *>(camera_ob_eval->
data))->clip_start = clip_start;
1831 (id_cast<Camera *>(camera_ob_eval->
data))->clip_end = clip_end;
1854 float depth = *
static_cast<float *
>(
const_cast<void *
>(value));
1855 data->r_depth = std::min(depth,
data->r_depth);
1857 if ((++
data->count) >=
data->count_max) {
1871 if (!vd || !vd->
depths) {
1884 int shape[2] = {vd->
w, vd->
h};
1885 int pixel_count = (
min_ii(
x + margin + 1, shape[1]) -
max_ii(
x - margin, 0)) *
1890 data.count_max = pixel_count;
1891 data.r_depth = 1.0f;
1895 depth =
data.r_depth;
1901 if (depth != 1.0f) {
1918 bool depths_valid[9] = {
false};
1919 float coords[9][3] = {{0}};
1921 for (
int x = 0, i = 0;
x < 2;
x++) {
1922 for (
int y = 0;
y < 2;
y++) {
1923 const int mval_ofs[2] = {mval[0] + (
x - 1), mval[1] + (
y - 1)};
1925 float depth_fl = 1.0f;
1927 const double depth = double(depth_fl);
1928 if ((depth > depths->
depth_range[0]) && (depth < depths->depth_range[1])) {
1930 depths_valid[i] =
true;
1937 const int edges[2][6][2] = {
1939 {{0, 1}, {1, 2}, {3, 4}, {4, 5}, {6, 7}, {7, 8}},
1940 {{0, 3}, {3, 6}, {1, 4}, {4, 7}, {2, 5}, {5, 8}},
1943 float cross[2][3] = {{0.0f}};
1945 for (
int i = 0; i < 6; i++) {
1946 for (
int axis = 0; axis < 2; axis++) {
1947 if (depths_valid[edges[axis][i][0]] && depths_valid[edges[axis][i][1]]) {
1949 sub_v3_v3v3(delta, coords[edges[axis][i][0]], coords[edges[axis][i][1]]);
1966 float r_location_world[3])
1968 float centx =
float(mval[0]) + 0.5f;
1969 float centy =
float(mval[1]) + 0.5f;
Functions to insert, delete or modify keyframes.
Functionality to interact with keying sets.
Camera data-block and utility functions.
#define CAMERA_PARAM_ZOOM_INIT_PERSP
#define CAMERA_PARAM_ZOOM_INIT_CAMOB
General operations, lookup, etc. for blender objects.
Generic array manipulation API.
#define BLI_array_iter_spiral_square(arr, arr_shape, center, test_fn, user_data)
#define ID_IS_EDITABLE(_id)
#define DEFAULT_SENSOR_WIDTH
Object is a sort of wrapper for general info.
#define RV3D_VIEW_IS_AXIS(view)
#define RV3D_CAMZOOM_MIN_FACTOR
#define RV3D_LOCK_FLAGS(rv3d)
#define RV3D_CAMZOOM_MAX_FACTOR
#define VIEW3D_DIST_FALLBACK
Read Blender memory allocation and freeing.
#define INIT_MINMAX(min, max)
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
void append(const T &value)
float distance(float, float) RET
VecBase< float, 3 > cross(VecOp< float, 3 >, VecOp< float, 3 >) RET
float3x3 scale(float3x3 mat, float2 scale)
bool autokeyframe_cfra_can_key(const Scene *scene, ID *id)
void autokeyframe_object(bContext *C, const Scene *scene, Object *ob, Span< RNAPath > rna_paths)
AngleRadianBase< float > AngleRadian
MatT from_rotation(const RotationT &rotation)
void get_color_3fv(int colorid, float col[3])
void WM_main_add_notifier(uint type, void *reference)
bool ED_view3d_camera_lock_autokey(View3D *v3d, RegionView3D *rv3d, bContext *C, bool do_rotate, bool do_translate)
bool WM_event_consecutive_gesture_test(const wmEvent *event)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
ARegion * BKE_area_find_region_active_win(const ScrArea *area)
bool ED_view3d_viewplane_get(const Depsgraph *depsgraph, const View3D *v3d, const RegionView3D *rv3d, int winx, int winy, rctf *r_viewplane, float *r_clip_start, float *r_clip_end, float *r_pixsize)
bool ED_view3d_depth_read_cached_seg(const ViewDepths *vd, const int mval_sta[2], const int mval_end[2], int margin, float *r_depth)
MINLINE void negate_v3_v3(float r[3], const float a[3])
bool ED_view3d_quat_to_axis_view_and_reset_quat(float quat[4], float epsilon, eRegionView3D_View *r_view, eRegionView3D_ViewAxisRoll *r_view_axis_roll)
bool ED_view3d_camera_to_view_selected(Main *bmain, Depsgraph *depsgraph, const Scene *scene, Object *camera_ob)
ScrArea * CTX_wm_area(const bContext *C)
bool ED_view3d_camera_lock_check(const View3D *v3d, const RegionView3D *rv3d)
MINLINE void copy_v2_v2_int(int r[2], const int a[2])
void wmViewport(const rcti *winrct)
bool ED_view3d_clipping_clamp_minmax(const RegionView3D *rv3d, float min[3], float max[3])
void BKE_object_tfm_protected_backup(const Object *ob, ObjectTfmProtectedChannels *obtfm)
void ED_undo_grouped_push(bContext *C, const char *str, UndoEncodeHints hints=UndoEncodeHints(0))
bool ED_undo_is_memfile_compatible(const bContext *C)
void ED_view3d_background_color_get(const Scene *scene, const View3D *v3d, float r_color[3])
MINLINE void copy_v3_v3(float r[3], const float a[3])
static bool depth_read_test_fn(const void *value, void *userdata)
void copy_m3_m4(float m1[3][3], const float m2[4][4])
bool ED_view3d_camera_lock_undo_grouped_push(const char *str, const View3D *v3d, const RegionView3D *rv3d, bContext *C)
static void points_in_planes_minmax_fn(const float co[3], int, int, int, void *user_data_p)
void minmax_v3v3_v3(float min[3], float max[3], const float vec[3])
bool ED_view3d_autodist_last_get(wmWindow *win, float r_ofs[3])
void ED_view3d_distance_set(RegionView3D *rv3d, float dist)
void mat3_normalized_to_quat(float q[4], const float mat[3][3])
MINLINE void copy_v2_v2(float r[2], const float a[2])
bool ED_view3d_camera_view_zoom_scale(RegionView3D *rv3d, const float scale)
float ED_view3d_radius_to_dist(const View3D *v3d, const ARegion *region, const Depsgraph *depsgraph, eRegionView3D_Persp persp, bool use_aspect, float radius)
void view3d_depths_rect_create(ARegion *region, rcti *rect, ViewDepths *r_d)
void normalize_m3(float R[3][3]) ATTR_NONNULL()
bool ED_view3d_persp_ensure(const Depsgraph *depsgraph, View3D *v3d, ARegion *region)
void ED_view3d_polygon_offset(const RegionView3D *rv3d, float dist)
bool ED_view3d_camera_lock_sync(const Depsgraph *depsgraph, View3D *v3d, RegionView3D *rv3d)
MatBase< float, 2, 2 > float2x2
bool invert_m4_m4(float inverse[4][4], const float mat[4][4])
bool ED_view3d_camera_lock_undo_push(const char *str, const View3D *v3d, const RegionView3D *rv3d, bContext *C)
void BKE_camera_params_compute_viewplane(CameraParams *params, int winx, int winy, float aspx, float aspy)
bool ED_view3d_quat_to_axis_view(const float quat[4], float epsilon, eRegionView3D_View *r_view, eRegionView3D_ViewAxisRoll *r_view_axis_roll)
void WM_event_consecutive_data_set(wmWindow *win, const char *id, void *custom_data)
void ED_view3d_persp_switch_from_camera(const Depsgraph *depsgraph, View3D *v3d, RegionView3D *rv3d, eRegionView3D_Persp persp)
bool is_negative_m4(const float mat[4][4])
void mul_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4])
void view3d_operator_needs_gpu(const bContext *C)
bool ED_view3d_boundbox_clip(RegionView3D *rv3d, const BoundBox *bb)
bool ED_view3d_autodist_last_check(wmWindow *win, const wmEvent *event)
MINLINE int max_ii(int a, int b)
bool ED_view3d_has_workbench_in_texture_color(const Scene *scene, const Object *ob, const View3D *v3d)
bool ED_view3d_distance_set_from_location(RegionView3D *rv3d, const float dist_co[3], float dist_min)
void mul_qt_qtqt(float q[4], const float a[4], const float b[4])
float normal_tri_v3(float n[3], const float v1[3], const float v2[3], const float v3[3])
@ RV3D_LOCK_ANY_TRANSFORM
bool ED_view3d_camera_autokey(const Scene *scene, ID *id_key, bContext *C, bool do_rotate, bool do_translate)
bool isect_planes_v3_fn(const float planes[][4], int planes_len, float eps_coplanar, float eps_isect, void(*callback_fn)(const float co[3], int i, int j, int k, void *user_data), void *user_data)
void ED_region_tag_redraw(ARegion *region)
void ED_view3d_autodist_last_clear(wmWindow *win)
MINLINE float srgb_to_grayscale(const float rgb[3])
static bool view3d_camera_to_view_selected_impl(Main *bmain, Depsgraph *depsgraph, const Scene *scene, Object *camera_ob, float *r_clip_start, float *r_clip_end)
eRegionView3D_View ED_view3d_axis_view_opposite(eRegionView3D_View view)
void BKE_object_apply_mat4(Object *ob, const float mat[4][4], bool use_compat, bool use_parent)
MINLINE void mul_v3_fl(float r[3], float f)
void * WM_event_consecutive_data_get(wmWindow *win, const char *id)
bool ED_view3d_unproject_v3(const ARegion *region, float regionx, float regiony, float regionz, float world[3])
float ED_view3d_dist_soft_min_get(const View3D *v3d, bool use_persp_range)
static const char * view3d_autodepth_last_id
MINLINE void sub_v3_v3(float r[3], const float a[3])
void mul_qt_v3(const float q[4], float r[3])
eRegionView3D_ViewAxisRoll
@ RV3D_VIEW_AXIS_ROLL_270
static float view_autodist_depth_margin(ARegion *region, const int mval[2], int margin)
void mul_m4_v3(const float M[4][4], float r[3])
static void view3d_boxview_sync_axis(RegionView3D *rv3d_dst, RegionView3D *rv3d_src)
void ED_view3d_lock_clear(View3D *v3d)
MINLINE void madd_v3_v3fl(float r[3], const float a[3], float f)
float focallength_to_fov(float focal_length, float sensor)
bool ED_view3d_boundbox_clip_ex(const RegionView3D *rv3d, const BoundBox *bb, float obmat[4][4])
static void view3d_boxview_clip(ScrArea *area)
@ WM_EVENT_IS_CONSECUTIVE
bool ED_view3d_autodist(ARegion *region, View3D *v3d, const int mval[2], float mouse_worldloc[3], const float fallback_depth_pt[3])
void DEG_id_tag_update_ex(Main *bmain, ID *id, unsigned int flags)
VecBase< float, 2 > float2
void BKE_camera_params_from_view3d(CameraParams *params, const struct Depsgraph *depsgraph, const struct View3D *v3d, const struct RegionView3D *rv3d)
void * MEM_new_zeroed(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3])
bool ED_view3d_camera_lock_undo_test(const View3D *v3d, const RegionView3D *rv3d, bContext *C)
static bool depth_segment_cb(int x, int y, void *user_data)
void copy_qt_qt(float q[4], const float a[4])
void DEG_id_tag_update(ID *id, unsigned int flags)
BMesh const char void * data
T * DEG_get_evaluated(const Depsgraph *depsgraph, T *id)
float BKE_screen_view3d_zoom_from_fac(float zoomfac)
static float view3d_quat_axis[6][4][4]
void ED_undo_push(bContext *C, const char *str, UndoEncodeHints hints=UndoEncodeHints(0))
bool ED_view3d_context_activate(bContext *C)
bool ED_view3d_camera_view_pan(ARegion *region, const float event_ofs[2])
void BKE_camera_params_from_object(CameraParams *params, const struct Object *cam_ob)
void axis_angle_to_quat_single(float q[4], char axis, float angle)
float ED_view3d_radius_to_dist_persp(float angle, float radius)
void ED_view3d_camera_lock_init(const Depsgraph *depsgraph, View3D *v3d, RegionView3D *rv3d)
constexpr size_t ARRAY_SIZE(const T(&arg)[N]) noexcept
void invert_qt_normalized(float q[4])
MINLINE void negate_v3(float r[3])
eRegionView3D_View ED_view3d_lock_view_from_index(int index)
void GPU_matrix_projection_set(const float m[4][4])
@ V3D_SHADING_TEXTURE_COLOR
MINLINE void zero_v3(float r[3])
void mul_m4_v4(const float mat[4][4], float r[4])
bool ED_view3d_autodist_simple(ARegion *region, const int mval[2], float mouse_worldloc[3], int margin, const float *force_depth)
void view3d_boxview_copy(ScrArea *area, ARegion *region)
void ED_view3d_quadview_update(ScrArea *area, ARegion *region, bool do_clip)
void BLI_bitmap_draw_2d_line_v2v2i(const int p1[2], const int p2[2], bool(*callback)(int, int, void *), void *user_data)
Camera * ED_view3d_camera_data_get(View3D *v3d, RegionView3D *rv3d)
void ED_view3d_to_m4(float mat[4][4], const float ofs[3], const float quat[4], float dist, float roll)
@ OB_TRANSFORM_ADJUST_ROOT_PARENT_FOR_VIEW_LOCK
Bounds< float > ED_view3d_dist_soft_range_get(const View3D *v3d, bool use_persp_range)
bool ED_view3d_clip_range_get(const Depsgraph *depsgraph, const View3D *v3d, const RegionView3D *rv3d, bool use_ortho_factor, float *r_clip_start, float *r_clip_end)
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)
void mul_mat3_m4_v3(const float mat[4][4], float r[3])
MINLINE float normalize_v3(float n[3])
@ V3D_SHADING_BACKGROUND_VIEWPORT
@ V3D_SHADING_BACKGROUND_WORLD
bool ED_view3d_offset_lock_check(const View3D *v3d, const RegionView3D *rv3d)
float BKE_camera_sensor_size(int sensor_fit, float sensor_x, float sensor_y)
MINLINE void add_v3_v3(float r[3], const float a[3])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
bool ED_view3d_lock(RegionView3D *rv3d)
MINLINE void copy_v3_fl3(float v[3], float x, float y, float z)
bool BKE_scene_uses_blender_workbench(const Scene *scene)
MINLINE void copy_v3_fl(float r[3], float f)
void WM_event_consecutive_data_free(wmWindow *win)
bool ED_view3d_camera_to_view_selected_with_set_clipping(Main *bmain, Depsgraph *depsgraph, const Scene *scene, Object *camera_ob)
void ED_view3d_autodist_last_set(wmWindow *win, const wmEvent *event, const float ofs[3], const bool has_depth)
void ED_view3d_clipping_calc(BoundBox *bb, float planes[4][4], const ARegion *region, const Object *ob, const rcti *rect)
MINLINE float max_ff(float a, float b)
void ED_view3d_camera_lock_init_ex(const Depsgraph *depsgraph, View3D *v3d, RegionView3D *rv3d, bool calc_dist)
bool ED_view3d_depth_read_cached(const ViewDepths *vd, const int mval[2], int margin, float *r_depth)
ID_Type GS(const char *name)
MINLINE void clamp_v3(float vec[3], float min, float max)
ScrArea * BKE_screen_find_big_area(const bScreen *screen, int spacetype, short min)
static bool view3d_boundbox_clip_m4(const BoundBox *bb, const float persmatob[4][4])
bool ED_view3d_depth_read_cached_normal(const ARegion *region, const ViewDepths *depths, const int mval[2], float r_normal[3])
void ED_view3d_win_to_3d_int(const View3D *v3d, const ARegion *region, const float depth_pt[3], const int mval[2], float r_out[3])
float view3d_depth_near(ViewDepths *d)
void ED_view3d_clipping_calc_from_boundbox(float clip[4][4], const BoundBox *bb, bool is_flip)
void ED_view3d_lastview_store(RegionView3D *rv3d)
Scene * CTX_data_scene(const bContext *C)
bScreen * CTX_wm_screen(const bContext *C)
void CTX_wm_region_set(bContext *C, ARegion *region)
void invert_qt_qt_normalized(float q1[4], const float q2[4])
float BKE_screen_view3d_zoom_to_fac(float camzoom)
static bool view3d_camera_lock_undo_ex(const char *str, const View3D *v3d, const RegionView3D *rv3d, bContext *C, const bool undo_group)
bool ED_view3d_depth_unproject_v3(const ARegion *region, const int mval[2], double depth, float r_location_world[3])
bool ED_view3d_quat_from_axis_view(eRegionView3D_View view, eRegionView3D_ViewAxisRoll view_axis_roll, float r_quat[4])
void GPU_polygon_offset(float viewdist, float dist)
void copy_m4_m4(float m1[4][4], const float m2[4][4])
eRegionView3D_ViewFlipRoll
void ED_view3d_to_object(const Depsgraph *depsgraph, Object *ob, const float ofs[3], const float quat[4], float dist, float roll)
float ED_view3d_radius_to_dist_ortho(float lens, float radius)
MINLINE void negate_v4_v4(float r[4], const float a[4])
void BKE_camera_params_init(CameraParams *params)
void normalize_m4_m4(float rmat[4][4], const float mat[4][4]) ATTR_NONNULL()
MINLINE float len_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
void ED_view3d_text_colors_get(const Scene *scene, const View3D *v3d, float r_text_color[4], float r_shadow_color[4])
void BLI_rcti_init_pt_radius(struct rcti *rect, const int xy[2], int size)
void ED_view3d_from_object(const Object *ob, float ofs[3], float quat[4], const float *dist, float roll, float *r_lens)
float angle_signed_qtqt(const float q1[4], const float q2[4])
void view3d_region_operator_needs_gpu(ARegion *region)
MINLINE int min_ii(int a, int b)
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
eRegionView3D_ViewFlipRoll ED_view3d_effective_flip_axis(const RegionView3D *rv3d)
ARegion * CTX_wm_region(const bContext *C)
void GPU_matrix_set(const float m[4][4])
void view3d_boxview_sync(ScrArea *area, ARegion *region)
void ED_view3d_from_m4(const float mat[4][4], float ofs[3], float quat[4], const float *dist, float roll)
void BKE_object_tfm_protected_restore(Object *ob, const ObjectTfmProtectedChannels *obtfm, short protectflag)
void BKE_object_apply_mat4_ex(Object *ob, const float mat[4][4], Object *parent, const float parentinv[4][4], bool use_compat)
void quat_to_mat4(float m[4][4], const float q[4])
void ED_area_tag_redraw(ScrArea *area)
void CTX_wm_area_set(bContext *C, ScrArea *area)
float ED_view3d_offset_distance(const float mat[4][4], const float ofs[3], float fallback_dist)
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
eRegion_Alignment alignment
eObject_TransFlag transflag
eObject_ProtectFlag protectflag
eRegionView3D_ViewAxisRoll view_axis_roll
eRegionView3D_ViewAxisRoll lview_axis_roll
eRegionView3D_Persp lpersp
eRegionView3D_Persp persp
eRegionView3D_ViewLock viewlock
struct SceneDisplay display
ListBaseT< ARegion > regionbase
eV3DShadingColorType color_type
eV3DShadingBackgroundType background_type
float background_color[3]
struct Object * ob_center