87#define M_GOLDEN_RATIO_CONJUGATE 0.618033988749895f
89#define VIEW3D_OVERLAY_LINEHEIGHT (UI_style_get()->widget.points * UI_SCALE_FAC * 1.6f)
99 const float viewmat[4][4],
100 const float winmat[4][4],
154 float len_px, len_sc;
170 len_sc =
float(std::max(region->winx, region->winy));
173 rv3d->
pixsize = len_px / len_sc;
181 const float viewmat[4][4],
182 const float winmat[4][4],
198 const float viewmat[4][4],
199 const float winmat[4][4])
259 const char *viewname;
278 shiftx = data_eval->
shiftx;
286 data_eval->
shiftx = shiftx;
315 const float lens_old = v3d->
lens;
320 v3d->
lens = lens_old;
336 v3d->
lens = lens_old;
346 const float viewmat[4][4],
347 const float winmat[4][4],
354 if (ED_view3d_is_region_xr_mirror_active(wm, v3d, region)) {
355 view3d_xr_mirror_setup(wm,
depsgraph, scene, v3d, region, rect);
367#ifndef WITH_XR_OPENXR
388 rctf rect_view, rect_camera;
398 rect_view =
params.viewplane;
411 &
params, scene->r.xsch, scene->r.ysch, scene->r.xasp, scene->r.yasp);
412 rect_camera =
params.viewplane;
452 float x3, y3, x4, y4;
454 x3 = x1 + fac * (x2 - x1);
455 y3 = y1 + fac * (y2 - y1);
456 x4 = x1 + (1.0f - fac) * (x2 - x1);
457 y4 = y1 + (1.0f - fac) * (y2 - y1);
478 uint shdr_pos,
float x1,
float x2,
float y1,
float y2,
const char golden,
const char dir)
532 float x1, x2, y1, y2;
533 float x1i, x2i, y1i, y2i;
539 if (v3d->
camera ==
nullptr) {
548 x1 = viewborder.
xmin;
549 y1 = viewborder.
ymin;
550 x2 = viewborder.
xmax;
551 y2 = viewborder.
ymax;
562 x1i =
int(x1 - 1.0001f);
563 y1i =
int(y1 - 1.0001f);
564 x2i =
int(x2 + (1.0f - 0.0001f));
565 y2i =
int(y2 + (1.0f - 0.0001f));
578 const float winx = (region->winx + 1);
579 const float winy = (region->winy + 1);
591 immRectf(shdr_pos, 0.0f, winy, x1i, 0.0f);
594 immRectf(shdr_pos, x2i, winy, winx, 0.0f);
597 immRectf(shdr_pos, x1i, winy, x2i, y2i);
600 immRectf(shdr_pos, x1i, y1i, x2i, 0.0f);
608#ifdef VIEW3D_CAMERA_BORDER_HACK
628 float viewport_size[4];
630 immUniform2f(
"viewport_size", viewport_size[2], viewport_size[3]);
648 float x3, y3, x4, y4;
650 x3 =
floorf(x1 + (scene->r.border.xmin * (x2 - x1))) - 1;
651 y3 =
floorf(y1 + (scene->r.border.ymin * (y2 - y1))) - 1;
652 x4 =
floorf(x1 + (scene->r.border.xmax * (x2 - x1))) + (
U.pixelsize - 1);
653 y4 =
floorf(y1 + (scene->r.border.ymax * (y2 - y1))) + (
U.pixelsize - 1);
667 x3 = x1 + 0.5f * (x2 - x1);
668 y3 = y1 + 0.5f * (y2 - y1);
719 margins_rect.
xmin = x1;
720 margins_rect.xmax = x2;
721 margins_rect.ymin = y1;
722 margins_rect.ymax = y2;
725 shdr_pos, &margins_rect, scene->safe_areas.title, scene->safe_areas.action);
729 center_rect.
xmin = x1;
730 center_rect.xmax = x2;
731 center_rect.ymin = y1;
732 center_rect.ymax = y2;
735 scene->safe_areas.title_center,
736 scene->safe_areas.action_center);
743 float sizex = scene->r.xsch * scene->r.xasp;
744 float sizey = scene->r.ysch * scene->r.yasp;
753 float sensor_scale = (x2i - x1i) / sensor_x;
754 float sensor_height = sensor_scale * sensor_y;
758 rect.
ymin = (y1i + y2i) * 0.5f - sensor_height * 0.5f;
759 rect.
ymax = rect.
ymin + sensor_height;
762 float sensor_scale = (y2i - y1i) / sensor_y;
763 float sensor_width = sensor_scale * sensor_x;
765 rect.
xmin = (x1i + x2i) * 0.5f - sensor_width * 0.5f;
766 rect.
xmax = rect.
xmin + sensor_width;
791 y1i - (0.7f *
U.widget_unit),
808 float viewport_size[4];
810 immUniform2f(
"viewport_size", viewport_size[2], viewport_size[3]);
835 if (scene->unit.system) {
863 void const **r_usys_pt,
869 float grid_scale = v3d->
grid;
878 grid_scale /= scene->unit.scale_length;
881 for (i = 0; i <
len; i++) {
886 r_grid_steps[i] = r_grid_steps[
len - 1];
895 for (
int i = 0;; i++) {
896 r_grid_steps[i] = grid_scale * subdiv;
923 const char **r_grid_unit)
929 float dist = 12.0f / (region->sizex * rv3d->
winmat[0][0]);
936 grid_scale = grid_steps[i];
937 if (grid_scale > dist || i == (grid_steps_len - 1)) {
943 if (r_grid_unit && usys) {
958 const float k =
U.rvisize *
U.pixelsize;
960 const int bright = -20 * (10 -
U.rvibright);
970 float axis_pos[3][2];
971 uchar axis_col[3][4];
973 int axis_order[3] = {0, 1, 2};
976 for (
int axis_i = 0; axis_i < 3; axis_i++) {
977 int i = axis_order[axis_i];
980 float vec[3] = {0.0f};
983 axis_pos[i][0] = startx + vec[0] * k;
984 axis_pos[i][1] = starty + vec[1] * k;
988 axis_col[i][3] = 255 *
hypotf(vec[0], vec[1]);
1003 for (
int axis_i = 0; axis_i < 3; axis_i++) {
1004 int i = axis_order[axis_i];
1017 for (
int axis_i = 0; axis_i < 3; axis_i++) {
1018 int i = axis_order[axis_i];
1020 const char axis_text[2] = {char(
'x' + i),
'\0'};
1022 BLF_draw_default(axis_pos[i][0] + 2, axis_pos[i][1] + 2, 0.0f, axis_text, 1);
1026#ifdef WITH_INPUT_NDOF
1028static void draw_rotation_guide(
const RegionView3D *rv3d)
1033 uchar color[4] = {0, 108, 255, 255};
1048 float scaled_axis[3];
1049 const float scale = rv3d->
dist;
1075# define ROT_AXIS_DETAIL 13
1077 const float s = 0.05f * scale;
1083 const float up[3] = {0.0f, 0.0f, 1.0f};
1084 float vis_angle, vis_axis[3];
1095 for (
int i = 0; i < ROT_AXIS_DETAIL; i++, angle +=
step) {
1096 float p[3] = {s *
cosf(angle), s *
sinf(angle), 0.0f};
1107# undef ROT_AXIS_DETAIL
1170 const char *name =
nullptr;
1172 switch (rv3d->
view) {
1175 name =
IFACE_(
"Front Orthographic");
1178 name =
IFACE_(
"Front Perspective");
1183 name =
IFACE_(
"Back Orthographic");
1186 name =
IFACE_(
"Back Perspective");
1191 name =
IFACE_(
"Top Orthographic");
1194 name =
IFACE_(
"Top Perspective");
1199 name =
IFACE_(
"Bottom Orthographic");
1202 name =
IFACE_(
"Bottom Perspective");
1207 name =
IFACE_(
"Right Orthographic");
1210 name =
IFACE_(
"Right Perspective");
1215 name =
IFACE_(
"Left Orthographic");
1218 name =
IFACE_(
"Left Perspective");
1227 name =
IFACE_(
"Camera Perspective");
1230 name =
IFACE_(
"Camera Orthographic");
1234 name =
IFACE_(
"Camera Panoramic");
1238 name =
IFACE_(
"Object as Camera");
1243 IFACE_(
"User Perspective");
1254 const char *name_array[3] = {name,
nullptr,
nullptr};
1255 int name_array_len = 1;
1259 char tmpstr[96 + 6];
1262 const char *axis_roll;
1265 axis_roll =
" 90\xC2\xB0";
1268 axis_roll =
" 180\xC2\xB0";
1271 axis_roll =
" -90\xC2\xB0";
1274 name_array[name_array_len++] = axis_roll;
1278 name_array[name_array_len++] =
IFACE_(
" (Local)");
1283 name_array[name_array_len++] =
IFACE_(
" (Clipped)");
1286 if (name_array_len > 1) {
1301 const int cfra = scene->r.cfra;
1302 const char *msg_pin =
" (Pinned)";
1303 const char *msg_sep =
" : ";
1304 const char *msg_space =
" ";
1308 const char *info_array[16];
1315 SNPRINTF(info_buffers.frame,
"(%d)", cfra);
1316 info_array[i++] = info_buffers.frame;
1321 info_array[i++] = msg_space;
1323 if (ob !=
nullptr) {
1324 info_array[i++] =
" |";
1342 info_array[i++] = msg_space;
1343 info_array[i++] = ob->
id.
name + 2;
1352 info_array[i++] = msg_sep;
1360 info_array[i++] = msg_sep;
1375 info_array[i++] = msg_sep;
1386 info_array[i++] = msg_sep;
1387 info_array[i++] = kb->
name;
1389 info_array[i++] =
IFACE_(msg_pin);
1402 info_array[i++] =
" <";
1403 info_array[i++] = markern;
1404 info_array[i++] =
">";
1409 info_array[i++] =
IFACE_(
" (Viewer)");
1428 const char *grid_unit =
nullptr;
1432 char numstr[32] =
"";
1433 if (v3d->
grid != 1.0f) {
1438 BLF_draw_default(xoffset, *yoffset, 0.0f, numstr[0] ? numstr : grid_unit,
sizeof(numstr));
1452#ifdef WITH_INPUT_NDOF
1457 draw_rotation_guide(rv3d);
1488 int xoffset = rect->
xmin + (0.5f *
U.widget_unit);
1489 int yoffset = rect->
ymax - (0.1f *
U.widget_unit);
1497 float text_color[4], shadow_color[4];
1600 DRW_cache_free_old_subdiv();
1608 v3d->
runtime.
flag &= ~V3D_RUNTIME_DEPTHBUF_OVERRIDDEN;
1622 const float winmat[4][4],
1623 const char *viewname)
1627 float viewmat[4][4];
1634 float viewmat[4][4];
1649 const float viewmat[4][4],
1650 const float winmat[4][4],
1651 bool is_image_render,
1653 const char *viewname,
1654 const bool do_color_management,
1655 const bool restore_rv3d_mats,
1671 int region_winx, region_winy;
1682 orig.region_winx = region->winx;
1683 orig.region_winy = region->winy;
1684 orig.region_winrct = region->winrct;
1691 region->winx = winx;
1692 region->winy = winy;
1693 region->winrct.xmin = 0;
1694 region->winrct.ymin = 0;
1695 region->winrct.xmax = winx;
1696 region->winrct.ymax = winy;
1716 if ((viewname !=
nullptr && viewname[0] !=
'\0') && (viewmat ==
nullptr) &&
1736 do_color_management,
1739 DRW_cache_free_old_subdiv();
1744 region->winx = orig.region_winx;
1745 region->winy = orig.region_winy;
1746 region->winrct = orig.region_winrct;
1750 if (restore_rv3d_mats) {
1759 G.f &= ~G_FLAG_RENDER_VIEWPORT;
1766 int object_type_exclude_viewport_override,
1767 int object_type_exclude_select_override,
1771 const float viewmat[4][4],
1772 const float winmat[4][4],
1776 bool is_image_render,
1778 const char *viewname,
1779 const bool do_color_management,
1783 View3D v3d = blender::dna::shallow_zero_initialize();
1791 View3DShading *source_shading_settings = &scene->display.shading;
1793 source_shading_settings = shading_override;
1798 if (shading_override) {
1836 if ((object_type_exclude_viewport_override & (1 <<
OB_ARMATURE)) != 0) {
1842 if (is_xr_surface) {
1857 float overscan = scene->eevee.overscan;
1858 scene->eevee.overscan = 0.0f;
1872 do_color_management,
1878 scene->eevee.overscan = overscan;
1890 const char *viewname,
1891 const bool restore_rv3d_mats,
1898 const bool draw_sky = (alpha_mode ==
R_ADDSKY);
1901 bool is_ortho =
false;
1920 const bool own_ofs = (ofs ==
nullptr);
1931 if (ofs ==
nullptr) {
1957 is_ortho =
params.is_ortho;
1962 float clip_start, clipend;
1965 depsgraph, v3d, rv3d, sizex, sizey, &viewplane, &clip_start, &clipend,
nullptr);
2009 do_color_management,
2051 const char *viewname,
2056 View3D v3d = blender::dna::shallow_zero_initialize();
2062 region.regiondata = &rv3d;
2066 View3DShading *source_shading_settings = &scene->display.shading;
2068 source_shading_settings = shading_override;
2243 GPUFrameBuffer *depth_read_fb =
nullptr;
2285 r.xmax = region->winx - 1;
2287 r.ymax = region->winy - 1;
2299 if (
w <= 0 || h <= 0) {
2309 r_d->
depths =
static_cast<float *
>(
MEM_mallocN(
sizeof(
float) *
w * h,
"View depths Subset"));
2323 ViewDepths *d = MEM_cnew<ViewDepths>(
"ViewDepths");
2332 d->
depths = (
float *)int_depths;
2334 int pixel_count = d->
w * d->
h;
2335 for (
int i = 0; i < pixel_count; i++) {
2336 d->
depths[i] = (int_depths[i] >> 8u) /
float(0xFFFFFF);
2350 float far = far_real;
2352 const float *depths = d->
depths;
2360 if ((depth < far) && (depth > near)) {
2365 return far == far_real ?
FLT_MAX : far;
2377 if (!r_depths || *r_depths !=
nullptr) {
2388 v3d->
flag &= ~V3D_SELECT_OUTLINE;
2414 if (viewport !=
nullptr) {
2444 rv3d->
rflag &= ~RV3D_ZOFFSET_DISABLED;
2462#ifdef REUSE_DEPTH_BUFFER
2483 return is_viewport_preview_solid || is_viewport_preview_material || is_viewport_wire_no_xray ||
2484 is_viewport_render_eevee || is_viewport_render_workbench ||
2485 is_viewport_render_external_with_overlay;
2523 switch (obact->
type) {
2525 switch (obact->
mode) {
2550 scene, view_layer,
static_cast<View3D *
>(area->spacedata.first), r_cddata_masks);
2619 printable[0] =
'\0';
2626 if (
state.fps_average + 0.5f <
state.fps_target) {
2628 show_fractional =
true;
2632 if (show_fractional) {
2653 return (type && type->view_update && type->view_draw);
2669 use_border = (scene->r.mode &
R_BORDER) != 0;
2711 if (viewport ==
nullptr) {
2716 if (color_tex ==
nullptr) {
2732 if (tex ==
nullptr) {
2745 if (tex ==
nullptr || data ==
nullptr) {
2770 if (data !=
nullptr) {
2773 if (tex !=
nullptr) {
C++ functions to deal with Armature collections (i.e. the successor of bone layers).
bool ANIM_bonecoll_is_visible_actbone(const bArmature *armature)
Camera data-block and utility functions.
void BKE_camera_multiview_params(const struct RenderData *rd, struct CameraParams *params, const struct Object *camera, const char *viewname)
float BKE_camera_multiview_shift_x(const struct RenderData *rd, const struct Object *camera, const char *viewname)
struct Object * BKE_camera_multiview_render(const struct Scene *scene, struct Object *camera, const char *viewname)
int BKE_camera_sensor_fit(int sensor_fit, float sizex, float sizey)
void BKE_camera_params_init(CameraParams *params)
void BKE_camera_multiview_view_matrix(const struct RenderData *rd, const struct Object *camera, bool is_left, float r_viewmat[4][4])
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)
void BKE_camera_params_compute_matrix(CameraParams *params)
const char * BKE_collection_ui_name_get(Collection *collection)
Depsgraph * CTX_data_expect_evaluated_depsgraph(const bContext *C)
WorkSpace * CTX_wm_workspace(const bContext *C)
wmWindow * CTX_wm_window(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
Main * CTX_data_main(const bContext *C)
wmWindowManager * CTX_wm_manager(const bContext *C)
View3D * CTX_wm_view3d(const bContext *C)
ViewLayer * CTX_data_view_layer(const bContext *C)
CustomData interface, see also DNA_customdata_types.h.
void CustomData_MeshMasks_update(CustomData_MeshMasks *mask_dst, const CustomData_MeshMasks *mask_src)
const CustomData_MeshMasks CD_MASK_BAREMESH
void BKE_image_free_anim_gputextures(Main *bmain)
void BKE_image_free_old_gputextures(Main *bmain)
Key * BKE_key_from_object(Object *ob)
void BKE_view_layer_synced_ensure(const Scene *scene, ViewLayer *view_layer)
LayerCollection * BKE_view_layer_active_collection_get(ViewLayer *view_layer)
Object * BKE_view_layer_active_object_get(const ViewLayer *view_layer)
Base * BKE_view_layer_base_find(ViewLayer *view_layer, Object *ob)
General operations, lookup, etc. for blender objects.
Object * BKE_object_pose_armature_get(Object *ob)
bool BKE_paint_select_face_test(const Object *ob)
bool BKE_scene_multiview_is_stereo3d(const RenderData *rd)
bool BKE_scene_uses_blender_workbench(const Scene *scene)
bool BKE_scene_uses_blender_eevee(const Scene *scene)
const char * BKE_scene_find_marker_name(const Scene *scene, int frame)
void BKE_unit_system_get(int system, int type, const void **r_usys_pt, int *r_len)
const char * BKE_unit_display_name_get(const void *usys_pt, int index)
int BKE_unit_base_get(const void *usys_pt)
double BKE_unit_scalar_get(const void *usys_pt, int index)
void BKE_viewer_path_copy(ViewerPath *dst, const ViewerPath *src)
void BKE_viewer_path_clear(ViewerPath *viewer_path)
bool BKE_viewer_path_equal(const ViewerPath *a, const ViewerPath *b, ViewerPathEqualFlag flag=ViewerPathEqualFlag(0))
void BLF_shadow(int fontid, FontShadowType type, const float rgba[4]=nullptr)
void BLF_color4fv(int fontid, const float rgba[4])
void BLF_shadow_offset(int fontid, int x, int y)
void BLF_batch_draw_begin()
void BLF_disable(int fontid, int option)
void BLF_batch_draw_end()
void BLF_default_size(float size)
void BLF_enable(int fontid, int option)
void BLF_color4ubv(int fontid, const unsigned char rgba[4])
void BLF_draw_default(float x, float y, float z, const char *str, size_t str_len) ATTR_NONNULL()
void BLF_color4ub(int fontid, unsigned char r, unsigned char g, unsigned char b, unsigned char alpha)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
#define LISTBASE_FOREACH(type, var, list)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE int min_ii(int a, int b)
MINLINE float min_ff(float a, float b)
MINLINE int max_ii(int a, int b)
void orthographic_m4(float mat[4][4], float left, float right, float bottom, float top, float nearClip, float farClip)
void perspective_m4(float mat[4][4], float left, float right, float bottom, float top, float nearClip, float farClip)
MINLINE float plane_point_side_v3(const float plane[4], const float co[3])
void mul_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4])
void copy_m4_m4(float m1[4][4], const float m2[4][4])
bool invert_m4_m4(float inverse[4][4], const float mat[4][4])
void normalize_m4(float R[4][4]) ATTR_NONNULL()
void axis_angle_to_quat(float r[4], const float axis[3], float angle)
void mul_qt_v3(const float q[4], float r[3])
MINLINE void copy_v4_v4(float r[4], const float a[4])
void axis_sort_v3(const float axis_values[3], int r_axis_order[3])
MINLINE float len_squared_v3(const float v[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void negate_v3_v3(float r[3], const float a[3])
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void mul_v3_v3fl(float r[3], const float a[3], float f)
MINLINE void add_v3_v3(float r[3], const float a[3])
bool BLI_rcti_isect_pt_v(const struct rcti *rect, const int xy[2])
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
void BLI_rcti_translate(struct rcti *rect, int x, int y)
void BLI_rcti_init(struct rcti *rect, int xmin, int xmax, int ymin, int ymax)
bool BLI_rcti_isect(const struct rcti *src1, const struct rcti *src2, struct rcti *dest)
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
#define SNPRINTF(dst, format,...)
#define BLI_STR_UTF8_MULTIPLICATION_SIGN
size_t BLI_string_join_array(char *result, size_t result_maxncpy, const char *strings[], uint strings_num) ATTR_NONNULL()
void size_t BLI_string_len_array(const char *strings[], uint strings_num) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void BLI_thread_unlock(int type)
void BLI_thread_lock(int type)
#define UNUSED_VARS_NDEBUG(...)
#define SET_FLAG_FROM_TEST(value, test, flag)
Scene * DEG_get_evaluated_scene(const Depsgraph *graph)
ID * DEG_get_evaluated_id(const Depsgraph *depsgraph, ID *id)
Object * DEG_get_evaluated_object(const Depsgraph *depsgraph, Object *object)
#define CD_MASK_PROP_BYTE_COLOR
#define CD_MASK_PROP_COLOR
#define CD_MASK_MDEFORMVERT
#define CD_MASK_PROP_FLOAT2
@ BASE_ENABLED_AND_MAYBE_VISIBLE_IN_VIEWPORT
Object is a sort of wrapper for general info.
@ SCE_VIEWS_FORMAT_STEREO_3D
@ SCE_VIEWS_FORMAT_MULTIVIEW
#define STEREO_RIGHT_NAME
@ USER_MINI_AXIS_TYPE_GIZMO
@ USER_MINI_AXIS_TYPE_MINIMAL
@ USER_MINI_AXIS_TYPE_NONE
@ V3D_OFSDRAW_SHOW_OBJECT_EXTRAS
@ V3D_OFSDRAW_OVERRIDE_SCENE_SETTINGS
@ V3D_OFSDRAW_XR_SHOW_CUSTOM_OVERLAYS
@ V3D_OFSDRAW_SHOW_GRIDFLOOR
@ V3D_OFSDRAW_XR_SHOW_PASSTHROUGH
@ V3D_OFSDRAW_SHOW_ANNOTATION
@ V3D_OFSDRAW_SHOW_SELECTION
@ V3D_OFSDRAW_XR_SHOW_CONTROLLERS
@ V3D_SHADING_BACKGROUND_WORLD
@ V3D_SHADING_TEXTURE_COLOR
@ V3D_SHADING_VERTEX_COLOR
#define RV3D_VIEW_IS_AXIS(view)
@ V3D_OVERLAY_EDIT_WEIGHT
#define RV3D_LOCK_FLAGS(rv3d)
@ V3D_RUNTIME_DEPTHBUF_OVERRIDDEN
@ V3D_OVERLAY_HIDE_OBJECT_ORIGINS
@ V3D_OVERLAY_HIDE_MOTION_PATHS
@ V3D_OVERLAY_HIDE_OBJECT_XTRAS
@ V3D_OVERLAY_HIDE_CURSOR
@ V3D_SHADING_SCENE_WORLD_RENDER
@ V3D_SHADING_SCENE_WORLD
@ V3D_SHADING_SCENE_LIGHTS
@ V3D_SHADING_SCENE_LIGHTS_RENDER
@ V3D_GIZMO_HIDE_NAVIGATE
@ RV3D_VIEW_AXIS_ROLL_180
@ V3D_SHOW_CAMERA_PASSEPARTOUT
@ V3D_XR_SHOW_CUSTOM_OVERLAYS
@ V3D_XR_SHOW_PASSTHROUGH
@ V3D_XR_SHOW_CONTROLLERS
void DRW_draw_region_engine_info(int xoffset, int *yoffset, int line_height)
bool DRW_draw_in_progress()
void DRW_draw_view(const bContext *C)
void DRW_gpu_context_disable()
void DRW_cache_free_old_batches(Main *bmain)
void DRW_draw_render_loop_offscreen(Depsgraph *depsgraph, RenderEngineType *engine_type, ARegion *region, View3D *v3d, bool is_image_render, bool draw_background, bool do_color_management, GPUOffScreen *ofs, GPUViewport *viewport)
void DRW_draw_depth_loop(Depsgraph *depsgraph, ARegion *region, View3D *v3d, GPUViewport *viewport, const bool use_gpencil, const bool use_basic, const bool use_overlay, const bool use_only_selected)
void DRW_gpu_context_enable()
void DRW_draw_depth_object(Scene *scene, ARegion *region, View3D *v3d, GPUViewport *viewport, Object *object)
void DRW_select_buffer_context_create(Depsgraph *depsgraph, blender::Span< Base * > bases, short select_mode)
void ED_info_draw_stats(Main *bmain, Scene *scene, ViewLayer *view_layer, View3D *v3d_local, int x, int *y, int height)
bool ED_scene_fps_average_calc(const Scene *scene, SceneFPS_State *r_state) ATTR_NONNULL(1
const rcti * ED_region_visible_rect(ARegion *region)
bScreen * ED_screen_animation_no_scrub(const wmWindowManager *wm)
void ED_region_pixelspace(const ARegion *region)
#define XRAY_ENABLED(v3d)
@ V3D_DEPTH_SELECTED_ONLY
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 ED_view3d_text_colors_get(const Scene *scene, const View3D *v3d, float r_text_color[4], float r_shadow_color[4])
GPUOffScreen * GPU_offscreen_create(int width, int height, bool with_depth_buffer, eGPUTextureFormat format, eGPUTextureUsage usage, char err_out[256])
#define GPU_ATTACHMENT_TEXTURE(_texture)
GPUFrameBuffer * GPU_framebuffer_active_get()
int GPU_offscreen_width(const GPUOffScreen *offscreen)
void GPU_offscreen_bind(GPUOffScreen *offscreen, bool save)
void GPU_framebuffer_restore()
void GPU_framebuffer_read_depth(GPUFrameBuffer *framebuffer, int x, int y, int width, int height, eGPUDataFormat data_format, void *r_data)
#define GPU_ATTACHMENT_NONE
int GPU_offscreen_height(const GPUOffScreen *offscreen)
void GPU_offscreen_free(GPUOffScreen *offscreen)
void GPU_framebuffer_bind(GPUFrameBuffer *framebuffer)
eGPUTextureFormat GPU_offscreen_format(const GPUOffScreen *offscreen)
#define GPU_framebuffer_ensure_config(_fb,...)
void GPU_offscreen_read_color(GPUOffScreen *offscreen, eGPUDataFormat data_format, void *r_data)
void GPU_framebuffer_free(GPUFrameBuffer *framebuffer)
void GPU_offscreen_unbind(GPUOffScreen *offscreen, bool restore)
void GPU_pass_cache_garbage_collect()
void GPU_matrix_identity_set()
#define GPU_matrix_set(x)
void GPU_matrix_push_projection()
void GPU_matrix_pop_projection()
#define GPU_matrix_projection_set(x)
@ GPU_SHADER_3D_SMOOTH_COLOR
@ GPU_SHADER_3D_LINE_DASHED_UNIFORM_COLOR
@ GPU_SHADER_3D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_AA
@ GPU_SHADER_3D_UNIFORM_COLOR
@ GPU_SHADER_3D_FLAT_COLOR
void GPU_memory_barrier(eGPUBarrier barrier)
void GPU_blend(eGPUBlend blend)
void GPU_line_width(float width)
void GPU_line_smooth(bool enable)
void GPU_depth_mask(bool depth)
@ GPU_BARRIER_TEXTURE_UPDATE
void GPU_depth_test(eGPUDepthTest test)
void GPU_viewport_size_get_f(float coords[4])
int GPU_texture_height(const GPUTexture *texture)
GPUTexture * GPU_texture_create_2d(const char *name, int width, int height, int mip_len, eGPUTextureFormat format, eGPUTextureUsage usage, const float *data)
void GPU_texture_free(GPUTexture *texture)
int GPU_texture_width(const GPUTexture *texture)
void GPU_texture_copy(GPUTexture *dst, GPUTexture *src)
void * GPU_texture_read(GPUTexture *texture, eGPUDataFormat data_format, int mip_level)
@ GPU_TEXTURE_USAGE_SHADER_READ
@ GPU_TEXTURE_USAGE_HOST_READ
GPUTexture * GPU_viewport_color_texture(GPUViewport *viewport, int view)
GPUTexture * GPU_viewport_depth_texture(GPUViewport *viewport)
void GPU_viewport_tag_update(GPUViewport *viewport)
void IMB_rect_from_float(ImBuf *ibuf)
Contains defines and structs used throughout the imbuf module.
Read Guarded memory(de)allocation.
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Gabor Generate Gabor noise Gradient Generate interpolated color and intensity values based on the input vector Magic Generate a psychedelic color texture Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a or normal between camera
void UI_draw_safe_areas(uint pos, const rctf *rect, const float title_aspect[2], const float action_aspect[2])
void UI_fontstyle_set(const uiFontStyle *fs)
#define UI_DEFAULT_TEXT_POINTS
void UI_Theme_Store(bThemeState *theme_state)
void UI_Theme_Restore(const bThemeState *theme_state)
void UI_FontThemeColor(int fontid, int colorid)
void UI_GetThemeColorShade3ubv(int colorid, int offset, unsigned char col[3])
void UI_SetTheme(int spacetype, int regionid)
ATTR_WARN_UNUSED_RESULT const BMVert * v2
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
bool init(ARegion *region)
~ViewportColorSampleSession()
bool sample(const int mval[2], float r_col[3])
static float is_left(const float p0[2], const float p1[2], const float p2[2])
const Depsgraph * depsgraph
uchar view3d_camera_border_hack_col[3]
bool view3d_camera_border_hack_test
bool id_frame_has_keyframe(ID *id, float frame)
Main Keyframe Checking API call.
draw_view in_light_buf[] float
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
RAYTRACE_GROUP_SIZE additional_info("eevee_shared", "eevee_gbuffer_data", "eevee_global_ubo", "eevee_sampling_data", "eevee_utility_texture", "eevee_hiz_data", "draw_view") .specialization_constant(Type RAYTRACE_GROUP_SIZE in_sh_0_tx in_sh_2_tx screen_normal_tx GPU_RGBA8
struct ImBuf * IMB_allocImBuf(unsigned int, unsigned int, unsigned char, unsigned int)
RenderEngineType * RE_engines_find(const char *idname)
void *(* MEM_mallocN)(size_t len, const char *str)
void MEM_freeN(void *vmemh)
T step(const T &edge, const T &value)
float half_to_float(uint16_t v)
VecBase< float, 4 > float4
const char * RE_engine_id_BLENDER_EEVEE_NEXT
const char * RE_engine_id_BLENDER_WORKBENCH
static void draw_background()
ImBufFloatBuffer float_buffer
ImBufByteBuffer byte_buffer
struct Collection * collection
bool fps_target_is_fractional
float wireframe_threshold
float gpencil_vertex_paint_opacity
int object_type_exclude_select
int object_type_exclude_viewport
struct EditBone * act_edbone
XrSessionSettings session_settings
static void draw_viewport_name(ARegion *region, View3D *v3d, int xoffset, int *yoffset)
void ED_view3d_calc_camera_border_size(const Scene *scene, Depsgraph *depsgraph, const ARegion *region, const View3D *v3d, const RegionView3D *rv3d, float r_size[2])
static void draw_selected_name(const View3D *v3d, Scene *scene, ViewLayer *view_layer, Object *ob, int xoffset, int *yoffset)
void ED_view3d_datamask(const Scene *scene, ViewLayer *view_layer, const View3D *v3d, CustomData_MeshMasks *r_cddata_masks)
RV3DMatrixStore * ED_view3d_mats_rv3d_backup(RegionView3D *rv3d)
float ED_view3d_grid_scale(const Scene *scene, const View3D *v3d, const char **r_grid_unit)
static void view3d_draw_border(const bContext *C, ARegion *region)
static void drawviewborder(Scene *scene, Depsgraph *depsgraph, ARegion *region, View3D *v3d)
float ED_view3d_grid_view_scale(const Scene *scene, const View3D *v3d, const ARegion *region, const char **r_grid_unit)
static void view3d_main_region_setup_view(Depsgraph *depsgraph, Scene *scene, View3D *v3d, ARegion *region, const float viewmat[4][4], const float winmat[4][4], const rcti *rect)
ImBuf * ED_view3d_draw_offscreen_imbuf_simple(Depsgraph *depsgraph, Scene *scene, View3DShading *shading_override, eDrawType drawtype, Object *camera, int width, int height, eImBufFlags imbuf_flag, eV3DOffscreenDrawFlag draw_flags, int alpha_mode, const char *viewname, GPUOffScreen *ofs, GPUViewport *viewport, char err_out[256])
static bool view3d_stereo3d_active(wmWindow *win, const Scene *scene, View3D *v3d, RegionView3D *rv3d)
static void view3d_update_viewer_path(const bContext *C)
void view3d_draw_region_info(const bContext *C, ARegion *region)
void ED_view3d_screen_datamask(const Scene *scene, ViewLayer *view_layer, const bScreen *screen, CustomData_MeshMasks *r_cddata_masks)
static void validate_object_select_id(Depsgraph *depsgraph, const Scene *scene, ViewLayer *view_layer, ARegion *region, View3D *v3d, Object *obact)
bool ED_view3d_draw_offscreen_check_nested()
static void view3d_stereo3d_setup(Depsgraph *depsgraph, Scene *scene, View3D *v3d, ARegion *region, const rcti *rect)
void view3d_main_region_draw(const bContext *C, ARegion *region)
static void view3d_stereo3d_setup_offscreen(Depsgraph *depsgraph, const Scene *scene, View3D *v3d, ARegion *region, const float winmat[4][4], const char *viewname)
static void view3d_camera_border(const Scene *scene, const Depsgraph *depsgraph, const ARegion *region, const View3D *v3d, const RegionView3D *rv3d, rctf *r_viewborder, const bool no_shift, const bool no_zoom)
void view3d_depths_rect_create(ARegion *region, rcti *rect, ViewDepths *r_d)
static ViewDepths * view3d_depths_create(ARegion *region)
bool ED_view3d_has_depth_buffer_updated(const Depsgraph *depsgraph, const View3D *v3d)
void ED_view3d_select_id_validate(const ViewContext *vc)
static void view3d_main_region_setup_offscreen(Depsgraph *depsgraph, const Scene *scene, View3D *v3d, ARegion *region, const float viewmat[4][4], const float winmat[4][4])
static void view3d_draw_grease_pencil(const bContext *)
float view3d_depth_near(ViewDepths *d)
#define VIEW3D_OVERLAY_LINEHEIGHT
void ED_view3d_depth_override(Depsgraph *depsgraph, ARegion *region, View3D *v3d, Object *obact, eV3DDepthOverrideMode mode, ViewDepths **r_depths)
void ED_view3d_grid_steps(const Scene *scene, const View3D *v3d, const RegionView3D *rv3d, float r_grid_steps[STEPS_LEN])
static bool view3d_clipping_test(const float co[3], const float clip[6][4])
void ED_view3d_calc_camera_border(const Scene *scene, const Depsgraph *depsgraph, const ARegion *region, const View3D *v3d, const RegionView3D *rv3d, const bool no_shift, rctf *r_viewborder)
static void view3d_draw_view(const bContext *C, ARegion *region)
void ED_view3d_mats_rv3d_restore(RegionView3D *rv3d, RV3DMatrixStore *rv3dmat_pt)
void ED_view3d_draw_setup_view(const wmWindowManager *wm, wmWindow *win, Depsgraph *depsgraph, Scene *scene, ARegion *region, View3D *v3d, const float viewmat[4][4], const float winmat[4][4], const rcti *rect)
static void draw_grid_unit_name(Scene *scene, ARegion *region, View3D *v3d, int xoffset, int *yoffset)
int ED_view3d_backbuf_sample_size_clamp(ARegion *region, const float dist)
void ED_view3d_depths_free(ViewDepths *depths)
void ED_view3d_draw_offscreen(Depsgraph *depsgraph, const Scene *scene, eDrawType drawtype, View3D *v3d, ARegion *region, int winx, int winy, const float viewmat[4][4], const float winmat[4][4], bool is_image_render, bool draw_background, const char *viewname, const bool do_color_management, const bool restore_rv3d_mats, GPUOffScreen *ofs, GPUViewport *viewport)
static const char * view3d_get_name(View3D *v3d, RegionView3D *rv3d)
static bool view3d_main_region_do_render_draw(const Scene *scene)
bool ED_view3d_clipping_test(const RegionView3D *rv3d, const float co[3], const bool is_local)
static void draw_view_axis(RegionView3D *rv3d, const rcti *rect)
ImBuf * ED_view3d_draw_offscreen_imbuf(Depsgraph *depsgraph, Scene *scene, eDrawType drawtype, View3D *v3d, ARegion *region, int sizex, int sizey, eImBufFlags imbuf_flag, int alpha_mode, const char *viewname, const bool restore_rv3d_mats, GPUOffScreen *ofs, GPUViewport *viewport, char err_out[256])
static void drawviewborder_grid3(uint shdr_pos, float x1, float x2, float y1, float y2, float fac)
static void drawviewborder_triangle(uint shdr_pos, float x1, float x2, float y1, float y2, const char golden, const char dir)
RenderEngineType * ED_view3d_engine_type(const Scene *scene, int drawtype)
bool ED_view3d_calc_render_border(const Scene *scene, Depsgraph *depsgraph, View3D *v3d, ARegion *region, rcti *r_rect)
void ED_view3d_update_viewmat(const Depsgraph *depsgraph, const Scene *scene, View3D *v3d, ARegion *region, const float viewmat[4][4], const float winmat[4][4], const rcti *rect, bool offscreen)
#define M_GOLDEN_RATIO_CONJUGATE
void ED_view3d_draw_offscreen_simple(Depsgraph *depsgraph, Scene *scene, View3DShading *shading_override, eDrawType drawtype, int object_type_exclude_viewport_override, int object_type_exclude_select_override, int winx, int winy, uint draw_flags, const float viewmat[4][4], const float winmat[4][4], float clip_start, float clip_end, bool is_xr_surface, bool is_image_render, bool draw_background, const char *viewname, const bool do_color_management, GPUOffScreen *ofs, GPUViewport *viewport)
void ED_scene_draw_fps(const Scene *scene, int xoffset, int *yoffset)
static void drawrenderborder(ARegion *region, View3D *v3d)
float ED_scene_grid_scale(const Scene *scene, const char **r_grid_unit)
static void view3d_opengl_read_Z_pixels(GPUViewport *viewport, rcti *rect, void *data)
static void view3d_grid_steps_ex(const Scene *scene, const View3D *v3d, const RegionView3D *rv3d, float r_grid_steps[STEPS_LEN], void const **r_usys_pt, int *r_len)
void view3d_viewmatrix_set(const Depsgraph *depsgraph, const Scene *scene, const View3D *v3d, RegionView3D *rv3d, const float rect_scale[2])
void view3d_winmatrix_set(const Depsgraph *depsgraph, ARegion *region, const View3D *v3d, const rcti *rect)
void WM_draw_region_viewport_unbind(ARegion *region)
void WM_draw_region_viewport_ensure(Scene *scene, ARegion *region, short space_type)
GPUViewport * WM_draw_region_get_viewport(ARegion *region)
void WM_draw_region_viewport_bind(ARegion *region)
bool WM_stereo3d_enabled(wmWindow *win, bool skip_stereo3d_check)
bool WM_xr_session_state_viewer_pose_matrix_info_get(const wmXrData *xr, float r_viewmat[4][4], float *r_focal_len)