88 float r_text_color[4],
89 float r_shadow_color[4])
92 r_text_color[3] = 1.0f;
93 r_shadow_color[3] = 0.8f;
103 if (text_lightness > 0.5f) {
114 if (text_lightness > 0.4f) {
154 return use_persp_range ? (v3d->
clip_start * 1.5f) : v3d->
grid * 0.001f;
168 const bool use_ortho_factor,
177 if (use_ortho_factor &&
params.is_ortho) {
178 const float fac = 2.0f / (
params.clip_end -
params.clip_start);
184 *r_clip_start =
params.clip_start;
187 *r_clip_end =
params.clip_end;
210 *r_viewplane =
params.viewplane;
213 *r_clip_start =
params.clip_start;
216 *r_clip_end =
params.clip_end;
219 *r_pixsize =
params.viewdx;
242 printf(
"view3d_region_operator_needs_gpu error, wrong region\n");
259 float viewdist = rv3d->
dist;
283 if (area ==
nullptr) {
288 if (region ==
nullptr) {
309 for (
int val = 0; val < 4; val++) {
323 memset(bb->
vec, 0,
sizeof(bb->
vec));
327 for (
int val = 0; val < 4; val++) {
340 for (
int val = 0; val < 8; val++) {
348 int flip_sign = (ob) ?
is_negative_m4(ob->object_to_world().ptr()) :
false;
365 const float co[3],
int ,
int ,
int ,
void *user_data_p)
375 float planes[6 + 6][4];
378 for (
int i = 0;
i < 3;
i++) {
379 float *plane_min = planes[(
i * 2) + 0];
380 float *plane_max = planes[(
i * 2) + 1];
383 plane_min[
i] = -1.0f;
384 plane_min[3] = +
min[
i];
385 plane_max[
i] = +1.0f;
386 plane_max[3] = -
max[
i];
392 for (
int i = 0;
i < clip_len;
i++) {
401 const float eps_coplanar = 1e-4f;
402 const float eps_isect = 1e-6f;
421 int a,
flag = -1, fl;
423 for (a = 0; a < 8; a++) {
464 float persmatob[4][4];
572 const float camzoom_init = rv3d->
camzoom;
576 zoomfac = zoomfac * scale;
580 return (rv3d->
camzoom != camzoom_init);
586 const float camdxy_init[2] = {rv3d->
camdx, rv3d->
camdy};
588 rv3d->
camdx += event_ofs[0] / (region->
winx * zoomfac);
589 rv3d->
camdy += event_ofs[1] / (region->
winy * zoomfac);
592 return (camdxy_init[0] != rv3d->
camdx) || (camdxy_init[1] != rv3d->
camdy);
612 const bool calc_dist)
642 float view_mat[4][4];
643 float diff_mat[4][4];
644 float parent_mat[4][4];
646 while (root_parent->
parent) {
647 root_parent = root_parent->
parent;
659 mul_m4_m4m4(parent_mat, diff_mat, root_parent_eval->object_to_world().ptr());
669 ob_update = ob_update->
parent;
690 const Scene *scene,
ID *id_key,
bContext *
C,
const bool do_rotate,
const bool do_translate)
702 Object *camera_object =
reinterpret_cast<Object *
>(id_key);
707 switch (camera_object->
rotmode) {
709 rna_paths.
append({
"rotation_quaternion"});
713 rna_paths.
append({
"rotation_axis_angle"});
717 rna_paths.
append({
"rotation_euler"});
725 rna_paths.
append({
"location"});
744 while (root_parent->
parent) {
745 root_parent = root_parent->
parent;
747 id_key = &root_parent->
id;
780 const bool undo_group)
822 float x1 = 0.0f, y1 = 0.0f, z1 = 0.0f, ofs[3] = {0.0f, 0.0f, 0.0f};
831 if (region->winx > region->winy) {
835 x1 = region->winx * rv3d->
dist / region->winy;
838 if (region->winx > region->winy) {
839 y1 = region->winy * rv3d->
dist / region->winx;
847 ofs[2] = rv3d->
ofs[2];
849 if (region->winx > region->winy) {
850 z1 = region->winy * rv3d->
dist / region->winx;
860 for (
int val = 0; val < 8; val++) {
861 if (
ELEM(val, 0, 3, 4, 7)) {
862 bb->
vec[val][0] = -x1 - ofs[0];
865 bb->
vec[val][0] = x1 - ofs[0];
868 if (
ELEM(val, 0, 1, 4, 5)) {
869 bb->
vec[val][1] = -y1 - ofs[1];
872 bb->
vec[val][1] = y1 - ofs[1];
876 bb->
vec[val][2] = -z1 - ofs[2];
879 bb->
vec[val][2] = z1 - ofs[2];
892 for (
int val = 0; val < 6; val++) {
893 clip[val][3] = -
dot_v3v3(clip[val], bb->
vec[val % 5]);
903 memcpy(rv3d->
clip, clip,
sizeof(clip));
921 const float axis_eps = 0.5f;
925 float view_axis_all[4][3] = {
926 {1.0f, 0.0f, 0.0f}, {0.0f, 1.0f, 0.0f}, {1.0f, 0.0f, 0.0f}, {0.0f, 1.0f, 0.0f}};
928 float *view_src_x = &view_axis_all[0][0];
929 float *view_src_y = &view_axis_all[1][0];
931 float *view_dst_x = &view_axis_all[2][0];
932 float *view_dst_y = &view_axis_all[3][0];
955 for (
i = 0;
i < 3;
i++) {
956 if (((
fabsf(view_src_x[
i]) > axis_eps) || (
fabsf(view_src_y[
i]) > axis_eps)) &&
957 ((
fabsf(view_dst_x[
i]) > axis_eps) || (
fabsf(view_dst_y[
i]) > axis_eps)))
959 rv3d_dst->
ofs[
i] = rv3d_src->
ofs[
i];
1014 ARegion *region_sync =
nullptr;
1030 for (; region; region = region->
prev) {
1042 region_sync = region;
1053 int index_qsplit = 0;
1056 rv3d =
static_cast<RegionView3D *
>(region_iter->regiondata);
1097 if (autodepth_last) {
1112 const bool has_depth)
1133 if (autodepth_last ==
nullptr) {
1137 if (autodepth_last->
has_depth ==
false) {
1156 rect.
xmin = mval[0];
1157 rect.
ymin = mval[1];
1158 rect.
xmax = mval[0] + 1;
1159 rect.
ymax = mval[1] + 1;
1175 float mouse_worldloc[3],
1176 const float fallback_depth_pt[3])
1179 int margin_arr[] = {0, 2, 4};
1180 bool depth_ok =
false;
1186 depth_ok = (depth_close !=
FLT_MAX);
1187 }
while ((depth_ok ==
false) && (
i <
ARRAY_SIZE(margin_arr)));
1190 float centx =
float(mval[0]) + 0.5f;
1191 float centy =
float(mval[1]) + 0.5f;
1198 if (fallback_depth_pt) {
1207 float mouse_worldloc[3],
1209 const float *force_depth)
1214 depth = *force_depth;
1224 float centx =
float(mval[0]) + 0.5f;
1225 float centy =
float(mval[1]) + 0.5f;
1243 data->depth = depth;
1250 const ViewDepths *vd,
const int mval_sta[2],
const int mval_end[2],
int margin,
float *r_depth)
1261 data.margin = margin;
1269 *r_depth =
data.depth;
1271 return (*r_depth != 1.0f);
1284 return radius * (1.0f /
tanf(
angle / 2.0f));
1296 const bool use_aspect,
1308 float lens, sensor_size, zoom;
1350 winx = region->
winx;
1351 winy = region->
winy;
1355 float aspect = winx / winy;
1356 if (aspect < 1.0f) {
1357 aspect = 1.0f / aspect;
1374 const float fallback_dist)
1376 float pos[4] = {0.0f, 0.0f, 0.0f, 1.0f};
1377 float dir[4] = {0.0f, 0.0f, 1.0f, 0.0f};
1386 if ((dist < FLT_EPSILON) && (fallback_dist != 0.0f)) {
1387 dist = fallback_dist;
1414 const float dist_co[3],
1415 const float dist_min)
1420 float tvec[3] = {0.0f, 0.0f, -1.0f};
1423 float dist_co_local[3];
1425 sub_v3_v3v3(dist_co_local, dist_co, dist_co_local);
1426 const float delta =
dot_v3v3(tvec, dist_co_local);
1427 const float dist_new = rv3d->
dist + delta;
1428 if (dist_new >= dist_min) {
1430 rv3d->
dist = dist_new;
1449 {0.5f, -0.5f, -0.5f, 0.5f},
1451 {-0.5f, 0.5f, -0.5f, 0.5f},
1455 {0.5f, 0.5f, -0.5f, -0.5f},
1457 {0.5f, 0.5f, 0.5f, 0.5f},
1460 {0.5f, -0.5f, 0.5f, 0.5f},
1462 {-0.5f, -0.5f, -0.5f, 0.5f},
1468 {0.5f, -0.5f, -0.5f, -0.5f},
1470 {0.5f, 0.5f, -0.5f, 0.5f},
1474 {1.0f, 0.0f, 0.0f, 0.0f},
1480 {0.0f, -1.0f, 0.0f, 0.0f},
1499 const float epsilon,
1501 char *r_view_axis_roll)
1518 *r_view_axis_roll = view_axis_roll;
1531 const float delta_test =
fabsf(
1533 if (delta_best > delta_test) {
1534 delta_best = delta_test;
1536 *r_view_axis_roll = view_axis_roll;
1549 const float epsilon,
1551 char *r_view_axis_roll)
1559 return is_axis_view;
1612 BLI_assert(dist ==
nullptr || ofs !=
nullptr);
1633void ED_view3d_to_m4(
float mat[4][4],
const float ofs[3],
const float quat[4],
const float dist)
1635 const float iviewquat[4] = {-quat[0], quat[1], quat[2], quat[3]};
1636 float dvec[3] = {0.0f, 0.0f, dist};
1644 const Object *ob,
float ofs[3],
float quat[4],
const float *dist,
float *lens)
1660 const float quat[4],
1674 float *r_clip_start,
1682 depsgraph, scene, camera_ob_eval, co, &scale, r_clip_start, r_clip_end))
1685 float obmat_new[4][4];
1686 bool is_ortho_camera =
false;
1691 ((
Camera *)camera_ob->
data)->ortho_scale = scale;
1692 is_ortho_camera =
true;
1695 copy_m4_m4(obmat_new, camera_ob_eval->object_to_world().ptr());
1705 if (is_ortho_camera) {
1731 bmain,
depsgraph, scene, camera_ob, &clip_start, &clip_end))
1734 ((
Camera *)camera_ob->
data)->clip_start = clip_start;
1735 ((
Camera *)camera_ob->
data)->clip_end = clip_end;
1739 ((
Camera *)camera_ob_eval->
data)->clip_start = clip_start;
1740 ((
Camera *)camera_ob_eval->
data)->clip_end = clip_end;
1763 float depth = *(
float *)value;
1764 data->r_depth = std::min(depth,
data->r_depth);
1766 if ((++
data->count) >=
data->count_max) {
1780 if (!vd || !vd->
depths) {
1793 int shape[2] = {vd->
w, vd->
h};
1794 int pixel_count = (
min_ii(
x + margin + 1, shape[1]) -
max_ii(
x - margin, 0)) *
1799 data.count_max = pixel_count;
1800 data.r_depth = 1.0f;
1804 depth =
data.r_depth;
1810 if (depth != 1.0f) {
1827 bool depths_valid[9] = {
false};
1828 float coords[9][3] = {{0}};
1830 for (
int x = 0,
i = 0;
x < 2;
x++) {
1831 for (
int y = 0;
y < 2;
y++) {
1832 const int mval_ofs[2] = {mval[0] + (
x - 1), mval[1] + (
y - 1)};
1834 float depth_fl = 1.0f;
1836 const double depth = double(depth_fl);
1837 if ((depth > depths->
depth_range[0]) && (depth < depths->depth_range[1])) {
1839 depths_valid[
i] =
true;
1846 const int edges[2][6][2] = {
1848 {{0, 1}, {1, 2}, {3, 4}, {4, 5}, {6, 7}, {7, 8}},
1849 {{0, 3}, {3, 6}, {1, 4}, {4, 7}, {2, 5}, {5, 8}},
1852 float cross[2][3] = {{0.0f}};
1854 for (
int i = 0;
i < 6;
i++) {
1855 for (
int axis = 0; axis < 2; axis++) {
1856 if (depths_valid[edges[axis][
i][0]] && depths_valid[edges[axis][
i][1]]) {
1858 sub_v3_v3v3(delta, coords[edges[axis][
i][0]], coords[edges[axis][
i][1]]);
1875 float r_location_world[3])
1877 float centx =
float(mval[0]) + 0.5f;
1878 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.
float BKE_camera_sensor_size(int sensor_fit, float sensor_x, float sensor_y)
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)
#define CAMERA_PARAM_ZOOM_INIT_PERSP
void BKE_camera_params_init(CameraParams *params)
void BKE_camera_params_from_view3d(CameraParams *params, const struct Depsgraph *depsgraph, const struct View3D *v3d, const struct RegionView3D *rv3d)
void BKE_camera_params_from_object(CameraParams *params, const struct Object *cam_ob)
void BKE_camera_params_compute_viewplane(CameraParams *params, int winx, int winy, float aspx, float aspy)
#define CAMERA_PARAM_ZOOM_INIT_CAMOB
bScreen * CTX_wm_screen(const bContext *C)
ScrArea * CTX_wm_area(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
void CTX_wm_area_set(bContext *C, ScrArea *area)
void CTX_wm_region_set(bContext *C, ARegion *region)
ARegion * CTX_wm_region(const bContext *C)
General operations, lookup, etc. for blender objects.
void BKE_object_apply_mat4(Object *ob, const float mat[4][4], bool use_compat, bool use_parent)
void BKE_object_tfm_protected_backup(const Object *ob, ObjectTfmProtectedChannels *obtfm)
void BKE_object_apply_mat4_ex(Object *ob, const float mat[4][4], Object *parent, const float parentinv[4][4], bool use_compat)
void BKE_object_tfm_protected_restore(Object *ob, const ObjectTfmProtectedChannels *obtfm, short protectflag)
bool BKE_scene_uses_blender_workbench(const Scene *scene)
float BKE_screen_view3d_zoom_from_fac(float zoomfac)
ARegion * BKE_area_find_region_active_win(const ScrArea *area)
ScrArea * BKE_screen_find_big_area(const bScreen *screen, int spacetype, short min)
float BKE_screen_view3d_zoom_to_fac(float camzoom)
Generic array manipulation API.
#define BLI_array_iter_spiral_square(arr, arr_shape, center, test_fn, user_data)
void BLI_bitmap_draw_2d_line_v2v2i(const int p1[2], const int p2[2], bool(*callback)(int, int, void *), void *user_data)
#define LISTBASE_FOREACH(type, var, list)
MINLINE float max_ff(float a, float b)
MINLINE int min_ii(int a, int b)
MINLINE int max_ii(int a, int b)
MINLINE float srgb_to_grayscale(const float rgb[3])
float normal_tri_v3(float n[3], const float v1[3], const float v2[3], const float v3[3])
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 mul_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4])
void copy_m3_m4(float m1[3][3], const float m2[4][4])
void normalize_m4_m4(float rmat[4][4], const float mat[4][4]) ATTR_NONNULL()
void normalize_m3(float R[3][3]) ATTR_NONNULL()
void mul_m4_v3(const float M[4][4], float r[3])
void copy_m4_m4(float m1[4][4], const float m2[4][4])
bool is_negative_m4(const float mat[4][4])
bool invert_m4_m4(float inverse[4][4], const float mat[4][4])
void mul_m4_v4(const float mat[4][4], float r[4])
void mul_mat3_m4_v3(const float mat[4][4], float r[3])
void invert_qt_normalized(float q[4])
void quat_to_mat4(float m[4][4], const float q[4])
void mul_qt_v3(const float q[4], float r[3])
void invert_qt_qt_normalized(float q1[4], const float q2[4])
float focallength_to_fov(float focal_length, float sensor)
void copy_qt_qt(float q[4], const float a[4])
void mat3_normalized_to_quat(float q[4], const float mat[3][3])
float angle_signed_qtqt(const float q1[4], const float q2[4])
MINLINE float len_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
void minmax_v3v3_v3(float min[3], float max[3], const float vec[3])
MINLINE void madd_v3_v3fl(float r[3], const float a[3], float f)
MINLINE void clamp_v3(float vec[3], float min, float max)
MINLINE void sub_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])
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v2_v2_int(int r[2], const int a[2])
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void negate_v3_v3(float r[3], const float a[3])
MINLINE void copy_v3_fl3(float v[3], float x, float y, float z)
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void negate_v4_v4(float r[4], const float a[4])
MINLINE void negate_v3(float r[3])
MINLINE void copy_v3_fl(float r[3], float f)
MINLINE void zero_v3(float r[3])
MINLINE void add_v3_v3(float r[3], const float a[3])
MINLINE float normalize_v3(float n[3])
void BLI_rcti_init_pt_radius(struct rcti *rect, const int xy[2], int size)
#define INIT_MINMAX(min, max)
void DEG_id_tag_update(ID *id, unsigned int flags)
T * DEG_get_evaluated(const Depsgraph *depsgraph, T *id)
#define ID_IS_EDITABLE(_id)
#define DEFAULT_SENSOR_WIDTH
Object is a sort of wrapper for general info.
@ OB_TRANSFORM_ADJUST_ROOT_PARENT_FOR_VIEW_LOCK
@ V3D_SHADING_BACKGROUND_VIEWPORT
@ V3D_SHADING_BACKGROUND_WORLD
@ V3D_SHADING_TEXTURE_COLOR
#define RV3D_VIEW_IS_AXIS(view)
@ RV3D_VIEW_AXIS_ROLL_270
#define RV3D_CAMZOOM_MIN_FACTOR
#define RV3D_LOCK_FLAGS(rv3d)
#define RV3D_CAMZOOM_MAX_FACTOR
@ RV3D_LOCK_ANY_TRANSFORM
void ED_area_tag_redraw(ScrArea *area)
void ED_region_tag_redraw(ARegion *region)
void ED_undo_push(bContext *C, const char *str)
bool ED_undo_is_memfile_compatible(const bContext *C)
void ED_undo_grouped_push(bContext *C, const char *str)
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])
#define VIEW3D_DIST_FALLBACK
bool ED_view3d_unproject_v3(const ARegion *region, float regionx, float regiony, float regionz, float world[3])
#define GPU_matrix_set(x)
#define GPU_matrix_projection_set(x)
void GPU_polygon_offset(float viewdist, float dist)
static double angle(const Eigen::Vector3d &v1, const Eigen::Vector3d &v2)
Read Guarded memory(de)allocation.
void UI_GetThemeColor3fv(int colorid, float col[3])
@ WM_EVENT_IS_CONSECUTIVE
BMesh const char void * data
BPy_StructRNA * depsgraph
void append(const T &value)
VecBase< float, 3 > cross(VecOp< float, 3 >, VecOp< float, 3 >) RET
float distance(VecOp< float, D >, VecOp< float, D >) RET
DEG_id_tag_update_ex(cb_data->bmain, cb_data->owner_id, ID_RECALC_TAG_FOR_UNDO|ID_RECALC_SYNC_TO_EVAL)
void * MEM_callocN(size_t len, const char *str)
void * MEM_dupallocN(const void *vmemh)
void MEM_freeN(void *vmemh)
bool autokeyframe_cfra_can_key(const Scene *scene, ID *id)
void autokeyframe_object(bContext *C, const Scene *scene, Object *ob, Span< RNAPath > rna_paths)
struct SceneDisplay display
float background_color[3]
struct Object * ob_center
void view3d_depths_rect_create(ARegion *region, rcti *rect, ViewDepths *r_d)
float view3d_depth_near(ViewDepths *d)
bool ED_view3d_boundbox_clip(RegionView3D *rv3d, const BoundBox *bb)
float ED_view3d_radius_to_dist_ortho(const float lens, const float radius)
void ED_view3d_camera_lock_init_ex(const Depsgraph *depsgraph, View3D *v3d, RegionView3D *rv3d, const bool calc_dist)
bool ED_view3d_camera_autokey(const Scene *scene, ID *id_key, bContext *C, const bool do_rotate, const bool do_translate)
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)
bool ED_view3d_depth_read_cached(const ViewDepths *vd, const int mval[2], int margin, float *r_depth)
bool ED_view3d_camera_to_view_selected_with_set_clipping(Main *bmain, Depsgraph *depsgraph, const Scene *scene, Object *camera_ob)
bool ED_view3d_depth_unproject_v3(const ARegion *region, const int mval[2], const double depth, float r_location_world[3])
static bool view3d_camera_lock_undo_ex(const char *str, const View3D *v3d, const RegionView3D *rv3d, bContext *C, const bool undo_group)
static bool depth_read_test_fn(const void *value, void *userdata)
char ED_view3d_axis_view_opposite(char view)
bool ED_view3d_camera_lock_sync(const Depsgraph *depsgraph, View3D *v3d, RegionView3D *rv3d)
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)
void ED_view3d_clipping_calc(BoundBox *bb, float planes[4][4], const ARegion *region, const Object *ob, const rcti *rect)
void ED_view3d_autodist_last_clear(wmWindow *win)
bool ED_view3d_persp_ensure(const Depsgraph *depsgraph, View3D *v3d, ARegion *region)
bool ED_view3d_offset_lock_check(const View3D *v3d, const RegionView3D *rv3d)
bool ED_view3d_autodist_last_check(wmWindow *win, const wmEvent *event)
static bool view3d_boundbox_clip_m4(const BoundBox *bb, const float persmatob[4][4])
bool ED_view3d_lock(RegionView3D *rv3d)
char ED_view3d_lock_view_from_index(int index)
void ED_view3d_background_color_get(const Scene *scene, const View3D *v3d, float r_color[3])
void ED_view3d_lastview_store(RegionView3D *rv3d)
void ED_view3d_autodist_last_set(wmWindow *win, const wmEvent *event, const float ofs[3], const bool has_depth)
void ED_view3d_from_object(const Object *ob, float ofs[3], float quat[4], const float *dist, float *lens)
bool ED_view3d_distance_set_from_location(RegionView3D *rv3d, const float dist_co[3], const float dist_min)
bool ED_view3d_camera_view_zoom_scale(RegionView3D *rv3d, const float scale)
bool ED_view3d_quat_from_axis_view(const char view, const char view_axis_roll, float r_quat[4])
bool ED_view3d_autodist(ARegion *region, View3D *v3d, const int mval[2], float mouse_worldloc[3], const float fallback_depth_pt[3])
float ED_view3d_radius_to_dist_persp(const float angle, const float radius)
blender::Bounds< float > ED_view3d_dist_soft_range_get(const View3D *v3d, const bool use_persp_range)
void ED_view3d_to_object(const Depsgraph *depsgraph, Object *ob, const float ofs[3], const float quat[4], const float dist)
void ED_view3d_from_m4(const float mat[4][4], float ofs[3], float quat[4], const float *dist)
float ED_view3d_dist_soft_min_get(const View3D *v3d, const bool use_persp_range)
bool ED_view3d_autodist_last_get(wmWindow *win, float r_ofs[3])
static void view3d_boxview_sync_axis(RegionView3D *rv3d_dst, RegionView3D *rv3d_src)
void view3d_region_operator_needs_gpu(ARegion *region)
void ED_view3d_clipping_calc_from_boundbox(float clip[4][4], const BoundBox *bb, const bool is_flip)
float ED_view3d_offset_distance(const float mat[4][4], const float ofs[3], const float fallback_dist)
bool ED_view3d_camera_lock_autokey(View3D *v3d, RegionView3D *rv3d, bContext *C, const bool do_rotate, const bool do_translate)
static float view_autodist_depth_margin(ARegion *region, const int mval[2], int margin)
bool ED_view3d_depth_read_cached_normal(const ARegion *region, const ViewDepths *depths, const int mval[2], float r_normal[3])
bool ED_view3d_clipping_clamp_minmax(const RegionView3D *rv3d, float min[3], float max[3])
bool ED_view3d_context_activate(bContext *C)
void ED_view3d_lock_clear(View3D *v3d)
bool ED_view3d_camera_view_pan(ARegion *region, const float event_ofs[2])
bool ED_view3d_camera_lock_undo_push(const char *str, const View3D *v3d, const RegionView3D *rv3d, bContext *C)
void view3d_boxview_copy(ScrArea *area, ARegion *region)
void ED_view3d_polygon_offset(const RegionView3D *rv3d, const float dist)
bool ED_view3d_autodist_simple(ARegion *region, const int mval[2], float mouse_worldloc[3], int margin, const float *force_depth)
void ED_view3d_persp_switch_from_camera(const Depsgraph *depsgraph, View3D *v3d, RegionView3D *rv3d, const char persp)
bool ED_view3d_boundbox_clip_ex(const RegionView3D *rv3d, const BoundBox *bb, float obmat[4][4])
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)
void view3d_boxview_sync(ScrArea *area, ARegion *region)
bool ED_view3d_camera_to_view_selected(Main *bmain, Depsgraph *depsgraph, const Scene *scene, Object *camera_ob)
static void points_in_planes_minmax_fn(const float co[3], int, int, int, void *user_data_p)
bool ED_view3d_clip_range_get(const Depsgraph *depsgraph, const View3D *v3d, const RegionView3D *rv3d, const bool use_ortho_factor, float *r_clip_start, float *r_clip_end)
bool ED_view3d_camera_lock_check(const View3D *v3d, const RegionView3D *rv3d)
void ED_view3d_text_colors_get(const Scene *scene, const View3D *v3d, float r_text_color[4], float r_shadow_color[4])
static void view3d_boxview_clip(ScrArea *area)
void view3d_operator_needs_gpu(const bContext *C)
void ED_view3d_distance_set(RegionView3D *rv3d, const float dist)
Camera * ED_view3d_camera_data_get(View3D *v3d, RegionView3D *rv3d)
void ED_view3d_camera_lock_init(const Depsgraph *depsgraph, View3D *v3d, RegionView3D *rv3d)
void ED_view3d_to_m4(float mat[4][4], const float ofs[3], const float quat[4], const float dist)
float ED_view3d_radius_to_dist(const View3D *v3d, const ARegion *region, const Depsgraph *depsgraph, const char persp, const bool use_aspect, const float radius)
bool ED_view3d_quat_to_axis_view(const float quat[4], const float epsilon, char *r_view, char *r_view_axis_roll)
void ED_view3d_quadview_update(ScrArea *area, ARegion *region, bool do_clip)
bool ED_view3d_camera_lock_undo_test(const View3D *v3d, const RegionView3D *rv3d, bContext *C)
static float view3d_quat_axis[6][4][4]
static const char * view3d_autodepth_last_id
bool ED_view3d_quat_to_axis_view_and_reset_quat(float quat[4], const float epsilon, char *r_view, char *r_view_axis_roll)
static bool depth_segment_cb(int x, int y, void *user_data)
bool ED_view3d_has_workbench_in_texture_color(const Scene *scene, const Object *ob, const View3D *v3d)
bool ED_view3d_camera_lock_undo_grouped_push(const char *str, const View3D *v3d, const RegionView3D *rv3d, bContext *C)
bool WM_event_consecutive_gesture_test(const wmEvent *event)
void * WM_event_consecutive_data_get(wmWindow *win, const char *id)
void WM_event_consecutive_data_free(wmWindow *win)
void WM_main_add_notifier(uint type, void *reference)
void WM_event_consecutive_data_set(wmWindow *win, const char *id, void *custom_data)
void wmViewport(const rcti *winrct)