91#define M_GOLDEN_RATIO_CONJUGATE 0.618033988749895f
93#define VIEW3D_OVERLAY_LINEHEIGHT (UI_style_get()->widget.points * UI_SCALE_FAC * 1.6f)
103 const float viewmat[4][4],
104 const float winmat[4][4],
158 float len_px, len_sc;
177 rv3d->
pixsize = len_px / len_sc;
185 const float viewmat[4][4],
186 const float winmat[4][4],
202 const float viewmat[4][4],
203 const float winmat[4][4])
263 const char *viewname;
282 shiftx = data_eval->
shiftx;
290 data_eval->
shiftx = shiftx;
319 const float lens_old = v3d->
lens;
324 v3d->
lens = lens_old;
340 v3d->
lens = lens_old;
350 const float viewmat[4][4],
351 const float winmat[4][4],
358 if (ED_view3d_is_region_xr_mirror_active(wm, v3d, region)) {
359 view3d_xr_mirror_setup(wm,
depsgraph, scene, v3d, region, rect);
371#ifndef WITH_XR_OPENXR
392 rctf rect_view, rect_camera;
402 rect_view =
params.viewplane;
416 rect_camera =
params.viewplane;
456 float x3, y3, x4, y4;
458 x3 = x1 + fac * (x2 - x1);
459 y3 = y1 + fac * (y2 - y1);
460 x4 = x1 + (1.0f - fac) * (x2 - x1);
461 y4 = y1 + (1.0f - fac) * (y2 - y1);
482 uint shdr_pos,
float x1,
float x2,
float y1,
float y2,
const char golden,
const char dir)
536 float x1, x2, y1, y2;
537 float x1i, x2i, y1i, y2i;
543 if (v3d->
camera ==
nullptr) {
552 x1 = viewborder.
xmin;
553 y1 = viewborder.
ymin;
554 x2 = viewborder.
xmax;
555 y2 = viewborder.
ymax;
566 x1i = int(x1 - 1.0001f);
567 y1i = int(y1 - 1.0001f);
568 x2i = int(x2 + (1.0f - 0.0001f));
569 y2i = int(y2 + (1.0f - 0.0001f));
582 const float winx = (region->
winx + 1);
583 const float winy = (region->
winy + 1);
595 immRectf(shdr_pos, 0.0f, winy, x1i, 0.0f);
598 immRectf(shdr_pos, x2i, winy, winx, 0.0f);
601 immRectf(shdr_pos, x1i, winy, x2i, y2i);
604 immRectf(shdr_pos, x1i, y1i, x2i, 0.0f);
612#ifdef VIEW3D_CAMERA_BORDER_HACK
632 float viewport_size[4];
634 immUniform2f(
"viewport_size", viewport_size[2], viewport_size[3]);
652 float x3, y3, x4, y4;
671 x3 = x1 + 0.5f * (x2 - x1);
672 y3 = y1 + 0.5f * (y2 - y1);
723 margins_rect.
xmin = x1;
724 margins_rect.
xmax = x2;
725 margins_rect.
ymin = y1;
726 margins_rect.
ymax = y2;
736 center_rect.
xmin = x1;
737 center_rect.
xmax = x2;
738 center_rect.
ymin = y1;
739 center_rect.
ymax = y2;
760 float sensor_scale = (x2i - x1i) / sensor_x;
761 float sensor_height = sensor_scale * sensor_y;
765 rect.
ymin = (y1i + y2i) * 0.5f - sensor_height * 0.5f;
766 rect.
ymax = rect.
ymin + sensor_height;
769 float sensor_scale = (y2i - y1i) / sensor_y;
770 float sensor_width = sensor_scale * sensor_x;
772 rect.
xmin = (x1i + x2i) * 0.5f - sensor_width * 0.5f;
773 rect.
xmax = rect.
xmin + sensor_width;
798 y1i - (0.7f *
U.widget_unit),
815 float viewport_size[4];
817 immUniform2f(
"viewport_size", viewport_size[2], viewport_size[3]);
870 void const **r_usys_pt,
876 float grid_scale = v3d->
grid;
888 for (
i = 0;
i <
len;
i++) {
893 r_grid_steps[
i] = r_grid_steps[
len - 1];
902 for (
int i = 0;;
i++) {
903 r_grid_steps[
i] = grid_scale * subdiv;
930 const char **r_grid_unit)
936 float dist = 12.0f / (region->
sizex * rv3d->
winmat[0][0]);
943 grid_scale = grid_steps[
i];
944 if (grid_scale > dist ||
i == (grid_steps_len - 1)) {
950 if (r_grid_unit && usys) {
967 const int bright = -20 * (10 -
U.rvibright);
977 float axis_pos[3][2];
978 float axis_col[3][4];
980 int axis_order[3] = {0, 1, 2};
983 for (
int axis_i = 0; axis_i < 3; axis_i++) {
984 int i = axis_order[axis_i];
987 float vec[3] = {0.0f};
990 axis_pos[
i][0] = startx + vec[0] * k;
991 axis_pos[
i][1] = starty + vec[1] * k;
995 axis_col[
i][3] =
hypotf(vec[0], vec[1]);
1006 format,
"color", blender::gpu::VertAttrType::SFLOAT_32_32_32_32);
1011 for (
int axis_i = 0; axis_i < 3; axis_i++) {
1012 int i = axis_order[axis_i];
1025 for (
int axis_i = 0; axis_i < 3; axis_i++) {
1026 int i = axis_order[axis_i];
1028 const char axis_text[2] = {char(
'x' +
i),
'\0'};
1034#ifdef WITH_INPUT_NDOF
1038static void draw_ndof_guide_orbit_axis(
const RegionView3D *rv3d)
1043 float color[4] = {0.0f, 0.42f, 1.0f, 1.0f};
1053 format,
"color", blender::gpu::VertAttrType::SFLOAT_32_32_32_32);
1059 float scaled_axis[3];
1070 color[3] = 0.2f +
fabsf(rv3d->rot_angle);
1086# define ROT_AXIS_DETAIL 13
1088 const float s = 0.05f *
scale;
1094 const float up[3] = {0.0f, 0.0f, 1.0f};
1095 float vis_angle, vis_axis[3];
1106 for (
int i = 0;
i < ROT_AXIS_DETAIL;
i++,
angle +=
step) {
1118# undef ROT_AXIS_DETAIL
1143static void draw_ndof_guide_orbit_center(
const RegionView3D *rv3d)
1145 uchar color[4] = {0, 108, 255, 255};
1207 const char *
name =
nullptr;
1209 switch (rv3d->
view) {
1283 IFACE_(
"User Perspective");
1294 const char *name_array[3] = {
name,
nullptr,
nullptr};
1295 int name_array_len = 1;
1299 char tmpstr[96 + 6];
1302 const char *axis_roll;
1305 axis_roll =
" 90\xC2\xB0";
1308 axis_roll =
" 180\xC2\xB0";
1311 axis_roll =
" -90\xC2\xB0";
1314 name_array[name_array_len++] = axis_roll;
1318 name_array[name_array_len++] =
IFACE_(
" (Local)");
1323 name_array[name_array_len++] =
IFACE_(
" (Clipped)");
1326 if (name_array_len > 1) {
1342 for (
const Layer *layer : grease_pencil.layers()) {
1343 if (!layer->frames().is_empty()) {
1357 const int cfra = scene->
r.
cfra;
1358 const char *msg_pin =
" (Soloed)";
1359 const char *msg_sep =
" : ";
1360 const char *msg_space =
" ";
1364 const char *info_array[16];
1383 info_array[
i++] = info_buffers.frame;
1388 info_array[
i++] = msg_space;
1390 if (ob !=
nullptr) {
1391 info_array[
i++] =
" |";
1400 info_array[
i++] = msg_space;
1401 info_array[
i++] = ob->
id.
name + 2;
1405 if (
const ID *data_id =
static_cast<const ID *
>(ob->
data)) {
1406 info_array[
i++] =
" | ";
1407 info_array[
i++] = data_id->name + 2;
1418 info_array[
i++] = msg_sep;
1426 info_array[
i++] = msg_sep;
1441 info_array[
i++] = msg_sep;
1452 info_array[
i++] = msg_sep;
1453 info_array[
i++] = kb->
name;
1455 info_array[
i++] =
IFACE_(msg_pin);
1474 info_array[
i++] =
" <";
1475 info_array[
i++] = markern;
1476 info_array[
i++] =
">";
1481 info_array[
i++] =
IFACE_(
" (Viewer)");
1503 const char *grid_unit =
nullptr;
1507 char numstr[32] =
"";
1508 if (v3d->
grid != 1.0f) {
1514 BLF_draw_default(xoffset, *yoffset, 0.0f, numstr[0] ? numstr : grid_unit,
sizeof(numstr));
1528#ifdef WITH_INPUT_NDOF
1534 draw_ndof_guide_orbit_axis(rv3d);
1547 draw_ndof_guide_orbit_center(rv3d);
1582 int xoffset = rect->
xmin + (0.5f *
U.widget_unit);
1583 int yoffset = rect->
ymax - (0.1f *
U.widget_unit);
1591 float text_color[4], shadow_color[4];
1715 const float winmat[4][4],
1716 const char *viewname)
1720 float viewmat[4][4];
1727 float viewmat[4][4];
1742 const float viewmat[4][4],
1743 const float winmat[4][4],
1744 bool is_image_render,
1746 const char *viewname,
1747 const bool do_color_management,
1748 const bool restore_rv3d_mats,
1766 int region_winx, region_winy;
1778 orig.v3d_camera = v3d->
camera;
1779 orig.v3d_lens = v3d->
lens;
1780 orig.region_winx = region->
winx;
1781 orig.region_winy = region->
winy;
1782 orig.region_winrct = region->
winrct;
1783 orig.rv3d_persp = rv3d->
persp;
1790 region->
winx = winx;
1791 region->
winy = winy;
1825 if ((viewname !=
nullptr && viewname[0] !=
'\0') && (viewmat ==
nullptr) &&
1845 do_color_management,
1853 region->
winx = orig.region_winx;
1854 region->
winy = orig.region_winy;
1855 region->
winrct = orig.region_winrct;
1859 if (restore_rv3d_mats) {
1863 rv3d->
persp = orig.rv3d_persp;
1868 v3d->
camera = orig.v3d_camera;
1869 v3d->
lens = orig.v3d_lens;
1878 int object_type_exclude_viewport_override,
1879 int object_type_exclude_select_override,
1883 const float viewmat[4][4],
1884 const float winmat[4][4],
1887 float vignette_aperture,
1889 bool is_image_render,
1891 const char *viewname,
1892 const bool do_color_management,
1896 View3D v3d = blender::dna::shallow_zero_initialize();
1908 source_shading_settings = shading_override;
1913 if (shading_override) {
1951 if ((object_type_exclude_viewport_override & (1 <<
OB_ARMATURE)) != 0) {
1957 if (is_xr_surface) {
1988 do_color_management,
2006 const char *viewname,
2007 const bool restore_rv3d_mats,
2014 const bool draw_sky = (alpha_mode ==
R_ADDSKY);
2017 bool is_ortho =
false;
2022 (imbuf_flag &
IB_float_data) ? blender::gpu::TextureFormat::SFLOAT_16_16_16_16 :
2023 blender::gpu::TextureFormat::UNORM_8_8_8_8;
2038 const bool own_ofs = (ofs ==
nullptr);
2050 if (ofs ==
nullptr) {
2076 is_ortho =
params.is_ortho;
2081 float clip_start, clipend;
2084 depsgraph, v3d, rv3d, sizex, sizey, &viewplane, &clip_start, &clipend,
nullptr);
2128 do_color_management,
2170 const char *viewname,
2175 View3D v3d = blender::dna::shallow_zero_initialize();
2178 region.
runtime = ®ion_runtime;
2189 source_shading_settings = shading_override;
2420 if (
w <= 0 || h <= 0) {
2463 float far = far_real;
2465 const float *depths = d->
depths;
2466 const int depth_num = int(d->
w) * int(d->
h);
2470 if (r_xy !=
nullptr) {
2471 int index_found = -1;
2472 for (
int i = 0;
i < depth_num;
i++) {
2473 const float depth = *depths++;
2474 if ((depth < far) && (depth > near)) {
2479 if (index_found != -1) {
2480 r_xy[0] = d->
x + (index_found % int(d->
w));
2481 r_xy[1] = d->
y + (index_found / int(d->
w));
2485 for (
int i = 0;
i < depth_num;
i++) {
2486 const float depth = depths[
i];
2487 if ((depth < far) && (depth > near)) {
2493 return far == far_real ?
FLT_MAX : far;
2511 if (!r_depths || *r_depths !=
nullptr) {
2520 int flag2 = v3d->
flag2;
2525 use_overlay =
false;
2556 if (viewport !=
nullptr) {
2605#ifdef REUSE_DEPTH_BUFFER
2626 return is_viewport_preview_solid || is_viewport_preview_material || is_viewport_wire_no_xray ||
2627 is_viewport_render_eevee || is_viewport_render_workbench ||
2628 is_viewport_render_external_with_overlay;
2666 switch (obact->
type) {
2668 switch (obact->
mode) {
2693 scene, view_layer,
static_cast<View3D *
>(area->spacedata.first), r_cddata_masks);
2769 printable[0] =
'\0';
2771 bool show_fractional =
state.fps_target_is_fractional;
2776 if (
state.fps_average + 0.5f <
state.fps_target) {
2778 show_fractional =
true;
2790 if (show_fractional) {
2867 if (viewport ==
nullptr) {
2872 if (color_tex ==
nullptr) {
2890 blender::gpu::TextureFormat::SFLOAT_16_16_16_16,
2893 if (tex ==
nullptr) {
2906 if (tex ==
nullptr || data ==
nullptr) {
2931 if (data !=
nullptr) {
2934 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)
Functions to insert, delete or modify keyframes.
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
Low-level operations for grease pencil.
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_enable(int fontid, FontFlags flag)
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_batch_draw_end()
void BLF_default_size(float size)
void BLF_disable(int fontid, FontFlags flag)
void BLF_draw_default(float x, float y, float z, const char *str, size_t str_len) ATTR_NONNULL()
void * BLI_findlink(const ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
BLI_INLINE bool BLI_listbase_is_empty(const ListBase *lb)
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 hsv_to_rgb_v(const float hsv[3], float r_rgb[3])
void rgb_to_hsv_v(const float rgb[3], float r_hsv[3])
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_UTF8(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)
T * DEG_get_evaluated(const Depsgraph *depsgraph, T *id)
#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.
#define STEREO_RIGHT_NAME
@ SCE_VIEWS_FORMAT_STEREO_3D
@ SCE_VIEWS_FORMAT_MULTIVIEW
#define NDOF_IS_ORBIT_AROUND_CENTER_MODE(userdef)
@ NDOF_SHOW_GUIDE_ORBIT_AXIS
@ NDOF_SHOW_GUIDE_ORBIT_CENTER
@ 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
@ V3D_SHOW_CAMERA_PASSEPARTOUT
@ V3D_XR_SHOW_CUSTOM_OVERLAYS
@ V3D_XR_SHOW_PASSTHROUGH
@ V3D_XR_SHOW_CONTROLLERS
#define RV3D_VIEW_IS_AXIS(view)
@ 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
#define RV3D_LOCK_FLAGS(rv3d)
@ V3D_RUNTIME_DEPTHBUF_OVERRIDDEN
@ V3D_OVERLAY_EDIT_WEIGHT
@ V3D_OVERLAY_HIDE_OBJECT_ORIGINS
@ V3D_OVERLAY_HIDE_MOTION_PATHS
@ V3D_OVERLAY_HIDE_OBJECT_XTRAS
@ V3D_OVERLAY_HIDE_CURSOR
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_draw_depth_loop(Depsgraph *depsgraph, ARegion *region, View3D *v3d, GPUViewport *viewport, const bool use_gpencil, const bool use_only_selected, const bool use_only_active_object)
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_gpu_context_enable()
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])
#define GPU_ATTACHMENT_TEXTURE(_texture)
int GPU_offscreen_width(const GPUOffScreen *offscreen)
void GPU_offscreen_bind(GPUOffScreen *offscreen, bool save)
void GPU_framebuffer_restore()
blender::gpu::TextureFormat GPU_offscreen_format(const GPUOffScreen *offscreen)
#define GPU_ATTACHMENT_NONE
void GPU_framebuffer_free(blender::gpu::FrameBuffer *fb)
int GPU_offscreen_height(const GPUOffScreen *offscreen)
GPUOffScreen * GPU_offscreen_create(int width, int height, bool with_depth_buffer, blender::gpu::TextureFormat format, eGPUTextureUsage usage, bool clear, char err_out[256])
void GPU_offscreen_free(GPUOffScreen *offscreen)
void GPU_framebuffer_read_depth(blender::gpu::FrameBuffer *fb, int x, int y, int width, int height, eGPUDataFormat data_format, void *r_data)
#define GPU_framebuffer_ensure_config(_fb,...)
void GPU_offscreen_read_color(GPUOffScreen *offscreen, eGPUDataFormat data_format, void *r_data)
void GPU_framebuffer_bind(blender::gpu::FrameBuffer *fb)
void GPU_offscreen_unbind(GPUOffScreen *offscreen, bool restore)
blender::gpu::FrameBuffer * GPU_framebuffer_active_get()
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
@ GPU_BARRIER_TEXTURE_UPDATE
void GPU_line_width(float width)
void GPU_line_smooth(bool enable)
void GPU_depth_mask(bool depth)
void GPU_blend(GPUBlend blend)
void GPU_depth_test(GPUDepthTest test)
void GPU_memory_barrier(GPUBarrier barrier)
void GPU_viewport_size_get_f(float coords[4])
void GPU_texture_copy(blender::gpu::Texture *dst, blender::gpu::Texture *src)
int GPU_texture_height(const blender::gpu::Texture *texture)
int GPU_texture_width(const blender::gpu::Texture *texture)
@ GPU_TEXTURE_USAGE_SHADER_READ
@ GPU_TEXTURE_USAGE_HOST_READ
void * GPU_texture_read(blender::gpu::Texture *texture, eGPUDataFormat data_format, int mip_level)
blender::gpu::Texture * GPU_texture_create_2d(const char *name, int width, int height, int mip_len, blender::gpu::TextureFormat format, eGPUTextureUsage usage, const float *data)
void GPU_texture_free(blender::gpu::Texture *texture)
void GPU_viewport_tag_update(GPUViewport *viewport)
blender::gpu::Texture * GPU_viewport_color_texture(GPUViewport *viewport, int view)
blender::gpu::Texture * GPU_viewport_depth_texture(GPUViewport *viewport)
static double angle(const Eigen::Vector3d &v1, const Eigen::Vector3d &v2)
void IMB_byte_from_float(ImBuf *ibuf)
ImBuf * IMB_allocImBuf(unsigned int x, unsigned int y, unsigned char planes, unsigned int flags)
Read Guarded memory(de)allocation.
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)
@ TH_KEYTYPE_KEYFRAME_SELECT
void UI_GetThemeColorShade3fv(int colorid, int offset, float col[3])
void UI_GetThemeColor4fv(int colorid, float col[4])
void UI_FontThemeColor(int fontid, int colorid)
void UI_SetTheme(int spacetype, int regionid)
BMesh const char void * data
ATTR_WARN_UNUSED_RESULT const BMVert * v2
BPy_StructRNA * depsgraph
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 float2 &p0, const float2 &p1, const float2 &p2)
uchar view3d_camera_border_hack_col[3]
bool view3d_camera_border_hack_test
VecBase< float, D > step(VecOp< float, D >, VecOp< float, D >) RET
RenderEngineType * RE_engines_find(const char *idname)
void * MEM_mallocN(size_t len, const char *str)
void * MEM_callocN(size_t len, const char *str)
void * MEM_malloc_arrayN(size_t len, size_t size, const char *str)
void MEM_freeN(void *vmemh)
bool id_frame_has_keyframe(ID *id, float frame)
void DRW_cache_free_old_subdiv()
MatBase< T, NumCol, NumRow > scale(const MatBase< T, NumCol, NumRow > &mat, const VectorT &scale)
float half_to_float(uint16_t v)
VecBase< float, 4 > float4
blender::VecBase< uint16_t, 4 > ushort4
const char * RE_engine_id_BLENDER_WORKBENCH
const char * RE_engine_id_BLENDER_EEVEE
ARegionRuntimeHandle * runtime
float composition_guide_color[4]
ImBufFloatBuffer float_buffer
ImBufByteBuffer byte_buffer
struct Collection * collection
void(* view_draw)(struct RenderEngine *engine, const struct bContext *context, struct Depsgraph *depsgraph)
void(* view_update)(struct RenderEngine *engine, const struct bContext *context, struct Depsgraph *depsgraph)
struct SceneDisplay display
struct DisplaySafeAreas safe_areas
float wireframe_threshold
float gpencil_vertex_paint_opacity
int object_type_exclude_select
struct Object * ob_center
int object_type_exclude_viewport
struct EditBone * act_edbone
XrSessionSettings session_settings
static void draw_background(const rcti *rect)
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)
void ED_view3d_depth_override(Depsgraph *depsgraph, ARegion *region, View3D *v3d, Object *, eV3DDepthOverrideMode mode, bool use_overlay, ViewDepths **r_depths)
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 view3d_gpu_read_Z_pixels(GPUViewport *viewport, rcti *rect, void *data)
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_grid_steps(const Scene *scene, const View3D *v3d, const RegionView3D *rv3d, float r_grid_steps[STEPS_LEN])
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, float vignette_aperture, 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_view3D_mats_rv3d_free(RV3DMatrixStore *rv3d_mat)
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_scene_draw_fps(const Scene *scene, int xoffset, int *yoffset)
static void drawrenderborder(ARegion *region, View3D *v3d)
static bool is_grease_pencil_with_layer_keyframe(const Object &ob)
float ED_scene_grid_scale(const Scene *scene, const char **r_grid_unit)
float view3d_depth_near_ex(ViewDepths *d, int r_xy[2])
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)