80 float r_text_color[4],
81 float r_shadow_color[4])
84 r_text_color[3] = 1.0f;
85 r_shadow_color[3] = 0.8f;
93 const float distance =
len_v3v3(r_text_color, bg_color);
94 if (distance < 0.5f) {
95 if (text_lightness > 0.5f) {
106 if (text_lightness > 0.4f) {
146 r_dist_range[0] = v3d->
grid * 0.001f;
147 r_dist_range[1] = v3d->
clip_end * 10.0f;
153 const bool use_ortho_factor,
162 if (use_ortho_factor &&
params.is_ortho) {
163 const float fac = 2.0f / (
params.clip_end -
params.clip_start);
169 *r_clip_start =
params.clip_start;
172 *r_clip_end =
params.clip_end;
195 *r_viewplane =
params.viewplane;
198 *r_clip_start =
params.clip_start;
201 *r_clip_end =
params.clip_end;
204 *r_pixsize =
params.viewdx;
228 printf(
"view3d_region_operator_needs_opengl error, wrong region\n");
245 float viewdist = rv3d->
dist;
265 if (area ==
nullptr || area->spacetype !=
SPACE_VIEW3D) {
269 if (area ==
nullptr) {
274 if (region ==
nullptr) {
295 for (
int val = 0; val < 4; val++) {
309 memset(bb->
vec, 0,
sizeof(bb->
vec));
313 for (
int val = 0; val < 4; val++) {
326 for (
int val = 0; val < 8; val++) {
334 int flip_sign = (ob) ?
is_negative_m4(ob->object_to_world().ptr()) :
false;
351 const float co[3],
int ,
int ,
int ,
void *user_data_p)
361 float planes[6 + 6][4];
364 for (
int i = 0; i < 3; i++) {
365 float *plane_min = planes[(i * 2) + 0];
366 float *plane_max = planes[(i * 2) + 1];
369 plane_min[i] = -1.0f;
370 plane_min[3] = +
min[i];
371 plane_max[i] = +1.0f;
372 plane_max[3] = -max[i];
378 for (
int i = 0; i < clip_len; i++) {
387 const float eps_coplanar = 1e-4f;
388 const float eps_isect = 1e-6f;
407 int a,
flag = -1, fl;
409 for (a = 0; a < 8; a++) {
450 float persmatob[4][4];
498 v3d->
flag2 &= ~V3D_LOCK_CAMERA;
557 const float camzoom_init = rv3d->
camzoom;
561 zoomfac = zoomfac * scale;
565 return (rv3d->
camzoom != camzoom_init);
571 const float camdxy_init[2] = {rv3d->
camdx, rv3d->
camdy};
573 rv3d->
camdx += event_ofs[0] / (region->winx * zoomfac);
574 rv3d->
camdy += event_ofs[1] / (region->winy * zoomfac);
577 return (camdxy_init[0] != rv3d->
camdx) || (camdxy_init[1] != rv3d->
camdy);
597 const bool calc_dist)
627 float view_mat[4][4];
628 float diff_mat[4][4];
629 float parent_mat[4][4];
631 while (root_parent->
parent) {
632 root_parent = root_parent->
parent;
644 mul_m4_m4m4(parent_mat, diff_mat, root_parent_eval->object_to_world().ptr());
654 ob_update = ob_update->
parent;
675 const Scene *scene,
ID *id_key,
bContext *C,
const bool do_rotate,
const bool do_translate)
678 if (autokeyframe_cfra_can_key(scene, id_key)) {
679 const float cfra =
float(scene->r.cfra);
714 while (root_parent->
parent) {
715 root_parent = root_parent->
parent;
717 id_key = &root_parent->
id;
750 const bool undo_group)
792 float x1 = 0.0f, y1 = 0.0f, z1 = 0.0f, ofs[3] = {0.0f, 0.0f, 0.0f};
801 if (region->winx > region->winy) {
805 x1 = region->winx * rv3d->
dist / region->winy;
808 if (region->winx > region->winy) {
809 y1 = region->winy * rv3d->
dist / region->winx;
817 ofs[2] = rv3d->
ofs[2];
819 if (region->winx > region->winy) {
820 z1 = region->winy * rv3d->
dist / region->winx;
830 for (
int val = 0; val < 8; val++) {
831 if (
ELEM(val, 0, 3, 4, 7)) {
832 bb->
vec[val][0] = -x1 - ofs[0];
835 bb->
vec[val][0] = x1 - ofs[0];
838 if (
ELEM(val, 0, 1, 4, 5)) {
839 bb->
vec[val][1] = -y1 - ofs[1];
842 bb->
vec[val][1] = y1 - ofs[1];
846 bb->
vec[val][2] = -z1 - ofs[2];
849 bb->
vec[val][2] = z1 - ofs[2];
862 for (
int val = 0; val < 6; val++) {
863 clip[val][3] = -
dot_v3v3(clip[val], bb->
vec[val % 5]);
873 memcpy(rv3d->
clip, clip,
sizeof(clip));
891 const float axis_eps = 0.5f;
895 float view_axis_all[4][3] = {
896 {1.0f, 0.0f, 0.0f}, {0.0f, 1.0f, 0.0f}, {1.0f, 0.0f, 0.0f}, {0.0f, 1.0f, 0.0f}};
898 float *view_src_x = &view_axis_all[0][0];
899 float *view_src_y = &view_axis_all[1][0];
901 float *view_dst_x = &view_axis_all[2][0];
902 float *view_dst_y = &view_axis_all[3][0];
925 for (i = 0; i < 3; i++) {
926 if (((
fabsf(view_src_x[i]) > axis_eps) || (
fabsf(view_src_y[i]) > axis_eps)) &&
927 ((
fabsf(view_dst_x[i]) > axis_eps) || (
fabsf(view_dst_y[i]) > axis_eps)))
929 rv3d_dst->
ofs[i] = rv3d_src->
ofs[i];
940 if (region_test != region && region_test->regiontype ==
RGN_TYPE_WINDOW) {
964 if (region_test != region && region_test->regiontype ==
RGN_TYPE_WINDOW) {
984 ARegion *region_sync =
nullptr;
997 viewlock &= ~RV3D_BOXCLIP;
1000 for (; region; region = region->prev) {
1002 rv3d =
static_cast<RegionView3D *
>(region->regiondata);
1006 rv3d->
rflag &= ~RV3D_BOXCLIP;
1012 region_sync = region;
1018 static_cast<ARegion *
>(region_sync ? region_sync : area->regionbase.last));
1023 int index_qsplit = 0;
1026 rv3d =
static_cast<RegionView3D *
>(region_iter->regiondata);
1067 if (autodepth_last) {
1082 const bool has_depth)
1103 if (autodepth_last ==
nullptr) {
1107 if (autodepth_last->
has_depth ==
false) {
1126 rect.
xmin = mval[0];
1127 rect.
ymin = mval[1];
1128 rect.
xmax = mval[0] + 1;
1129 rect.
ymax = mval[1] + 1;
1145 float mouse_worldloc[3],
1146 const float fallback_depth_pt[3])
1149 int margin_arr[] = {0, 2, 4};
1150 bool depth_ok =
false;
1156 depth_ok = (depth_close !=
FLT_MAX);
1157 }
while ((depth_ok ==
false) && (i <
ARRAY_SIZE(margin_arr)));
1160 float centx =
float(mval[0]) + 0.5f;
1161 float centy =
float(mval[1]) + 0.5f;
1168 if (fallback_depth_pt) {
1177 float mouse_worldloc[3],
1179 const float *force_depth)
1184 depth = *force_depth;
1194 float centx =
float(mval[0]) + 0.5f;
1195 float centy =
float(mval[1]) + 0.5f;
1205 } *data =
static_cast<UserData *
>(user_data);
1213 data->depth = depth;
1220 const ViewDepths *vd,
const int mval_sta[2],
const int mval_end[2],
int margin,
float *r_depth)
1231 data.margin = margin;
1239 *r_depth = data.depth;
1241 return (*r_depth != 1.0f);
1254 return radius * (1.0f /
tanf(angle / 2.0f));
1266 const bool use_aspect,
1278 float lens, sensor_size, zoom;
1304 angle =
atanf(
tanf(angle / 2.0f) * zoom) * 2.0f;
1320 winx = region->winx;
1321 winy = region->winy;
1325 float aspect = winx / winy;
1326 if (aspect < 1.0f) {
1327 aspect = 1.0f / aspect;
1344 const float fallback_dist)
1346 float pos[4] = {0.0f, 0.0f, 0.0f, 1.0f};
1347 float dir[4] = {0.0f, 0.0f, 1.0f, 0.0f};
1356 if ((dist < FLT_EPSILON) && (fallback_dist != 0.0f)) {
1357 dist = fallback_dist;
1384 const float dist_co[3],
1385 const float dist_min)
1390 float tvec[3] = {0.0f, 0.0f, -1.0f};
1393 float dist_co_local[3];
1395 sub_v3_v3v3(dist_co_local, dist_co, dist_co_local);
1396 const float delta =
dot_v3v3(tvec, dist_co_local);
1397 const float dist_new = rv3d->
dist + delta;
1398 if (dist_new >= dist_min) {
1400 rv3d->
dist = dist_new;
1419 {0.5f, -0.5f, -0.5f, 0.5f},
1421 {-0.5f, 0.5f, -0.5f, 0.5f},
1425 {0.5f, 0.5f, -0.5f, -0.5f},
1427 {0.5f, 0.5f, 0.5f, 0.5f},
1430 {0.5f, -0.5f, 0.5f, 0.5f},
1432 {-0.5f, -0.5f, -0.5f, 0.5f},
1438 {0.5f, -0.5f, -0.5f, -0.5f},
1440 {0.5f, 0.5f, -0.5f, 0.5f},
1444 {1.0f, 0.0f, 0.0f, 0.0f},
1450 {0.0f, -1.0f, 0.0f, 0.0f},
1469 const float epsilon,
1471 char *r_view_axis_roll)
1488 *r_view_axis_roll = view_axis_roll;
1501 const float delta_test =
fabsf(
1503 if (delta_best > delta_test) {
1504 delta_best = delta_test;
1506 *r_view_axis_roll = view_axis_roll;
1519 const float epsilon,
1521 char *r_view_axis_roll)
1529 return is_axis_view;
1582 BLI_assert(dist ==
nullptr || ofs !=
nullptr);
1603void ED_view3d_to_m4(
float mat[4][4],
const float ofs[3],
const float quat[4],
const float dist)
1605 const float iviewquat[4] = {-quat[0], quat[1], quat[2], quat[3]};
1606 float dvec[3] = {0.0f, 0.0f, dist};
1614 const Object *ob,
float ofs[3],
float quat[4],
const float *dist,
float *lens)
1630 const float quat[4],
1644 float *r_clip_start,
1652 depsgraph, scene, camera_ob_eval, co, &scale, r_clip_start, r_clip_end))
1655 float obmat_new[4][4];
1656 bool is_ortho_camera =
false;
1661 ((
Camera *)camera_ob->
data)->ortho_scale = scale;
1662 is_ortho_camera =
true;
1665 copy_m4_m4(obmat_new, camera_ob_eval->object_to_world().ptr());
1675 if (is_ortho_camera) {
1701 bmain,
depsgraph, scene, camera_ob, &clip_start, &clip_end))
1704 ((
Camera *)camera_ob->
data)->clip_start = clip_start;
1705 ((
Camera *)camera_ob->
data)->clip_end = clip_end;
1709 ((
Camera *)camera_ob_eval->
data)->clip_start = clip_start;
1710 ((
Camera *)camera_ob_eval->
data)->clip_end = clip_end;
1733 float depth = *(
float *)value;
1734 if (depth < data->r_depth) {
1738 if ((++data->count) >= data->count_max) {
1752 if (!vd || !vd->
depths) {
1765 int shape[2] = {vd->
w, vd->
h};
1766 int pixel_count = (
min_ii(x + margin + 1, shape[1]) -
max_ii(x - margin, 0)) *
1767 (
min_ii(y + margin + 1, shape[0]) -
max_ii(y - margin, 0));
1771 data.count_max = pixel_count;
1772 data.r_depth = 1.0f;
1776 depth = data.r_depth;
1782 if (depth != 1.0f) {
1799 bool depths_valid[9] = {
false};
1800 float coords[9][3] = {{0}};
1802 for (
int x = 0, i = 0; x < 2; x++) {
1803 for (
int y = 0; y < 2; y++) {
1804 const int mval_ofs[2] = {mval[0] + (x - 1), mval[1] + (y - 1)};
1806 float depth_fl = 1.0f;
1808 const double depth =
double(depth_fl);
1809 if ((depth > depths->
depth_range[0]) && (depth < depths->depth_range[1])) {
1811 depths_valid[i] =
true;
1818 const int edges[2][6][2] = {
1820 {{0, 1}, {1, 2}, {3, 4}, {4, 5}, {6, 7}, {7, 8}},
1821 {{0, 3}, {3, 6}, {1, 4}, {4, 7}, {2, 5}, {5, 8}},
1824 float cross[2][3] = {{0.0f}};
1826 for (
int i = 0; i < 6; i++) {
1827 for (
int axis = 0; axis < 2; axis++) {
1828 if (depths_valid[edges[axis][i][0]] && depths_valid[edges[axis][i][1]]) {
1830 sub_v3_v3v3(delta, coords[edges[axis][i][0]], coords[edges[axis][i][1]]);
1847 float r_location_world[3])
1849 float centx =
float(mval[0]) + 0.5f;
1850 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)
wmWindow * CTX_wm_window(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 rgb_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)
typedef double(DMatrix)[4][4]
void DEG_id_tag_update(ID *id, unsigned int flags)
void DEG_id_tag_update_ex(Main *bmain, ID *id, unsigned int flags)
Object * DEG_get_evaluated_object(const Depsgraph *depsgraph, Object *object)
#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)
#define RV3D_CAMZOOM_MIN_FACTOR
#define RV3D_LOCK_FLAGS(rv3d)
#define RV3D_CAMZOOM_MAX_FACTOR
@ RV3D_VIEW_AXIS_ROLL_270
@ RV3D_LOCK_ANY_TRANSFORM
#define ANIM_KS_LOCATION_ID
#define ANIM_KS_ROTATION_ID
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)
Read Guarded memory(de)allocation.
void UI_GetThemeColor3fv(int colorid, float col[3])
@ WM_EVENT_IS_CONSECUTIVE
const Depsgraph * depsgraph
draw_view in_light_buf[] float
void ANIM_relative_keyingset_add_source(blender::Vector< PointerRNA > &sources, ID *id, StructRNA *srna, void *data)
KeyingSet * ANIM_get_keyingset_for_autokeying(const Scene *scene, const char *transformKSName)
int ANIM_apply_keyingset(bContext *C, blender::Vector< PointerRNA > *sources, KeyingSet *keyingset, const blender::animrig::ModifyKeyMode mode, const float cfra)
void MEM_freeN(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_dupallocN)(const void *vmemh)
ccl_device_inline float cross(const float2 a, const float2 b)
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)
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)
void ED_view3d_dist_range_get(const View3D *v3d, float r_dist_range[2])
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 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)
void view3d_region_operator_needs_opengl(wmWindow *, ARegion *region)
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)
void view3d_operator_needs_opengl(const bContext *C)
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 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)