Blender V5.3
ED_view3d.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2008 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10#include <array>
11
12#include "BLI_bounds_types.hh"
13#include "BLI_enum_flags.hh"
16
17#include "DNA_scene_types.h"
18
19namespace blender {
20
21/* ********* exports for space_view3d/ module ********** */
22struct ARegion;
23struct BMEdge;
24struct BMElem;
25struct BMEditMesh;
26struct BMFace;
27struct BMVert;
28struct BPoint;
29struct Base;
30struct BezTriple;
31struct BoundBox;
32struct Camera;
34struct Depsgraph;
35struct EditBone;
36struct GPUSelectBuffer;
37struct ID;
38struct Main;
39struct MetaElem;
40struct Nurb;
41struct Object;
42struct RV3DMatrixStore;
43struct RegionView3D;
44struct RenderEngineType;
45struct Scene;
46struct ScrArea;
47struct View3D;
48struct ViewContext;
49struct ViewLayer;
50struct ViewOpsData;
51struct bContext;
52struct bGPDlayer;
53struct bPoseChannel;
54struct bScreen;
55struct rctf;
56struct rcti;
57struct wmEvent;
58struct wmGizmo;
59struct wmKeyMapItem;
60struct wmOperator;
61struct wmWindow;
62struct wmWindowManager;
63namespace ed::transform {
65}
66namespace gpu {
67class Texture;
68}
69
74 /* Dependency graph is uses for depth drawing, viewport camera matrix access, and also some areas
75 * are re-using this to access evaluated entities.
76 *
77 * Moral of the story: assign to a fully evaluated state. */
78 Depsgraph *depsgraph;
88 int mval[2];
89};
90
91struct ViewDepths {
92 unsigned short w, h;
93 /* only for temp use for sub-rectangles, added to `region->winx/winy`. */
94 short x, y;
95 float *depths;
96 double depth_range[2];
97};
98
99/* Rotate 3D cursor on placement. */
106
107void ED_view3d_background_color_get(const Scene *scene, const View3D *v3d, float r_color[3]);
108void ED_view3d_text_colors_get(const Scene *scene,
109 const View3D *v3d,
110 float r_text_color[4],
111 float r_shadow_color[4]);
113 const Object *ob,
114 const View3D *v3d);
120void ED_view3d_cursor3d_position(bContext *C,
121 const int mval[2],
122 bool use_depth,
123 float r_cursor_co[3]);
125 const int mval[2],
126 bool use_depth,
127 enum eV3DCursorOrient orientation,
128 float r_cursor_co[3],
129 float r_cursor_quat[4]);
130void ED_view3d_cursor3d_update(bContext *C,
131 const int mval[2],
132 bool use_depth,
133 enum eV3DCursorOrient orientation);
134
135Camera *ED_view3d_camera_data_get(View3D *v3d, RegionView3D *rv3d);
136
146void ED_view3d_to_m4(
147 float mat[4][4], const float ofs[3], const float quat[4], float dist, float roll);
158 const float mat[4][4], float ofs[3], float quat[4], const float *dist, float roll);
159
170 const Object *ob, float ofs[3], float quat[4], const float *dist, float roll, float *r_lens);
182void ED_view3d_to_object(const Depsgraph *depsgraph,
183 Object *ob,
184 const float ofs[3],
185 const float quat[4],
186 float dist,
187 float roll);
188
189bool ED_view3d_camera_to_view_selected(Main *bmain,
190 Depsgraph *depsgraph,
191 const Scene *scene,
192 Object *camera_ob);
193
195 Depsgraph *depsgraph,
196 const Scene *scene,
197 Object *camera_ob);
198
202void ED_view3d_lastview_store(RegionView3D *rv3d);
203
204/* Depth buffer */
218
231void ED_view3d_depth_override(Depsgraph *depsgraph,
232 ARegion *region,
233 View3D *v3d,
234 Object *obact,
236 bool use_overlay,
237 ViewDepths **r_depths);
238void ED_view3d_depths_free(ViewDepths *depths);
239bool ED_view3d_depth_read_cached(const ViewDepths *vd,
240 const int mval[2],
241 int margin,
242 float *r_depth);
243bool ED_view3d_depth_read_cached_normal(const ARegion *region,
244 const ViewDepths *depths,
245 const int mval[2],
246 float r_normal[3]);
247bool ED_view3d_depth_unproject_v3(const ARegion *region,
248 const int mval[2],
249 double depth,
250 float r_location_world[3]);
251
252bool ED_view3d_has_depth_buffer_updated(const Depsgraph *depsgraph, const View3D *v3d);
253
261ViewOpsData *ED_view3d_navigation_init(bContext *C, const wmKeyMapItem *kmi_merge);
262bool ED_view3d_navigation_do(bContext *C,
263 ViewOpsData *vod,
264 const wmEvent *event,
265 const float depth_loc_override[3]);
266void ED_view3d_navigation_free(bContext *C, ViewOpsData *vod);
267
268/* Projection */
269#define IS_CLIPPED 12000
270
271/* return values for ED_view3d_project_...() */
292
293/* some clipping tests are optional */
324
325#define V3D_PROJ_TEST_CLIP_DEFAULT \
326 (V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_WIN | V3D_PROJ_TEST_CLIP_NEAR)
327#define V3D_PROJ_TEST_ALL \
328 (V3D_PROJ_TEST_CLIP_DEFAULT | V3D_PROJ_TEST_CLIP_FAR | V3D_PROJ_TEST_CLIP_ZERO | \
329 V3D_PROJ_TEST_CLIP_CONTENT)
330
331#define V3D_PROJ_TEST_CLIP_CONTENT_DEFAULT \
332 (V3D_PROJ_TEST_CLIP_CONTENT | V3D_PROJ_TEST_CLIP_NEAR | V3D_PROJ_TEST_CLIP_FAR | \
333 V3D_PROJ_TEST_CLIP_WIN)
334
335/* `view3d_snap.cc` */
336
338 wmOperator *op,
339 const float target_loc_global[3],
340 int pivot_point);
341
342/* `view3d_cursor_snap.cc` */
343
344#define USE_SNAP_DETECT_FROM_KEYMAP_HACK
353
367
369 /* Setup. */
374 float *prevpoint;
379
380 bool (*poll)(ARegion *region, void *custom_poll_data);
382};
383
390 const float prev_point[3]);
392 const bContext *C,
393 const ARegion *region,
394 const int2 &mval);
398 const float source_loc[3],
399 const float target_loc[3],
400 const eSnapMode source_type,
401 const eSnapMode target_type,
402 const uchar source_color[4],
403 const uchar target_color[4]);
404
405/* `view3d_iterators.cc` */
406
407/* foreach iterators */
408
410 void (*func)(void *user_data,
411 const float screen_co[2],
412 int index),
413 void *user_data,
414 eV3DProjTest clip_flag);
416 const ViewContext *vc,
417 void (*func)(void *user_data, BMVert *eve, const float screen_co[2], int index),
418 void *user_data,
419 eV3DProjTest clip_flag);
421 void (*func)(void *user_data,
422 BMEdge *eed,
423 const float screen_co_a[2],
424 const float screen_co_b[2],
425 int index),
426 void *user_data,
427 eV3DProjTest clip_flag);
428
434 void (*func)(void *user_data,
435 BMEdge *eed,
436 const float screen_co_a[2],
437 const float screen_co_b[2],
438 int index),
439 void *user_data,
440 eV3DProjTest clip_flag);
441
443 const ViewContext *vc,
444 void (*func)(void *user_data, BMFace *efa, const float screen_co[2], int index),
445 void *user_data,
446 eV3DProjTest clip_flag);
448 void (*func)(void *user_data,
449 Nurb *nu,
450 BPoint *bp,
451 BezTriple *bezt,
452 int beztindex,
453 bool handle_visible,
454 const float screen_co[2]),
455 void *user_data,
456 eV3DProjTest clip_flag);
461 void (*func)(void *user_data, MetaElem *ml, const float screen_co[2]),
462 void *user_data,
463 eV3DProjTest clip_flag);
465 void (*func)(void *user_data, BPoint *bp, const float screen_co[2]),
466 void *user_data,
467 eV3DProjTest clip_flag);
472 void (*func)(void *user_data,
473 EditBone *ebone,
474 const float screen_co_a[2],
475 const float screen_co_b[2]),
476 void *user_data,
477 eV3DProjTest clip_flag);
478
483 void (*func)(void *user_data,
484 bPoseChannel *pchan,
485 const float screen_co_a[2],
486 const float screen_co_b[2]),
487 void *user_data,
488 eV3DProjTest clip_flag);
489/* *** end iterators *** */
490
491/* `view3d_project.cc` */
492
497 const float co[3],
498 const float4x4 &mat);
502void ED_view3d_project_float_v3_m4(const ARegion *region,
503 const float co[3],
504 float r_co[3],
505 const float mat[4][4]);
506
507eV3DProjStatus ED_view3d_project_base(const ARegion *region, Base *base, float r_co[2]);
508
509/* *** short *** */
511 float perspmat[4][4],
512 bool is_local,
513 const float co[3],
514 short r_co[2],
515 eV3DProjTest flag);
516/* --- short --- */
518 const float co[3],
519 short r_co[2],
520 eV3DProjTest flag);
521/* object space, use ED_view3d_init_mats_rv3d before calling */
523 const float co[3],
524 short r_co[2],
525 eV3DProjTest flag);
526
527/* *** int *** */
529 float perspmat[4][4],
530 bool is_local,
531 const float co[3],
532 int r_co[2],
533 eV3DProjTest flag);
534/* --- int --- */
536 const float co[3],
537 int r_co[2],
538 eV3DProjTest flag);
539/* object space, use ED_view3d_init_mats_rv3d before calling */
541 const float co[3],
542 int r_co[2],
543 eV3DProjTest flag);
544
545/* *** float *** */
547 float perspmat[4][4],
548 bool is_local,
549 const float co[3],
550 float r_co[2],
551 eV3DProjTest flag);
552/* --- float --- */
554 const float co[3],
555 float r_co[2],
556 eV3DProjTest flag);
561 const float co[3],
562 float r_co[2],
563 eV3DProjTest flag);
564
565float ED_view3d_pixel_size(const RegionView3D *rv3d, const float co[3]);
566float ED_view3d_pixel_size_no_ui_scale(const RegionView3D *rv3d, const float co[3]);
567
578float ED_view3d_calc_zfac_ex(const RegionView3D *rv3d, const float co[3], bool *r_flip);
580float ED_view3d_calc_zfac(const RegionView3D *rv3d, const float co[3]);
584float ED_view3d_calc_depth_for_comparison(const RegionView3D *rv3d, const float co[3]);
585
586bool ED_view3d_clip_segment(const RegionView3D *rv3d, float ray_start[3], float ray_end[3]);
600bool ED_view3d_win_to_ray_clipped(Depsgraph *depsgraph,
601 const ARegion *region,
602 const View3D *v3d,
603 const float mval[2],
604 float r_ray_start[3],
605 float r_ray_normal[3],
606 bool do_clip_planes);
624bool ED_view3d_win_to_ray_clipped_ex(Depsgraph *depsgraph,
625 const ARegion *region,
626 const View3D *v3d,
627 const float mval[2],
628 const bool do_clip_planes,
629 float r_ray_co[3],
630 float r_ray_normal[3],
631 float r_ray_start[3],
632 float r_ray_end[3]);
644void ED_view3d_win_to_ray(const ARegion *region,
645 const float mval[2],
646 float r_ray_start[3],
647 float r_ray_normal[3]);
655void ED_view3d_global_to_vector(const RegionView3D *rv3d, const float coord[3], float r_out[3]);
663void ED_view3d_win_to_3d(const View3D *v3d,
664 const ARegion *region,
665 const float depth_pt[3],
666 const float mval[2],
667 float r_out[3]);
668void ED_view3d_win_to_3d_int(const View3D *v3d,
669 const ARegion *region,
670 const float depth_pt[3],
671 const int mval[2],
672 float r_out[3]);
686 const ARegion *region,
687 const float depth_pt[3],
688 const float mval[2],
689 float r_out[3]);
690bool ED_view3d_win_to_3d_on_plane(const ARegion *region,
691 const float plane[4],
692 const float mval[2],
693 bool do_clip,
694 float r_out[3]);
703 const float plane[4],
704 const float mval[2],
705 bool do_clip,
706 const float plane_fallback[4],
707 float r_out[3]);
709 const ARegion *region, const float plane[4], const int mval[2], bool do_clip, float r_out[3]);
727void ED_view3d_win_to_delta(const ARegion *region,
728 const float xy_delta[2],
729 float zfac,
730 float r_out[3],
731 bool precise = false);
742void ED_view3d_win_to_origin(const ARegion *region, const float mval[2], float r_out[3]);
756void ED_view3d_win_to_vector(const ARegion *region, const float mval[2], float r_out[3]);
771bool ED_view3d_win_to_segment_clipped(const Depsgraph *depsgraph,
772 const ARegion *region,
773 const View3D *v3d,
774 const float mval[2],
775 float r_ray_start[3],
776 float r_ray_end[3],
777 bool do_clip_planes);
780
785void ED_view3d_project_v3(const ARegion *region, const float world[3], float r_region_co[3]);
786void ED_view3d_project_v2(const ARegion *region, const float world[3], float r_region_co[2]);
788 const ARegion *region, float regionx, float regiony, float regionz, float world[3]);
789
790/* end */
791
810Bounds<float> ED_view3d_dist_soft_range_get(const View3D *v3d, bool use_persp_range);
811
822float ED_view3d_dist_soft_min_get(const View3D *v3d, bool use_persp_range);
823
827bool ED_view3d_clip_range_get(const Depsgraph *depsgraph,
828 const View3D *v3d,
829 const RegionView3D *rv3d,
830 bool use_ortho_factor,
831 float *r_clip_start,
832 float *r_clip_end);
833bool ED_view3d_viewplane_get(const Depsgraph *depsgraph,
834 const View3D *v3d,
835 const RegionView3D *rv3d,
836 int winx,
837 int winy,
838 rctf *r_viewplane,
839 float *r_clip_start,
840 float *r_clip_end,
841 float *r_pixsize);
842
846void ED_view3d_polygon_offset(const RegionView3D *rv3d, float dist);
847
849 const Scene *scene, Depsgraph *depsgraph, View3D *v3d, ARegion *region, rcti *r_rect);
850
851void ED_view3d_clipping_calc_from_boundbox(float clip[4][4], const BoundBox *bb, bool is_flip);
853 BoundBox *bb, float planes[4][4], const ARegion *region, const Object *ob, const rcti *rect);
866bool ED_view3d_clipping_clamp_minmax(const RegionView3D *rv3d, float min[3], float max[3]);
867
868void ED_view3d_clipping_local(RegionView3D *rv3d, const float mat[4][4]);
878bool ED_view3d_clipping_test(const RegionView3D *rv3d, const float co[3], bool is_local);
879
880float ED_view3d_radius_to_dist_persp(float angle, float radius);
881float ED_view3d_radius_to_dist_ortho(float lens, float radius);
907float ED_view3d_radius_to_dist(const View3D *v3d,
908 const ARegion *region,
909 const Depsgraph *depsgraph,
911 bool use_aspect,
912 float radius);
913
918int ED_view3d_backbuf_sample_size_clamp(ARegion *region, float dist);
919
921
923bool ED_view3d_autodist_last_check(wmWindow *win, const wmEvent *event);
928bool ED_view3d_autodist_last_get(wmWindow *win, float r_ofs[3]);
930 const wmEvent *event,
931 const float ofs[3],
932 const bool has_depth);
935
944bool ED_view3d_autodist(ARegion *region,
945 View3D *v3d,
946 const int mval[2],
947 float mouse_worldloc[3],
948 const float fallback_depth_pt[3]);
949
954 const int mval[2],
955 float mouse_worldloc[3],
956 int margin,
957 const float *force_depth);
959 const int mval_sta[2],
960 const int mval_end[2],
961 int margin,
962 float *r_depth);
963
968 gpu::Texture *tex = nullptr;
969 ushort4 *data = nullptr;
970 int tex_w, tex_h;
971 rcti valid_rect;
972
973 public:
976
977 bool init(ARegion *region);
978 bool sample(const int mval[2], float r_col[3]);
979};
980
982 /* all elements in the region, ignore depth */
984 /* pick also depth sorts (only for small regions!) */
986 /* sorts and only returns visible objects (only for small regions!) */
988};
989
1003
1008
1010 const View3D *v3d,
1011 const Object *obact);
1012
1020
1024int view3d_gpu_select_ex(const ViewContext *vc,
1025 GPUSelectBuffer *buffer,
1026 const rcti *input,
1027 eV3DSelectMode select_mode,
1028 eV3DSelectObjectFilter select_filter,
1029 eV3DSelectShape select_shape,
1030 bool do_material_slot_selection);
1031int view3d_gpu_select(const ViewContext *vc,
1032 GPUSelectBuffer *buffer,
1033 const rcti *input,
1034 eV3DSelectMode select_mode,
1035 eV3DSelectObjectFilter select_filter,
1036 eV3DSelectShape select_shape);
1037int view3d_gpu_select_with_id_filter(const ViewContext *vc,
1038 GPUSelectBuffer *buffer,
1039 const rcti *input,
1040 eV3DSelectMode select_mode,
1041 eV3DSelectObjectFilter select_filter,
1042 uint select_id);
1043
1044/* `view3d_select.cc` */
1045
1047ViewContext ED_view3d_viewcontext_init(bContext *C, Depsgraph *depsgraph);
1048
1064void ED_view3d_viewcontext_init_object(ViewContext *vc, Object *obact);
1069void view3d_operator_needs_gpu(const bContext *C);
1070void view3d_region_operator_needs_gpu(ARegion *region);
1071
1073bool edge_inside_circle(const float cent[2],
1074 float radius,
1075 const float screen_co_a[2],
1076 const float screen_co_b[2]);
1077
1081RegionView3D *ED_view3d_context_rv3d(bContext *C);
1086bool ED_view3d_context_user_region(bContext *C, View3D **r_v3d, ARegion **r_region);
1091bool ED_view3d_area_user_region(const ScrArea *area, const View3D *v3d, ARegion **r_region);
1092bool ED_operator_rv3d_user_region_poll(bContext *C);
1093
1106void ED_view3d_init_mats_rv3d(const Object *ob, RegionView3D *rv3d);
1107void ED_view3d_init_mats_rv3d_gl(const Object *ob, RegionView3D *rv3d);
1108#ifndef NDEBUG
1112void ED_view3d_clear_mats_rv3d(RegionView3D *rv3d);
1113void ED_view3d_check_mats_rv3d(RegionView3D *rv3d);
1114#else
1115# define ED_view3d_clear_mats_rv3d(rv3d) (void)(rv3d)
1116# define ED_view3d_check_mats_rv3d(rv3d) (void)(rv3d)
1117#endif
1118
1119RV3DMatrixStore *ED_view3d_mats_rv3d_backup(RegionView3D *rv3d);
1120void ED_view3d_mats_rv3d_restore(RegionView3D *rv3d, RV3DMatrixStore *rv3dmat);
1121void ED_view3D_mats_rv3d_free(RV3DMatrixStore *rv3d_mat);
1122
1123RenderEngineType *ED_view3d_engine_type(const Scene *scene, int drawtype);
1124
1125bool ED_view3d_context_activate(bContext *C);
1129void ED_view3d_draw_setup_view(const wmWindowManager *wm,
1130 wmWindow *win,
1131 Depsgraph *depsgraph,
1132 Scene *scene,
1133 ARegion *region,
1134 View3D *v3d,
1135 const float viewmat[4][4],
1136 const float winmat[4][4],
1137 const rcti *rect);
1138
1142Base *ED_view3d_give_base_under_cursor(bContext *C, const int mval[2]);
1143Object *ED_view3d_give_object_under_cursor(bContext *C, const int mval[2]);
1145 const int mval[2],
1146 int *r_material_slot);
1147bool ED_view3d_is_object_under_cursor(bContext *C, const int mval[2]);
1151void ED_view3d_quadview_update(ScrArea *area, ARegion *region, bool do_clip);
1155void ED_view3d_update_viewmat(const Depsgraph *depsgraph,
1156 const Scene *scene,
1157 View3D *v3d,
1158 ARegion *region,
1159 const float viewmat[4][4],
1160 const float winmat[4][4],
1161 const rcti *rect,
1162 bool offscreen);
1164 eRegionView3D_ViewAxisRoll view_axis_roll,
1165 float r_quat[4]);
1166bool ED_view3d_quat_to_axis_view(const float quat[4],
1167 float epsilon,
1168 eRegionView3D_View *r_view,
1169 eRegionView3D_ViewAxisRoll *r_view_axis_roll);
1177 float epsilon,
1178 eRegionView3D_View *r_view,
1179 eRegionView3D_ViewAxisRoll *r_view_axis_roll);
1180
1183bool ED_view3d_lock(RegionView3D *rv3d);
1184
1195
1197
1198void ED_view3d_datamask(const Main &bmain,
1199 const Scene *scene,
1200 ViewLayer *view_layer,
1201 const View3D *v3d,
1202 CustomData_MeshMasks *r_cddata_masks);
1206void ED_view3d_screen_datamask(const Main &bmain,
1207 const Scene *scene,
1208 ViewLayer *view_layer,
1209 const bScreen *screen,
1210 CustomData_MeshMasks *r_cddata_masks);
1211
1212bool ED_view3d_offset_lock_check(const View3D *v3d, const RegionView3D *rv3d);
1220void ED_view3d_persp_switch_from_camera(const Depsgraph *depsgraph,
1221 View3D *v3d,
1222 RegionView3D *rv3d,
1223 eRegionView3D_Persp persp);
1230bool ED_view3d_persp_ensure(const Depsgraph *depsgraph, View3D *v3d, ARegion *region);
1231
1232/* Camera view functions. */
1233
1238bool ED_view3d_camera_view_zoom_scale(RegionView3D *rv3d, const float scale);
1244bool ED_view3d_camera_view_pan(ARegion *region, const float event_ofs[2]);
1245
1246/* Camera lock functions */
1247
1251bool ED_view3d_camera_lock_check(const View3D *v3d, const RegionView3D *rv3d);
1258void ED_view3d_camera_lock_init_ex(const Depsgraph *depsgraph,
1259 View3D *v3d,
1260 RegionView3D *rv3d,
1261 bool calc_dist);
1262void ED_view3d_camera_lock_init(const Depsgraph *depsgraph, View3D *v3d, RegionView3D *rv3d);
1270bool ED_view3d_camera_lock_sync(const Depsgraph *depsgraph, View3D *v3d, RegionView3D *rv3d);
1271
1273 const Scene *scene, ID *id_key, bContext *C, bool do_rotate, bool do_translate);
1281 View3D *v3d, RegionView3D *rv3d, bContext *C, bool do_rotate, bool do_translate);
1282
1283void ED_view3d_lock_clear(View3D *v3d);
1284
1289bool ED_view3d_camera_lock_undo_test(const View3D *v3d, const RegionView3D *rv3d, bContext *C);
1290
1297bool ED_view3d_camera_lock_undo_push(const char *str,
1298 const View3D *v3d,
1299 const RegionView3D *rv3d,
1300 bContext *C);
1301
1309 const View3D *v3d,
1310 const RegionView3D *rv3d,
1311 bContext *C);
1312
1313#define VIEW3D_MARGIN 1.4f
1314#define VIEW3D_DIST_FALLBACK 1.0f
1315
1328float ED_view3d_offset_distance(const float mat[4][4], const float ofs[3], float fallback_dist);
1334void ED_view3d_distance_set(RegionView3D *rv3d, float dist);
1342bool ED_view3d_distance_set_from_location(RegionView3D *rv3d,
1343 const float dist_co[3],
1344 float dist_min);
1345
1349float ED_scene_grid_scale(const Scene *scene, const char **r_grid_unit);
1350float ED_view3d_grid_scale(const Scene *scene, const View3D *v3d, const char **r_grid_unit);
1351void ED_view3d_grid_steps(const Scene *scene,
1352 const View3D *v3d,
1353 const RegionView3D *rv3d,
1354 float r_grid_steps[8]);
1360float ED_view3d_grid_view_scale(const Scene *scene,
1361 const View3D *v3d,
1362 const ARegion *region,
1363 const char **r_grid_unit);
1364
1369void ED_scene_draw_fps(const Scene *scene, int xoffset, int *yoffset);
1370
1371/* Render */
1372
1374void ED_view3d_shade_update(Main *bmain, View3D *v3d, ScrArea *area);
1375
1376#define SHADING_XRAY_ALPHA(shading) \
1377 (((shading).type == OB_WIRE) ? (shading).xray_alpha_wire : (shading).xray_alpha)
1378#define SHADING_XRAY_FLAG(shading) \
1379 (((shading).type == OB_WIRE) ? V3D_SHADING_XRAY_WIREFRAME : V3D_SHADING_XRAY)
1380#define SHADING_XRAY_FLAG_ENABLED(shading) (((shading).flag & SHADING_XRAY_FLAG(shading)) != 0)
1381#define SHADING_XRAY_ENABLED(shading) \
1382 (SHADING_XRAY_FLAG_ENABLED(shading) && (SHADING_XRAY_ALPHA(shading) < 1.0f))
1383#define SHADING_XRAY_ACTIVE(shading) \
1384 (SHADING_XRAY_ENABLED(shading) && ((shading).type < OB_MATERIAL))
1385
1386#define XRAY_ALPHA(v3d) SHADING_XRAY_ALPHA((v3d)->shading)
1387#define XRAY_FLAG(v3d) SHADING_XRAY_FLAG((v3d)->shading)
1388#define XRAY_FLAG_ENABLED(v3d) SHADING_XRAY_FLAG_ENABLED((v3d)->shading)
1396#define XRAY_ENABLED(v3d) SHADING_XRAY_ENABLED((v3d)->shading)
1397#define XRAY_ACTIVE(v3d) SHADING_XRAY_ACTIVE((v3d)->shading)
1398
1399#define OVERLAY_RETOPOLOGY_ENABLED(overlay) \
1400 (((overlay).edit_flag & V3D_OVERLAY_EDIT_RETOPOLOGY) != 0)
1401#ifdef __APPLE__
1402/* Apple silicon tile depth test requires a higher value to reduce drawing artifacts. */
1403# define OVERLAY_RETOPOLOGY_MIN_OFFSET 0.0015f
1404#else
1405# define OVERLAY_RETOPOLOGY_MIN_OFFSET FLT_EPSILON
1406#endif
1407
1408#define OVERLAY_RETOPOLOGY_OFFSET(overlay) \
1409 (OVERLAY_RETOPOLOGY_ENABLED(overlay) ? \
1410 max_ff((overlay).retopology_offset, OVERLAY_RETOPOLOGY_MIN_OFFSET) : \
1411 0.0f)
1412
1413#define RETOPOLOGY_ENABLED(v3d) (OVERLAY_RETOPOLOGY_ENABLED((v3d)->overlay))
1414#define RETOPOLOGY_OFFSET(v3d) (OVERLAY_RETOPOLOGY_OFFSET((v3d)->overlay))
1415
1416/* `view3d_gizmo_preselect_type.cc` */
1417
1418void ED_view3d_gizmo_mesh_preselect_get_active(const bContext *C,
1419 const wmGizmo *gz,
1420 Base **r_base,
1421 BMElem **r_ele);
1422void ED_view3d_gizmo_mesh_preselect_clear(wmGizmo *gz);
1423
1424/* view3d_gizmo_ruler.cc */
1425
1429void ED_view3d_gizmo_ruler_remove_by_gpencil_layer(struct bContext *C, bGPDlayer *gpl);
1430
1431/* `space_view3d.cc` */
1432
1433void ED_view3d_buttons_region_layout_ex(const bContext *C,
1434 ARegion *region,
1435 const char *category_override);
1436
1437std::array<const char *, 4> ED_view3d_buttons_contexts(const bContext *C);
1438
1439/* `view3d_view.cc` */
1440
1453bool ED_localview_exit_if_empty(const Depsgraph *depsgraph,
1454 Scene *scene,
1455 ViewLayer *view_layer,
1456 wmWindowManager *wm,
1457 wmWindow *win,
1458 View3D *v3d,
1459 ScrArea *area,
1460 bool frame_selected = true,
1461 int smooth_viewtx = 0);
1466bool ED_view3d_local_collections_set(const Main *bmain, View3D *v3d);
1467void ED_view3d_local_collections_reset(const bContext *C, bool reset_all);
1468
1469#ifdef WITH_XR_OPENXR
1470void ED_view3d_xr_mirror_update(const ScrArea *area, const View3D *v3d, bool enable);
1471void ED_view3d_xr_shading_update(wmWindowManager *wm, const View3D *v3d, const Scene *scene);
1472bool ED_view3d_is_region_xr_mirror_active(const wmWindowManager *wm,
1473 const View3D *v3d,
1474 const ARegion *region);
1475#endif
1476
1477} // namespace blender
#define ENUM_OPERATORS(_enum_type)
#define C
Definition RandGen.cpp:29
btScalar max
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
Definition btVector3.h:356
Definition scene.h:133
bool sample(const int mval[2], float r_col[3])
#define str(s)
#define index(i)
float3x3 scale(float3x3 mat, float2 scale)
const int state
ENUM_OPERATORS(Layer::Flags)
BMesh Iterators.
bool ED_view3d_context_user_region(bContext *C, View3D **r_v3d, ARegion **r_region)
eV3DProjStatus ED_view3d_project_int_global(const ARegion *region, const float co[3], int r_co[2], eV3DProjTest flag)
bool ED_view3d_camera_lock_autokey(View3D *v3d, RegionView3D *rv3d, bContext *C, bool do_rotate, bool do_translate)
bool ED_view3d_viewplane_get(const Depsgraph *depsgraph, const View3D *v3d, const RegionView3D *rv3d, int winx, int winy, rctf *r_viewplane, float *r_clip_start, float *r_clip_end, float *r_pixsize)
bool ED_view3d_depth_read_cached_seg(const ViewDepths *vd, const int mval_sta[2], const int mval_end[2], int margin, float *r_depth)
@ V3D_PROJ_RET_OVERFLOW
Definition ED_view3d.hh:290
@ V3D_PROJ_RET_CLIP_FAR
Definition ED_view3d.hh:277
@ V3D_PROJ_RET_CLIP_ZERO
Definition ED_view3d.hh:284
@ V3D_PROJ_RET_CLIP_BB
Definition ED_view3d.hh:286
@ V3D_PROJ_RET_CLIP_WIN
Definition ED_view3d.hh:288
@ V3D_PROJ_RET_OK
Definition ED_view3d.hh:273
@ V3D_PROJ_RET_CLIP_NEAR
Definition ED_view3d.hh:275
bool ED_view3d_quat_to_axis_view_and_reset_quat(float quat[4], float epsilon, eRegionView3D_View *r_view, eRegionView3D_ViewAxisRoll *r_view_axis_roll)
bool ED_view3d_camera_to_view_selected(Main *bmain, Depsgraph *depsgraph, const Scene *scene, Object *camera_ob)
ViewOpsData * ED_view3d_navigation_init(bContext *C, const wmKeyMapItem *kmi_merge)
bool ED_view3d_camera_lock_check(const View3D *v3d, const RegionView3D *rv3d)
void view3d_gpu_select_cache_end()
void ED_view3d_clipping_local(RegionView3D *rv3d, const float mat[4][4])
void ED_view3d_win_to_ray(const ARegion *region, const float mval[2], float r_ray_start[3], float r_ray_normal[3])
bool ED_view3d_clipping_clamp_minmax(const RegionView3D *rv3d, float min[3], float max[3])
bool ED_view3d_local_collections_set(const Main *bmain, View3D *v3d)
V3DSnapCursorState * ED_view3d_cursor_snap_state_create()
void ED_view3d_gizmo_mesh_preselect_get_active(const bContext *C, const wmGizmo *gz, Base **r_base, BMElem **r_ele)
void ED_view3d_win_to_3d_with_shift(const View3D *v3d, const ARegion *region, const float depth_pt[3], const float mval[2], float r_out[3])
bool ED_operator_rv3d_user_region_poll(bContext *C)
void ED_view3d_background_color_get(const Scene *scene, const View3D *v3d, float r_color[3])
ViewContext ED_view3d_viewcontext_init(bContext *C, Depsgraph *depsgraph)
unsigned int uint
Definition BKE_text.h:55
void ED_view3d_win_to_origin(const ARegion *region, const float mval[2], float r_out[3])
bool ED_view3d_camera_lock_undo_grouped_push(const char *str, const View3D *v3d, const RegionView3D *rv3d, bContext *C)
void ED_view3d_cursor3d_position_rotation(bContext *C, const int mval[2], bool use_depth, enum eV3DCursorOrient orientation, float r_cursor_co[3], float r_cursor_quat[4])
void ED_view3d_depths_free(ViewDepths *depths)
void ED_view3d_clear_mats_rv3d(RegionView3D *rv3d)
V3DSnapCursorState * ED_view3d_cursor_snap_state_active_get()
bool ED_view3d_win_to_3d_on_plane_int(const ARegion *region, const float plane[4], const int mval[2], bool do_clip, float r_out[3])
bool ED_view3d_autodist_last_get(wmWindow *win, float r_ofs[3])
void ED_view3d_distance_set(RegionView3D *rv3d, float dist)
eV3DProjStatus ED_view3d_project_float_object(const ARegion *region, const float co[3], float r_co[2], eV3DProjTest flag)
float4x4 ED_view3d_ob_project_mat_get(const RegionView3D *rv3d, const Object *ob)
eV3DProjStatus ED_view3d_project_short_global(const ARegion *region, const float co[3], short r_co[2], eV3DProjTest flag)
float ED_view3d_pixel_size(const RegionView3D *rv3d, const float co[3])
bool ED_view3d_camera_view_zoom_scale(RegionView3D *rv3d, const float scale)
float ED_view3d_radius_to_dist(const View3D *v3d, const ARegion *region, const Depsgraph *depsgraph, eRegionView3D_Persp persp, bool use_aspect, float radius)
bool ED_view3d_win_to_ray_clipped_ex(Depsgraph *depsgraph, const ARegion *region, const View3D *v3d, const float mval[2], const bool do_clip_planes, float r_ray_co[3], float r_ray_normal[3], float r_ray_start[3], float r_ray_end[3])
eV3DProjStatus ED_view3d_project_short_object(const ARegion *region, const float co[3], short r_co[2], eV3DProjTest flag)
bool ED_view3d_persp_ensure(const Depsgraph *depsgraph, View3D *v3d, ARegion *region)
void ED_view3d_polygon_offset(const RegionView3D *rv3d, float dist)
void ED_view3d_cursor3d_position(bContext *C, const int mval[2], bool use_depth, float r_cursor_co[3])
Object * ED_view3d_give_material_slot_under_cursor(bContext *C, const int mval[2], int *r_material_slot)
void armature_foreachScreenBone(const ViewContext *vc, void(*func)(void *user_data, EditBone *ebone, const float screen_co_a[2], const float screen_co_b[2]), void *user_data, eV3DProjTest clip_flag)
bool ED_view3d_camera_lock_sync(const Depsgraph *depsgraph, View3D *v3d, RegionView3D *rv3d)
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)
bool ED_view3d_camera_lock_undo_push(const char *str, const View3D *v3d, const RegionView3D *rv3d, bContext *C)
bool ED_view3d_quat_to_axis_view(const float quat[4], float epsilon, eRegionView3D_View *r_view, eRegionView3D_ViewAxisRoll *r_view_axis_roll)
float2 ED_view3d_project_float_v2_m4(const ARegion *region, const float co[3], const float4x4 &mat)
void ED_view3d_grid_steps(const Scene *scene, const View3D *v3d, const RegionView3D *rv3d, float r_grid_steps[8])
void ED_view3d_persp_switch_from_camera(const Depsgraph *depsgraph, View3D *v3d, RegionView3D *rv3d, eRegionView3D_Persp persp)
void view3d_operator_needs_gpu(const bContext *C)
RenderEngineType * ED_view3d_engine_type(const Scene *scene, int drawtype)
bool ED_view3d_autodist_last_check(wmWindow *win, const wmEvent *event)
void mesh_foreachScreenEdge_clip_bb_segment(const ViewContext *vc, void(*func)(void *user_data, BMEdge *eed, const float screen_co_a[2], const float screen_co_b[2], int index), void *user_data, eV3DProjTest clip_flag)
bool ED_view3d_has_workbench_in_texture_color(const Scene *scene, const Object *ob, const View3D *v3d)
bool ED_view3d_distance_set_from_location(RegionView3D *rv3d, const float dist_co[3], float dist_min)
void ED_view3d_project_v2(const ARegion *region, const float world[3], float r_region_co[2])
void mball_foreachScreenElem(const ViewContext *vc, void(*func)(void *user_data, MetaElem *ml, const float screen_co[2]), void *user_data, eV3DProjTest clip_flag)
MatBase< float, 4, 4 > float4x4
RegionView3D * ED_view3d_context_rv3d(bContext *C)
bool ED_view3d_camera_autokey(const Scene *scene, ID *id_key, bContext *C, bool do_rotate, bool do_translate)
void ED_view3d_autodist_last_clear(wmWindow *win)
void ED_view3d_global_to_vector(const RegionView3D *rv3d, const float coord[3], float r_out[3])
bool ED_view3d_navigation_do(bContext *C, ViewOpsData *vod, const wmEvent *event, const float depth_loc_override[3])
eRegionView3D_View ED_view3d_axis_view_opposite(eRegionView3D_View view)
void view3d_gpu_select_cache_begin()
bool ED_view3d_unproject_v3(const ARegion *region, float regionx, float regiony, float regionz, float world[3])
float ED_view3d_dist_soft_min_get(const View3D *v3d, bool use_persp_range)
eV3DSelectObjectFilter
Definition ED_view3d.hh:990
@ VIEW3D_SELECT_FILTER_NOP
Definition ED_view3d.hh:992
@ VIEW3D_SELECT_FILTER_WPAINT_POSE_MODE_LOCK
@ VIEW3D_SELECT_FILTER_OBJECT_MODE_LOCK
Definition ED_view3d.hh:994
@ VIEW3D_SELECT_FILTER_OBJECT_MODE_LOCK_SAME_TYPE
Definition ED_view3d.hh:999
void ED_view3d_gizmo_ruler_remove_by_gpencil_layer(struct bContext *C, bGPDlayer *gpl)
V3DSnapCursorData * ED_view3d_cursor_snap_data_get()
void ED_view3d_cursor_snap_state_default_set(V3DSnapCursorState *state)
void ED_view3d_viewcontext_init_object(ViewContext *vc, Object *obact)
void ED_view3d_lock_clear(View3D *v3d)
Base * ED_view3d_give_base_under_cursor(bContext *C, const int mval[2])
void pose_foreachScreenBone(const ViewContext *vc, void(*func)(void *user_data, bPoseChannel *pchan, const float screen_co_a[2], const float screen_co_b[2]), void *user_data, eV3DProjTest clip_flag)
bool ED_view3d_clip_segment(const RegionView3D *rv3d, float ray_start[3], float ray_end[3])
bool ED_view3d_autodist(ARegion *region, View3D *v3d, const int mval[2], float mouse_worldloc[3], const float fallback_depth_pt[3])
eV3DProjStatus ED_view3d_project_base(const ARegion *region, Base *base, float r_co[2])
void ED_view3d_cursor_snap_state_free(V3DSnapCursorState *state)
VecBase< int32_t, 2 > int2
void ED_view3d_mats_rv3d_restore(RegionView3D *rv3d, RV3DMatrixStore *rv3dmat)
VecBase< float, 2 > float2
ed::transform::SnapObjectContext * ED_view3d_cursor_snap_context_ensure(Scene *scene)
unsigned char uchar
Definition BKE_text.h:58
void ED_scene_draw_fps(const Scene *scene, int xoffset, int *yoffset)
eV3DProjStatus ED_view3d_project_int_object(const ARegion *region, const float co[3], int r_co[2], eV3DProjTest flag)
bool ED_view3d_camera_lock_undo_test(const View3D *v3d, const RegionView3D *rv3d, bContext *C)
@ V3D_SNAPCURSOR_SNAP_EDIT_GEOM_CAGE
Definition ED_view3d.hh:350
@ V3D_SNAPCURSOR_OCCLUSION_ALWAYS_FALSE
Definition ED_view3d.hh:348
@ V3D_SNAPCURSOR_TOGGLE_ALWAYS_TRUE
Definition ED_view3d.hh:346
@ V3D_SNAPCURSOR_SNAP_EDIT_GEOM_FINAL
Definition ED_view3d.hh:349
@ V3D_SNAPCURSOR_OCCLUSION_ALWAYS_TRUE
Definition ED_view3d.hh:347
bool ED_view3d_win_to_3d_on_plane(const ARegion *region, const float plane[4], const float mval[2], bool do_clip, float r_out[3])
void ED_view3D_mats_rv3d_free(RV3DMatrixStore *rv3d_mat)
void meshobject_foreachScreenVert(const ViewContext *vc, void(*func)(void *user_data, const float screen_co[2], int index), void *user_data, eV3DProjTest clip_flag)
eV3DProjStatus ED_view3d_project_int_ex(const ARegion *region, float perspmat[4][4], bool is_local, const float co[3], int r_co[2], eV3DProjTest flag)
void ED_view3d_cursor_snap_draw_util(RegionView3D *rv3d, const float source_loc[3], const float target_loc[3], const eSnapMode source_type, const eSnapMode target_type, const uchar source_color[4], const uchar target_color[4])
eV3DSelectObjectFilter ED_view3d_select_filter_from_mode(const Scene *scene, const View3D *v3d, const Object *obact)
@ VIEW3D_SELECT_PICK_NEAREST
Definition ED_view3d.hh:987
@ VIEW3D_SELECT_PICK_ALL
Definition ED_view3d.hh:985
@ VIEW3D_SELECT_ALL
Definition ED_view3d.hh:983
bool ED_view3d_context_activate(bContext *C)
bool ED_view3d_camera_view_pan(ARegion *region, const float event_ofs[2])
bool ED_view3d_calc_render_border(const Scene *scene, Depsgraph *depsgraph, View3D *v3d, ARegion *region, rcti *r_rect)
eV3DProjStatus ED_view3d_project_float_global(const ARegion *region, const float co[3], float r_co[2], eV3DProjTest flag)
void ED_view3d_project_float_v3_m4(const ARegion *region, const float co[3], float r_co[3], const float mat[4][4])
float ED_view3d_radius_to_dist_persp(float angle, float radius)
float ED_view3d_grid_view_scale(const Scene *scene, const View3D *v3d, const ARegion *region, const char **r_grid_unit)
void ED_view3d_win_to_vector(const ARegion *region, const float mval[2], float r_out[3])
void ED_view3d_cursor3d_update(bContext *C, const int mval[2], bool use_depth, enum eV3DCursorOrient orientation)
void ED_view3d_camera_lock_init(const Depsgraph *depsgraph, View3D *v3d, RegionView3D *rv3d)
bool ED_view3d_snap_selected_to_location(bContext *C, wmOperator *op, const float target_loc_global[3], int pivot_point)
float ED_scene_grid_scale(const Scene *scene, const char **r_grid_unit)
float ED_view3d_grid_scale(const Scene *scene, const View3D *v3d, const char **r_grid_unit)
void ED_view3d_init_mats_rv3d_gl(const Object *ob, RegionView3D *rv3d)
void ED_view3d_cursor_snap_data_update(V3DSnapCursorState *state, const bContext *C, const ARegion *region, const int2 &mval)
float ED_view3d_calc_zfac(const RegionView3D *rv3d, const float co[3])
void ED_view3d_stop_render_preview(wmWindowManager *wm, ARegion *region)
eRegionView3D_View ED_view3d_lock_view_from_index(int index)
void ED_view3d_project_v3(const ARegion *region, const float world[3], float r_region_co[3])
void ED_view3d_init_mats_rv3d(const Object *ob, RegionView3D *rv3d)
void ED_view3d_datamask(const Main &bmain, const Scene *scene, ViewLayer *view_layer, const View3D *v3d, CustomData_MeshMasks *r_cddata_masks)
eV3DProjStatus ED_view3d_project_short_ex(const ARegion *region, float perspmat[4][4], bool is_local, const float co[3], short r_co[2], eV3DProjTest flag)
bool ED_view3d_autodist_simple(ARegion *region, const int mval[2], float mouse_worldloc[3], int margin, const float *force_depth)
void ED_view3d_quadview_update(ScrArea *area, ARegion *region, bool do_clip)
bool ED_view3d_has_depth_buffer_updated(const Depsgraph *depsgraph, const View3D *v3d)
int view3d_gpu_select_with_id_filter(const ViewContext *vc, GPUSelectBuffer *buffer, const rcti *input, eV3DSelectMode select_mode, eV3DSelectObjectFilter select_filter, uint select_id)
Camera * ED_view3d_camera_data_get(View3D *v3d, RegionView3D *rv3d)
void ED_view3d_to_m4(float mat[4][4], const float ofs[3], const float quat[4], float dist, float roll)
Bounds< float > ED_view3d_dist_soft_range_get(const View3D *v3d, bool use_persp_range)
bool ED_view3d_clip_range_get(const Depsgraph *depsgraph, const View3D *v3d, const RegionView3D *rv3d, bool use_ortho_factor, float *r_clip_start, float *r_clip_end)
@ V3D_CURSOR_ORIENT_XFORM
Definition ED_view3d.hh:103
@ V3D_CURSOR_ORIENT_NONE
Definition ED_view3d.hh:101
@ V3D_CURSOR_ORIENT_VIEW
Definition ED_view3d.hh:102
@ V3D_CURSOR_ORIENT_GEOM
Definition ED_view3d.hh:104
void ED_view3d_buttons_region_layout_ex(const bContext *C, ARegion *region, const char *category_override)
void mesh_foreachScreenVert(const ViewContext *vc, void(*func)(void *user_data, BMVert *eve, const float screen_co[2], int index), void *user_data, eV3DProjTest clip_flag)
void ED_view3d_cursor_snap_state_prevpoint_set(V3DSnapCursorState *state, const float prev_point[3])
void ED_view3d_select_id_validate(const ViewContext *vc)
bool ED_localview_exit_if_empty(const Depsgraph *depsgraph, Scene *scene, ViewLayer *view_layer, wmWindowManager *wm, wmWindow *win, View3D *v3d, ScrArea *area, bool frame_selected=true, int smooth_viewtx=0)
RV3DMatrixStore * ED_view3d_mats_rv3d_backup(RegionView3D *rv3d)
bool ED_view3d_offset_lock_check(const View3D *v3d, const RegionView3D *rv3d)
void mesh_foreachScreenEdge(const ViewContext *vc, void(*func)(void *user_data, BMEdge *eed, const float screen_co_a[2], const float screen_co_b[2], int index), void *user_data, eV3DProjTest clip_flag)
bool edge_inside_circle(const float cent[2], float radius, const float screen_co_a[2], const float screen_co_b[2])
bool ED_view3d_lock(RegionView3D *rv3d)
eV3DProjStatus ED_view3d_project_float_ex(const ARegion *region, float perspmat[4][4], bool is_local, const float co[3], float r_co[2], eV3DProjTest flag)
bool ED_view3d_clipping_test(const RegionView3D *rv3d, const float co[3], bool is_local)
float ED_view3d_pixel_size_no_ui_scale(const RegionView3D *rv3d, const float co[3])
bool ED_view3d_camera_to_view_selected_with_set_clipping(Main *bmain, Depsgraph *depsgraph, const Scene *scene, Object *camera_ob)
void ED_view3d_autodist_last_set(wmWindow *win, const wmEvent *event, const float ofs[3], const bool has_depth)
void ED_view3d_clipping_calc(BoundBox *bb, float planes[4][4], const ARegion *region, const Object *ob, const rcti *rect)
bool ED_view3d_win_to_segment_clipped(const Depsgraph *depsgraph, const ARegion *region, const View3D *v3d, const float mval[2], float r_ray_start[3], float r_ray_end[3], bool do_clip_planes)
bool ED_view3d_win_to_ray_clipped(Depsgraph *depsgraph, const ARegion *region, const View3D *v3d, const float mval[2], float r_ray_start[3], float r_ray_normal[3], bool do_clip_planes)
int ED_view3d_backbuf_sample_size_clamp(ARegion *region, float dist)
std::array< const char *, 4 > ED_view3d_buttons_contexts(const bContext *C)
void ED_view3d_depth_override(Depsgraph *depsgraph, ARegion *region, View3D *v3d, Object *obact, eV3DDepthOverrideMode mode, bool use_overlay, ViewDepths **r_depths)
void ED_view3d_camera_lock_init_ex(const Depsgraph *depsgraph, View3D *v3d, RegionView3D *rv3d, bool calc_dist)
bool ED_view3d_depth_read_cached(const ViewDepths *vd, const int mval[2], int margin, float *r_depth)
float ED_view3d_calc_zfac_ex(const RegionView3D *rv3d, const float co[3], bool *r_flip)
@ V3D_PROJ_TEST_CLIP_FAR
Definition ED_view3d.hh:299
@ V3D_PROJ_TEST_CLIP_ZERO
Definition ED_view3d.hh:300
@ V3D_PROJ_TEST_CLIP_CONTENT
Definition ED_view3d.hh:321
@ V3D_PROJ_TEST_NOP
Definition ED_view3d.hh:295
@ V3D_PROJ_TEST_CLIP_NEAR
Definition ED_view3d.hh:298
@ V3D_PROJ_TEST_CLIP_WIN
Definition ED_view3d.hh:297
@ V3D_PROJ_TEST_CLIP_BB
Definition ED_view3d.hh:296
void ED_view3d_cursor_snap_state_active_set(V3DSnapCursorState *state)
eV3DDepthOverrideMode
Definition ED_view3d.hh:205
@ V3D_DEPTH_ALL
Definition ED_view3d.hh:207
@ V3D_DEPTH_OBJECT_ONLY
Definition ED_view3d.hh:213
@ V3D_DEPTH_GPENCIL_ONLY
Definition ED_view3d.hh:211
@ V3D_DEPTH_NO_GPENCIL
Definition ED_view3d.hh:209
@ V3D_DEPTH_SELECTED_ONLY
Definition ED_view3d.hh:215
bool ED_view3d_depth_read_cached_normal(const ARegion *region, const ViewDepths *depths, const int mval[2], float r_normal[3])
float4x4 ED_view3d_ob_project_mat_get_from_obmat(const RegionView3D *rv3d, const float4x4 &obmat)
Object * ED_view3d_give_object_under_cursor(bContext *C, const int mval[2])
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])
void ED_view3d_clipping_calc_from_boundbox(float clip[4][4], const BoundBox *bb, bool is_flip)
void ED_view3d_lastview_store(RegionView3D *rv3d)
bool ED_view3d_win_to_3d_on_plane_with_fallback(const ARegion *region, const float plane[4], const float mval[2], bool do_clip, const float plane_fallback[4], float r_out[3])
void mesh_foreachScreenFace(const ViewContext *vc, void(*func)(void *user_data, BMFace *efa, const float screen_co[2], int index), void *user_data, eV3DProjTest clip_flag)
void ED_view3d_check_mats_rv3d(RegionView3D *rv3d)
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)
int view3d_gpu_select_ex(const ViewContext *vc, GPUSelectBuffer *buffer, const rcti *input, eV3DSelectMode select_mode, eV3DSelectObjectFilter select_filter, eV3DSelectShape select_shape, bool do_material_slot_selection)
bool ED_view3d_depth_unproject_v3(const ARegion *region, const int mval[2], double depth, float r_location_world[3])
bool ED_view3d_quat_from_axis_view(eRegionView3D_View view, eRegionView3D_ViewAxisRoll view_axis_roll, float r_quat[4])
void ED_view3d_navigation_free(bContext *C, ViewOpsData *vod)
bool ED_view3d_area_user_region(const ScrArea *area, const View3D *v3d, ARegion **r_region)
eRegionView3D_ViewFlipRoll
VecBase< uint16_t, 4 > ushort4
void ED_view3d_to_object(const Depsgraph *depsgraph, Object *ob, const float ofs[3], const float quat[4], float dist, float roll)
float ED_view3d_radius_to_dist_ortho(float lens, float radius)
float ED_view3d_select_dist_px()
void ED_view3d_text_colors_get(const Scene *scene, const View3D *v3d, float r_text_color[4], float r_shadow_color[4])
void ED_view3d_win_to_3d(const View3D *v3d, const ARegion *region, const float depth_pt[3], const float mval[2], float r_out[3])
void ED_view3d_from_object(const Object *ob, float ofs[3], float quat[4], const float *dist, float roll, float *r_lens)
void nurbs_foreachScreenVert(const ViewContext *vc, void(*func)(void *user_data, Nurb *nu, BPoint *bp, BezTriple *bezt, int beztindex, bool handle_visible, const float screen_co[2]), void *user_data, eV3DProjTest clip_flag)
void view3d_region_operator_needs_gpu(ARegion *region)
void ED_view3d_screen_datamask(const Main &bmain, const Scene *scene, ViewLayer *view_layer, const bScreen *screen, CustomData_MeshMasks *r_cddata_masks)
int view3d_gpu_select(const ViewContext *vc, GPUSelectBuffer *buffer, const rcti *input, eV3DSelectMode select_mode, eV3DSelectObjectFilter select_filter, eV3DSelectShape select_shape)
void ED_view3d_local_collections_reset(const bContext *C, bool reset_all)
eRegionView3D_ViewFlipRoll ED_view3d_effective_flip_axis(const RegionView3D *rv3d)
void ED_view3d_from_m4(const float mat[4][4], float ofs[3], float quat[4], const float *dist, float roll)
void ED_view3d_win_to_delta(const ARegion *region, const float xy_delta[2], float zfac, float r_out[3], bool precise=false)
signed char int8_t
Definition BKE_text.h:76
bool ED_view3d_is_object_under_cursor(bContext *C, const int mval[2])
void lattice_foreachScreenVert(const ViewContext *vc, void(*func)(void *user_data, BPoint *bp, const float screen_co[2]), void *user_data, eV3DProjTest clip_flag)
void ED_view3d_shade_update(Main *bmain, View3D *v3d, ScrArea *area)
void ED_view3d_gizmo_mesh_preselect_clear(wmGizmo *gz)
float ED_view3d_calc_depth_for_comparison(const RegionView3D *rv3d, const float co[3])
float ED_view3d_offset_distance(const float mat[4][4], const float ofs[3], float fallback_dist)
#define min(a, b)
Definition sort.cc:38
bool(*) poll(ARegion *region, void *custom_poll_data)
Definition ED_view3d.hh:380
ViewLayer * view_layer
Definition ED_view3d.hh:80
RegionView3D * rv3d
Definition ED_view3d.hh:86
BMEditMesh * em
Definition ED_view3d.hh:87
Depsgraph * depsgraph
Definition ED_view3d.hh:78
unsigned short w
Definition ED_view3d.hh:92
unsigned short h
Definition ED_view3d.hh:92
double depth_range[2]
Definition ED_view3d.hh:96