Blender  V3.3
ED_view3d.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2008 Blender Foundation. All rights reserved. */
3 
8 #pragma once
9 
10 #include "BLI_utildefines.h"
11 #include "DNA_scene_types.h"
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 /* ********* exports for space_view3d/ module ********** */
18 struct ARegion;
19 struct BMEdge;
20 struct BMElem;
21 struct BMFace;
22 struct BMVert;
23 struct BPoint;
24 struct Base;
25 struct BezTriple;
26 struct BoundBox;
27 struct Camera;
29 struct Depsgraph;
30 struct EditBone;
31 struct GPUSelectResult;
32 struct ID;
33 struct MVert;
34 struct Main;
35 struct MetaElem;
36 struct Nurb;
37 struct Object;
38 struct RV3DMatrixStore;
39 struct RegionView3D;
40 struct RenderEngineType;
41 struct Scene;
42 struct ScrArea;
43 struct SnapObjectContext;
44 struct View3D;
45 struct ViewContext;
46 struct ViewLayer;
47 struct bContext;
48 struct bPoseChannel;
49 struct bScreen;
50 struct rctf;
51 struct rcti;
52 struct wmGizmo;
53 struct wmWindow;
54 struct wmWindowManager;
55 
56 /* for derivedmesh drawing callbacks, for view3d_select, .... */
57 typedef struct ViewContext {
58  struct bContext *C;
59  struct Main *bmain;
60  /* Dependency graph is uses for depth drawing, viewport camera matrix access, and also some areas
61  * are re-using this to access evaluated entities.
62  *
63  * Moral of the story: assign to a fully evaluated state. */
65  struct Scene *scene;
67  struct Object *obact;
68  struct Object *obedit;
69  struct ARegion *region;
70  struct View3D *v3d;
71  struct wmWindow *win;
72  struct RegionView3D *rv3d;
73  struct BMEditMesh *em;
74  int mval[2];
76 
77 typedef struct ViewDepths {
78  unsigned short w, h;
79  short x, y; /* only for temp use for sub-rects, added to region->winx/y */
80  float *depths;
81  double depth_range[2];
83 
84 /* Rotate 3D cursor on placement. */
90 };
91 
93  const struct View3D *v3d,
94  float r_color[3]);
96  const struct Object *ob,
97  const struct View3D *v3d);
104  const int mval[2],
105  bool use_depth,
106  float r_cursor_co[3]);
108  const int mval[2],
109  bool use_depth,
110  enum eV3DCursorOrient orientation,
111  float r_cursor_co[3],
112  float r_cursor_quat[4]);
114  const int mval[2],
115  bool use_depth,
116  enum eV3DCursorOrient orientation);
117 
118 struct Camera *ED_view3d_camera_data_get(struct View3D *v3d, struct RegionView3D *rv3d);
119 
128 void ED_view3d_to_m4(float mat[4][4], const float ofs[3], const float quat[4], float dist);
137 void ED_view3d_from_m4(const float mat[4][4], float ofs[3], float quat[4], const float *dist);
138 
148  const struct Object *ob, float ofs[3], float quat[4], float *dist, float *lens);
159  struct Object *ob,
160  const float ofs[3],
161  const float quat[4],
162  float dist);
163 
165  struct Depsgraph *depsgraph,
166  const struct Scene *scene,
167  struct Object *camera_ob);
168 
170  struct Depsgraph *depsgraph,
171  const struct Scene *scene,
172  struct Object *camera_ob);
173 
177 void ED_view3d_lastview_store(struct RegionView3D *rv3d);
178 
179 /* Depth buffer */
180 typedef enum {
187 
193  struct ARegion *region,
194  struct View3D *v3d,
195  struct Object *obact,
197  struct ViewDepths **r_depths);
198 void ED_view3d_depths_free(ViewDepths *depths);
200  const int mval[2],
201  int margin,
202  float *r_depth);
203 bool ED_view3d_depth_read_cached_normal(const struct ARegion *region,
204  const ViewDepths *depths,
205  const int mval[2],
206  float r_normal[3]);
207 bool ED_view3d_depth_unproject_v3(const struct ARegion *region,
208  const int mval[2],
209  double depth,
210  float r_location_world[3]);
211 
212 /* Projection */
213 #define IS_CLIPPED 12000
214 
215 /* return values for ED_view3d_project_...() */
216 typedef enum {
231 
232 /* some clipping tests are optional */
233 typedef enum {
261 } eV3DProjTest;
263 
264 #define V3D_PROJ_TEST_CLIP_DEFAULT \
265  (V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_WIN | V3D_PROJ_TEST_CLIP_NEAR)
266 #define V3D_PROJ_TEST_ALL \
267  (V3D_PROJ_TEST_CLIP_DEFAULT | V3D_PROJ_TEST_CLIP_FAR | V3D_PROJ_TEST_CLIP_ZERO | \
268  V3D_PROJ_TEST_CLIP_CONTENT)
269 
270 #define V3D_PROJ_TEST_CLIP_CONTENT_DEFAULT \
271  (V3D_PROJ_TEST_CLIP_CONTENT | V3D_PROJ_TEST_CLIP_NEAR | V3D_PROJ_TEST_CLIP_FAR | \
272  V3D_PROJ_TEST_CLIP_WIN)
273 
274 /* view3d_snap.c */
275 
277  const float snap_target_global[3],
278  int pivot_point);
279 
280 /* view3d_cursor_snap.c */
281 
282 #define USE_SNAP_DETECT_FROM_KEYMAP_HACK
283 typedef enum {
290 
291 typedef enum {
296 
297 typedef enum {
301 
302 typedef struct V3DSnapCursorData {
304  float loc[3];
305  float nor[3];
306  float obmat[4][4];
307  int elem_index[3];
308  float plane_omat[3][3];
310 
314 
315 typedef struct V3DSnapCursorState {
316  /* Setup. */
323  struct wmGizmoGroupType *gzgrp_type; /* Force cursor to be drawn only when gizmo is available. */
324  float *prevpoint;
325  float box_dimensions[3];
326  eSnapMode snap_elem_force; /* If SCE_SNAP_MODE_NONE, use scene settings. */
327  short plane_axis;
331  bool draw_box;
333 
338 void ED_view3d_cursor_snap_prevpoint_set(V3DSnapCursorState *state, const float prev_point[3]);
340  const struct bContext *C,
341  int x,
342  int y);
346  const float loc_prev[3],
347  const float loc_curr[3],
348  const float normal[3],
349  const uchar color_line[4],
350  const uchar color_point[4],
351  eSnapMode snap_elem_type);
352 
353 /* view3d_iterators.c */
354 
355 /* foreach iterators */
356 
358  struct ViewContext *vc,
359  void (*func)(void *userData, struct MVert *eve, const float screen_co[2], int index),
360  void *userData,
361  eV3DProjTest clip_flag);
363  struct ViewContext *vc,
364  void (*func)(void *userData, struct BMVert *eve, const float screen_co[2], int index),
365  void *userData,
366  eV3DProjTest clip_flag);
368  void (*func)(void *userData,
369  struct BMEdge *eed,
370  const float screen_co_a[2],
371  const float screen_co_b[2],
372  int index),
373  void *userData,
374  eV3DProjTest clip_flag);
375 
381  void (*func)(void *userData,
382  struct BMEdge *eed,
383  const float screen_co_a[2],
384  const float screen_co_b[2],
385  int index),
386  void *userData,
387  eV3DProjTest clip_flag);
388 
390  struct ViewContext *vc,
391  void (*func)(void *userData, struct BMFace *efa, const float screen_co[2], int index),
392  void *userData,
393  eV3DProjTest clip_flag);
395  void (*func)(void *userData,
396  struct Nurb *nu,
397  struct BPoint *bp,
398  struct BezTriple *bezt,
399  int beztindex,
400  bool handle_visible,
401  const float screen_co[2]),
402  void *userData,
403  eV3DProjTest clip_flag);
408  void (*func)(void *userData,
409  struct MetaElem *ml,
410  const float screen_co[2]),
411  void *userData,
412  eV3DProjTest clip_flag);
414  void (*func)(void *userData,
415  struct BPoint *bp,
416  const float screen_co[2]),
417  void *userData,
418  eV3DProjTest clip_flag);
423  void (*func)(void *userData,
424  struct EditBone *ebone,
425  const float screen_co_a[2],
426  const float screen_co_b[2]),
427  void *userData,
428  eV3DProjTest clip_flag);
429 
433 void pose_foreachScreenBone(struct ViewContext *vc,
434  void (*func)(void *userData,
435  struct bPoseChannel *pchan,
436  const float screen_co_a[2],
437  const float screen_co_b[2]),
438  void *userData,
439  eV3DProjTest clip_flag);
440 /* *** end iterators *** */
441 
442 /* view3d_project.c */
443 
448  const float co[3],
449  float r_co[2],
450  const float mat[4][4]);
455  const float co[3],
456  float r_co[3],
457  const float mat[4][4]);
458 
459 eV3DProjStatus ED_view3d_project_base(const struct ARegion *region, struct Base *base);
460 
461 /* *** short *** */
463  float perspmat[4][4],
464  bool is_local,
465  const float co[3],
466  short r_co[2],
468 /* --- short --- */
470  const float co[3],
471  short r_co[2],
473 /* object space, use ED_view3d_init_mats_rv3d before calling */
475  const float co[3],
476  short r_co[2],
478 
479 /* *** int *** */
481  float perspmat[4][4],
482  bool is_local,
483  const float co[3],
484  int r_co[2],
486 /* --- int --- */
488  const float co[3],
489  int r_co[2],
491 /* object space, use ED_view3d_init_mats_rv3d before calling */
493  const float co[3],
494  int r_co[2],
496 
497 /* *** float *** */
499  float perspmat[4][4],
500  bool is_local,
501  const float co[3],
502  float r_co[2],
504 /* --- float --- */
506  const float co[3],
507  float r_co[2],
513  const float co[3],
514  float r_co[2],
516 
517 float ED_view3d_pixel_size(const struct RegionView3D *rv3d, const float co[3]);
518 float ED_view3d_pixel_size_no_ui_scale(const struct RegionView3D *rv3d, const float co[3]);
519 
530 float ED_view3d_calc_zfac_ex(const struct RegionView3D *rv3d, const float co[3], bool *r_flip);
532 float ED_view3d_calc_zfac(const struct RegionView3D *rv3d, const float co[3]);
536 float ED_view3d_calc_depth_for_comparison(const struct RegionView3D *rv3d, const float co[3]);
537 
538 bool ED_view3d_clip_segment(const struct RegionView3D *rv3d, float ray_start[3], float ray_end[3]);
553  const struct ARegion *region,
554  const struct View3D *v3d,
555  const float mval[2],
556  float r_ray_start[3],
557  float r_ray_normal[3],
558  bool do_clip_planes);
576  const struct ARegion *region,
577  const struct View3D *v3d,
578  const float mval[2],
579  float r_ray_co[3],
580  float r_ray_normal[3],
581  float r_ray_start[3],
582  bool do_clip_planes);
595  const float mval[2],
596  float r_ray_start[3],
597  float r_ray_normal[3]);
605 void ED_view3d_global_to_vector(const struct RegionView3D *rv3d,
606  const float coord[3],
607  float vec[3]);
615 void ED_view3d_win_to_3d(const struct View3D *v3d,
616  const struct ARegion *region,
617  const float depth_pt[3],
618  const float mval[2],
619  float r_out[3]);
620 void ED_view3d_win_to_3d_int(const struct View3D *v3d,
621  const struct ARegion *region,
622  const float depth_pt[3],
623  const int mval[2],
624  float r_out[3]);
626  const float plane[4],
627  const float mval[2],
628  bool do_clip,
629  float r_out[3]);
638  const float plane[4],
639  const float mval[2],
640  bool do_clip,
641  const float plane_fallback[4],
642  float r_out[3]);
644  const float plane[4],
645  const int mval[2],
646  bool do_clip,
647  float r_out[3]);
665  const float xy_delta[2],
666  float zfac,
667  float r_out[3]);
678 void ED_view3d_win_to_origin(const struct ARegion *region, const float mval[2], float r_out[3]);
692 void ED_view3d_win_to_vector(const struct ARegion *region, const float mval[2], float r_out[3]);
708  const struct ARegion *region,
709  const struct View3D *v3d,
710  const float mval[2],
711  float r_ray_start[3],
712  float r_ray_end[3],
713  bool do_clip_planes);
715  const struct Object *ob,
716  float r_pmat[4][4]);
718  const float obmat[4][4],
719  float r_pmat[4][4]);
720 
725 void ED_view3d_project_v3(const struct ARegion *region,
726  const float world[3],
727  float r_region_co[3]);
728 void ED_view3d_project_v2(const struct ARegion *region,
729  const float world[3],
730  float r_region_co[2]);
732  const struct ARegion *region, float regionx, float regiony, float regionz, float world[3]);
733 
734 /* end */
735 
736 void ED_view3d_dist_range_get(const struct View3D *v3d, float r_dist_range[2]);
741  const struct View3D *v3d,
742  const struct RegionView3D *rv3d,
743  float *r_clipsta,
744  float *r_clipend,
745  bool use_ortho_factor);
747  const struct View3D *v3d,
748  const struct RegionView3D *rv3d,
749  int winxi,
750  int winyi,
751  struct rctf *r_viewplane,
752  float *r_clipsta,
753  float *r_clipend,
754  float *r_pixsize);
755 
759 void ED_view3d_polygon_offset(const struct RegionView3D *rv3d, float dist);
760 
762  struct Depsgraph *depsgraph,
763  const struct ARegion *region,
764  const struct View3D *v3d,
765  const struct RegionView3D *rv3d,
766  struct rctf *r_viewborder,
767  bool no_shift);
769  struct Depsgraph *depsgraph,
770  const struct ARegion *region,
771  const struct View3D *v3d,
772  const struct RegionView3D *rv3d,
773  float r_size[2]);
775  struct Depsgraph *depsgraph,
776  struct View3D *v3d,
777  struct ARegion *region,
778  struct rcti *rect);
779 
781  const struct BoundBox *clipbb,
782  bool is_flip);
784  float planes[4][4],
785  const struct ARegion *region,
786  const struct Object *ob,
787  const struct rcti *rect);
800 bool ED_view3d_clipping_clamp_minmax(const struct RegionView3D *rv3d, float min[3], float max[3]);
801 
802 void ED_view3d_clipping_local(struct RegionView3D *rv3d, const float mat[4][4]);
812 bool ED_view3d_clipping_test(const struct RegionView3D *rv3d, const float co[3], bool is_local);
813 
814 float ED_view3d_radius_to_dist_persp(float angle, float radius);
815 float ED_view3d_radius_to_dist_ortho(float lens, float radius);
841 float ED_view3d_radius_to_dist(const struct View3D *v3d,
842  const struct ARegion *region,
843  const struct Depsgraph *depsgraph,
844  char persp,
845  bool use_aspect,
846  float radius);
847 
856 int ED_view3d_backbuf_sample_size_clamp(struct ARegion *region, float dist);
857 
859 
869  struct ARegion *region,
870  struct View3D *v3d,
871  const int mval[2],
872  float mouse_worldloc[3],
873  bool alphaoverride,
874  const float fallback_depth_pt[3]);
875 
880  const int mval[2],
881  float mouse_worldloc[3],
882  int margin,
883  const float *force_depth);
885  const ViewDepths *vd, const int mval_sta[2], const int mval_end[2], int margin, float *depth);
886 
894 #define MAXPICKELEMS 2500
895 
896 typedef enum {
897  /* all elements in the region, ignore depth */
899  /* pick also depth sorts (only for small regions!) */
901  /* sorts and only returns visible objects (only for small regions!) */
904 
905 typedef enum {
913 
915  const struct Object *obact);
916 
924 
933  struct GPUSelectResult *buffer,
934  unsigned int buffer_len,
935  const struct rcti *input,
936  eV3DSelectMode select_mode,
937  eV3DSelectObjectFilter select_filter,
938  bool do_material_slot_selection);
940  struct GPUSelectResult *buffer,
941  unsigned int buffer_len,
942  const struct rcti *input,
943  eV3DSelectMode select_mode,
944  eV3DSelectObjectFilter select_filter);
946  struct GPUSelectResult *buffer,
947  unsigned int buffer_len,
948  const struct rcti *input,
949  eV3DSelectMode select_mode,
950  eV3DSelectObjectFilter select_filter,
951  uint select_id);
952 
953 /* view3d_select.c */
954 
955 float ED_view3d_select_dist_px(void);
957  struct ViewContext *vc,
958  struct Depsgraph *depsgraph);
959 
975 void ED_view3d_viewcontext_init_object(struct ViewContext *vc, struct Object *obact);
982 
984 bool edge_inside_circle(const float cent[2],
985  float radius,
986  const float screen_co_a[2],
987  const float screen_co_b[2]);
988 
998  struct View3D **r_v3d,
999  struct ARegion **r_region);
1005  const struct View3D *v3d,
1006  struct ARegion **r_region);
1008 
1021 void ED_view3d_init_mats_rv3d(const struct Object *ob, struct RegionView3D *rv3d);
1022 void ED_view3d_init_mats_rv3d_gl(const struct Object *ob, struct RegionView3D *rv3d);
1023 #ifdef DEBUG
1027 void ED_view3d_clear_mats_rv3d(struct RegionView3D *rv3d);
1028 void ED_view3d_check_mats_rv3d(struct RegionView3D *rv3d);
1029 #else
1030 # define ED_view3d_clear_mats_rv3d(rv3d) (void)(rv3d)
1031 # define ED_view3d_check_mats_rv3d(rv3d) (void)(rv3d)
1032 #endif
1033 
1035 void ED_view3d_mats_rv3d_restore(struct RegionView3D *rv3d, struct RV3DMatrixStore *rv3dmat);
1036 
1038  struct Object *ob,
1039  const float col[4],
1040  int facemap);
1041 
1042 struct RenderEngineType *ED_view3d_engine_type(const struct Scene *scene, int drawtype);
1043 
1044 bool ED_view3d_context_activate(struct bContext *C);
1049  struct wmWindow *win,
1050  struct Depsgraph *depsgraph,
1051  struct Scene *scene,
1052  struct ARegion *region,
1053  struct View3D *v3d,
1054  const float viewmat[4][4],
1055  const float winmat[4][4],
1056  const struct rcti *rect);
1057 
1061 struct Base *ED_view3d_give_base_under_cursor(struct bContext *C, const int mval[2]);
1062 struct Object *ED_view3d_give_object_under_cursor(struct bContext *C, const int mval[2]);
1064  const int mval[2],
1065  int *r_material_slot);
1066 bool ED_view3d_is_object_under_cursor(struct bContext *C, const int mval[2]);
1070 void ED_view3d_quadview_update(struct ScrArea *area, struct ARegion *region, bool do_clip);
1075  const struct Scene *scene,
1076  struct View3D *v3d,
1077  struct ARegion *region,
1078  const float viewmat[4][4],
1079  const float winmat[4][4],
1080  const struct rcti *rect,
1081  bool offscreen);
1082 bool ED_view3d_quat_from_axis_view(char view, char view_axis_roll, float r_quat[4]);
1083 bool ED_view3d_quat_to_axis_view(const float viewquat[4],
1084  float epsilon,
1085  char *r_view,
1086  char *r_view_axis_rotation);
1093 bool ED_view3d_quat_to_axis_view_and_reset_quat(float viewquat[4],
1094  float epsilon,
1095  char *r_view,
1096  char *r_view_axis_rotation);
1097 
1100 bool ED_view3d_lock(struct RegionView3D *rv3d);
1101 
1102 void ED_view3d_datamask(const struct bContext *C,
1103  const struct Scene *scene,
1104  const struct View3D *v3d,
1105  struct CustomData_MeshMasks *r_cddata_masks);
1110  const struct Scene *scene,
1111  const struct bScreen *screen,
1112  struct CustomData_MeshMasks *r_cddata_masks);
1113 
1114 bool ED_view3d_offset_lock_check(const struct View3D *v3d, const struct RegionView3D *rv3d);
1123  struct View3D *v3d,
1124  struct RegionView3D *rv3d,
1125  char persp);
1133  struct View3D *v3d,
1134  struct ARegion *region);
1135 
1136 /* Camera view functions. */
1137 
1142 bool ED_view3d_camera_view_zoom_scale(struct RegionView3D *rv3d, const float scale);
1148 bool ED_view3d_camera_view_pan(struct ARegion *region, const float event_ofs[2]);
1149 
1150 /* Camera lock functions */
1151 
1155 bool ED_view3d_camera_lock_check(const struct View3D *v3d, const struct RegionView3D *rv3d);
1163  struct View3D *v3d,
1164  struct RegionView3D *rv3d,
1165  bool calc_dist);
1167  struct View3D *v3d,
1168  struct RegionView3D *rv3d);
1177  struct View3D *v3d,
1178  struct RegionView3D *rv3d);
1179 
1181  struct ID *id_key,
1182  struct bContext *C,
1183  bool do_rotate,
1184  bool do_translate);
1191 bool ED_view3d_camera_lock_autokey(struct View3D *v3d,
1192  struct RegionView3D *rv3d,
1193  struct bContext *C,
1194  bool do_rotate,
1195  bool do_translate);
1196 
1197 void ED_view3d_lock_clear(struct View3D *v3d);
1198 
1203 bool ED_view3d_camera_lock_undo_test(const View3D *v3d,
1204  const RegionView3D *rv3d,
1205  struct bContext *C);
1206 
1213 bool ED_view3d_camera_lock_undo_push(const char *str,
1214  View3D *v3d,
1215  struct RegionView3D *rv3d,
1216  struct bContext *C);
1217 
1225  View3D *v3d,
1226  struct RegionView3D *rv3d,
1227  struct bContext *C);
1228 
1229 #define VIEW3D_MARGIN 1.4f
1230 #define VIEW3D_DIST_FALLBACK 1.0f
1231 
1244 float ED_view3d_offset_distance(const float mat[4][4], const float ofs[3], float fallback_dist);
1250 void ED_view3d_distance_set(struct RegionView3D *rv3d, float dist);
1259  const float dist_co[3],
1260  float dist_min);
1261 
1265 float ED_scene_grid_scale(const struct Scene *scene, const char **r_grid_unit);
1266 float ED_view3d_grid_scale(const struct Scene *scene,
1267  struct View3D *v3d,
1268  const char **r_grid_unit);
1269 void ED_view3d_grid_steps(const struct Scene *scene,
1270  struct View3D *v3d,
1271  struct RegionView3D *rv3d,
1272  float r_grid_steps[8]);
1278 float ED_view3d_grid_view_scale(struct Scene *scene,
1279  struct View3D *v3d,
1280  struct ARegion *region,
1281  const char **r_grid_unit);
1282 
1287 void ED_scene_draw_fps(const struct Scene *scene, int xoffset, int *yoffset);
1288 
1289 /* Render */
1290 
1291 void ED_view3d_stop_render_preview(struct wmWindowManager *wm, struct ARegion *region);
1292 void ED_view3d_shade_update(struct Main *bmain, struct View3D *v3d, struct ScrArea *area);
1293 
1294 #define XRAY_ALPHA(v3d) \
1295  (((v3d)->shading.type == OB_WIRE) ? (v3d)->shading.xray_alpha_wire : (v3d)->shading.xray_alpha)
1296 #define XRAY_FLAG(v3d) \
1297  (((v3d)->shading.type == OB_WIRE) ? V3D_SHADING_XRAY_WIREFRAME : V3D_SHADING_XRAY)
1298 #define XRAY_FLAG_ENABLED(v3d) (((v3d)->shading.flag & XRAY_FLAG(v3d)) != 0)
1299 #define XRAY_ENABLED(v3d) (XRAY_FLAG_ENABLED(v3d) && (XRAY_ALPHA(v3d) < 1.0f))
1300 #define XRAY_ACTIVE(v3d) (XRAY_ENABLED(v3d) && ((v3d)->shading.type < OB_MATERIAL))
1301 
1302 /* view3d_draw_legacy.c */
1303 
1308  struct Depsgraph *depsgraph,
1309  struct ARegion *region,
1310  struct View3D *v3d,
1311  bool do_foreground,
1312  bool do_camera_frame);
1313 
1314 /* view3d_gizmo_preselect_type.c */
1315 
1317  struct wmGizmo *gz,
1318  struct Base **r_base,
1319  struct BMElem **r_ele);
1321 
1322 /* space_view3d.c */
1323 
1325  struct ARegion *region,
1326  const char *category_override);
1327 
1328 /* view3d_view.c */
1329 
1334 bool ED_view3d_local_collections_set(struct Main *bmain, struct View3D *v3d);
1335 void ED_view3d_local_collections_reset(struct bContext *C, bool reset_all);
1336 
1337 #ifdef WITH_XR_OPENXR
1338 void ED_view3d_xr_mirror_update(const struct ScrArea *area, const struct View3D *v3d, bool enable);
1339 void ED_view3d_xr_shading_update(struct wmWindowManager *wm,
1340  const View3D *v3d,
1341  const struct Scene *scene);
1342 bool ED_view3d_is_region_xr_mirror_active(const struct wmWindowManager *wm,
1343  const struct View3D *v3d,
1344  const struct ARegion *region);
1345 #endif
1346 
1347 #ifdef __cplusplus
1348 }
1349 #endif
unsigned char uchar
Definition: BLI_sys_types.h:70
unsigned int uint
Definition: BLI_sys_types.h:67
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:35
eSnapMode
eV3DPlaceOrient
Definition: ED_view3d.h:297
@ V3D_PLACE_ORIENT_DEFAULT
Definition: ED_view3d.h:299
@ V3D_PLACE_ORIENT_SURFACE
Definition: ED_view3d.h:298
eV3DProjStatus ED_view3d_project_int_object(const struct ARegion *region, const float co[3], int r_co[2], eV3DProjTest flag)
bool ED_view3d_camera_view_pan(struct ARegion *region, const float event_ofs[2])
Definition: view3d_utils.c:525
void ED_view3d_stop_render_preview(struct wmWindowManager *wm, struct ARegion *region)
Definition: space_view3d.c:200
bool ED_view3d_win_to_3d_on_plane(const struct ARegion *region, const float plane[4], const float mval[2], bool do_clip, float r_out[3])
void ED_view3d_distance_set(struct RegionView3D *rv3d, float dist)
bool ED_view3d_win_to_segment_clipped(const struct Depsgraph *depsgraph, const struct ARegion *region, const struct View3D *v3d, const float mval[2], float r_ray_start[3], float r_ray_end[3], bool do_clip_planes)
bool ED_view3d_depth_read_cached(const ViewDepths *vd, const int mval[2], int margin, float *r_depth)
bool ED_view3d_camera_lock_sync(const struct Depsgraph *depsgraph, struct View3D *v3d, struct RegionView3D *rv3d)
bool ED_view3d_area_user_region(const struct ScrArea *area, const struct View3D *v3d, struct ARegion **r_region)
int view3d_opengl_select_ex(struct ViewContext *vc, struct GPUSelectResult *buffer, unsigned int buffer_len, const struct rcti *input, eV3DSelectMode select_mode, eV3DSelectObjectFilter select_filter, bool do_material_slot_selection)
void view3d_opengl_select_cache_end(void)
Definition: view3d_view.c:470
bool ED_view3d_snap_selected_to_location(struct bContext *C, const float snap_target_global[3], int pivot_point)
Definition: view3d_snap.c:573
void ED_view3d_mats_rv3d_restore(struct RegionView3D *rv3d, struct RV3DMatrixStore *rv3dmat)
Definition: view3d_draw.c:2460
eV3DProjStatus ED_view3d_project_base(const struct ARegion *region, struct Base *base)
void ED_view3d_cursor_snap_state_default_set(V3DSnapCursorState *state)
void ED_view3d_calc_camera_border_size(const struct Scene *scene, struct Depsgraph *depsgraph, const struct ARegion *region, const struct View3D *v3d, const struct RegionView3D *rv3d, float r_size[2])
void ED_view3d_cursor_snap_prevpoint_set(V3DSnapCursorState *state, const float prev_point[3])
bool ED_view3d_clipping_clamp_minmax(const struct RegionView3D *rv3d, float min[3], float max[3])
struct V3DSnapCursorData V3DSnapCursorData
struct RenderEngineType * ED_view3d_engine_type(const struct Scene *scene, int drawtype)
void pose_foreachScreenBone(struct ViewContext *vc, void(*func)(void *userData, struct bPoseChannel *pchan, const float screen_co_a[2], const float screen_co_b[2]), void *userData, eV3DProjTest clip_flag)
char ED_view3d_axis_view_opposite(char view)
bool ED_view3d_win_to_ray_clipped_ex(struct Depsgraph *depsgraph, const struct ARegion *region, const struct View3D *v3d, const float mval[2], float r_ray_co[3], float r_ray_normal[3], float r_ray_start[3], bool do_clip_planes)
bool ED_view3d_clip_range_get(const struct Depsgraph *depsgraph, const struct View3D *v3d, const struct RegionView3D *rv3d, float *r_clipsta, float *r_clipend, bool use_ortho_factor)
float ED_view3d_pixel_size(const struct RegionView3D *rv3d, const float co[3])
eV3DProjTest
Definition: ED_view3d.h:233
@ V3D_PROJ_TEST_CLIP_FAR
Definition: ED_view3d.h:238
@ V3D_PROJ_TEST_CLIP_NEAR
Definition: ED_view3d.h:237
@ V3D_PROJ_TEST_CLIP_ZERO
Definition: ED_view3d.h:239
@ V3D_PROJ_TEST_CLIP_CONTENT
Definition: ED_view3d.h:260
@ V3D_PROJ_TEST_NOP
Definition: ED_view3d.h:234
@ V3D_PROJ_TEST_CLIP_WIN
Definition: ED_view3d.h:236
@ V3D_PROJ_TEST_CLIP_BB
Definition: ED_view3d.h:235
void ED_view3d_win_to_3d_int(const struct View3D *v3d, const struct ARegion *region, const float depth_pt[3], const int mval[2], float r_out[3])
void mball_foreachScreenElem(struct ViewContext *vc, void(*func)(void *userData, struct MetaElem *ml, const float screen_co[2]), void *userData, eV3DProjTest clip_flag)
void ED_view3d_project_float_v3_m4(const struct ARegion *region, const float co[3], float r_co[3], const float mat[4][4])
bool ED_view3d_viewplane_get(struct Depsgraph *depsgraph, const struct View3D *v3d, const struct RegionView3D *rv3d, int winxi, int winyi, struct rctf *r_viewplane, float *r_clipsta, float *r_clipend, float *r_pixsize)
bool ED_view3d_camera_lock_check(const struct View3D *v3d, const struct RegionView3D *rv3d)
struct V3DSnapCursorState V3DSnapCursorState
#define ED_view3d_clear_mats_rv3d(rv3d)
Definition: ED_view3d.h:1030
bool ED_view3d_clip_segment(const struct RegionView3D *rv3d, float ray_start[3], float ray_end[3])
void ED_view3d_project_v3(const struct ARegion *region, const float world[3], float r_region_co[3])
void ED_view3d_ob_project_mat_get_from_obmat(const struct RegionView3D *rv3d, const float obmat[4][4], float r_pmat[4][4])
int view3d_opengl_select(struct ViewContext *vc, struct GPUSelectResult *buffer, unsigned int buffer_len, const struct rcti *input, eV3DSelectMode select_mode, eV3DSelectObjectFilter select_filter)
char ED_view3d_lock_view_from_index(int index)
void ED_view3d_win_to_delta(const struct ARegion *region, const float xy_delta[2], float zfac, float r_out[3])
void ED_view3d_to_m4(float mat[4][4], const float ofs[3], const float quat[4], float dist)
eV3DProjStatus ED_view3d_project_float_global(const struct ARegion *region, const float co[3], float r_co[2], eV3DProjTest flag)
eV3DProjStatus ED_view3d_project_short_global(const struct ARegion *region, const float co[3], short r_co[2], eV3DProjTest flag)
void ED_view3d_init_mats_rv3d_gl(const struct Object *ob, struct RegionView3D *rv3d)
Definition: space_view3d.c:176
bool ED_view3d_camera_to_view_selected_with_set_clipping(struct Main *bmain, struct Depsgraph *depsgraph, const struct Scene *scene, struct Object *camera_ob)
void ED_view3d_cursor3d_position_rotation(struct bContext *C, const int mval[2], bool use_depth, enum eV3DCursorOrient orientation, float r_cursor_co[3], float r_cursor_quat[4])
Definition: view3d_edit.c:865
bool ED_operator_rv3d_user_region_poll(struct bContext *C)
Definition: view3d_view.c:277
void ED_view3d_viewcontext_init(struct bContext *C, struct ViewContext *vc, struct Depsgraph *depsgraph)
bool ED_view3d_depth_read_cached_seg(const ViewDepths *vd, const int mval_sta[2], const int mval_end[2], int margin, float *depth)
void ED_view3d_cursor3d_update(struct bContext *C, const int mval[2], bool use_depth, enum eV3DCursorOrient orientation)
Definition: view3d_edit.c:984
void ED_view3d_dist_range_get(const struct View3D *v3d, float r_dist_range[2])
struct Base * ED_view3d_give_base_under_cursor(struct bContext *C, const int mval[2])
bool ED_view3d_quat_to_axis_view_and_reset_quat(float viewquat[4], float epsilon, char *r_view, char *r_view_axis_rotation)
eV3DProjStatus
Definition: ED_view3d.h:216
@ V3D_PROJ_RET_CLIP_WIN
Definition: ED_view3d.h:227
@ V3D_PROJ_RET_CLIP_BB
Definition: ED_view3d.h:225
@ V3D_PROJ_RET_CLIP_FAR
Definition: ED_view3d.h:221
@ V3D_PROJ_RET_CLIP_ZERO
Definition: ED_view3d.h:223
@ V3D_PROJ_RET_CLIP_NEAR
Definition: ED_view3d.h:219
@ V3D_PROJ_RET_OVERFLOW
Definition: ED_view3d.h:229
@ V3D_PROJ_RET_OK
Definition: ED_view3d.h:217
bool ED_view3d_camera_to_view_selected(struct Main *bmain, struct Depsgraph *depsgraph, const struct Scene *scene, struct Object *camera_ob)
V3DSnapCursorData * ED_view3d_cursor_snap_data_get(void)
void mesh_foreachScreenEdge_clip_bb_segment(struct ViewContext *vc, void(*func)(void *userData, struct BMEdge *eed, const float screen_co_a[2], const float screen_co_b[2], int index), void *userData, eV3DProjTest clip_flag)
ENUM_OPERATORS(eV3DProjTest, V3D_PROJ_TEST_CLIP_CONTENT)
void mesh_foreachScreenVert(struct ViewContext *vc, void(*func)(void *userData, struct BMVert *eve, const float screen_co[2], int index), void *userData, eV3DProjTest clip_flag)
void ED_view3d_cursor_snap_draw_util(struct RegionView3D *rv3d, const float loc_prev[3], const float loc_curr[3], const float normal[3], const uchar color_line[4], const uchar color_point[4], eSnapMode snap_elem_type)
void ED_view3d_win_to_ray(const struct ARegion *region, const float mval[2], float r_ray_start[3], float r_ray_normal[3])
eV3DProjStatus ED_view3d_project_int_ex(const struct ARegion *region, float perspmat[4][4], bool is_local, const float co[3], int r_co[2], eV3DProjTest flag)
float ED_view3d_pixel_size_no_ui_scale(const struct RegionView3D *rv3d, const float co[3])
float ED_scene_grid_scale(const struct Scene *scene, const char **r_grid_unit)
void ED_view3d_win_to_origin(const struct ARegion *region, const float mval[2], float r_out[3])
eV3DSnapCursor
Definition: ED_view3d.h:283
@ V3D_SNAPCURSOR_SNAP_EDIT_GEOM_FINAL
Definition: ED_view3d.h:287
@ V3D_SNAPCURSOR_OCCLUSION_ALWAYS_FALSE
Definition: ED_view3d.h:286
@ V3D_SNAPCURSOR_TOGGLE_ALWAYS_TRUE
Definition: ED_view3d.h:284
@ V3D_SNAPCURSOR_OCCLUSION_ALWAYS_TRUE
Definition: ED_view3d.h:285
@ V3D_SNAPCURSOR_SNAP_EDIT_GEOM_CAGE
Definition: ED_view3d.h:288
void ED_view3d_polygon_offset(const struct RegionView3D *rv3d, float dist)
float ED_view3d_grid_scale(const struct Scene *scene, struct View3D *v3d, const char **r_grid_unit)
void ED_view3d_viewcontext_init_object(struct ViewContext *vc, struct Object *obact)
float ED_view3d_radius_to_dist_ortho(float lens, float radius)
bool ED_view3d_unproject_v3(const struct ARegion *region, float regionx, float regiony, float regionz, float world[3])
void ED_scene_draw_fps(const struct Scene *scene, int xoffset, int *yoffset)
void ED_view3d_ob_project_mat_get(const struct RegionView3D *v3d, const struct Object *ob, float r_pmat[4][4])
bool ED_view3d_quat_from_axis_view(char view, char view_axis_roll, float r_quat[4])
void ED_view3d_cursor_snap_data_update(V3DSnapCursorState *state, const struct bContext *C, int x, int y)
float ED_view3d_offset_distance(const float mat[4][4], const float ofs[3], float fallback_dist)
bool ED_view3d_offset_lock_check(const struct View3D *v3d, const struct RegionView3D *rv3d)
bool ED_view3d_win_to_3d_on_plane_with_fallback(const struct ARegion *region, const float plane[4], const float mval[2], bool do_clip, const float plane_fallback[4], float r_out[3])
void ED_view3d_buttons_region_layout_ex(const struct bContext *C, struct ARegion *region, const char *category_override)
void ED_view3d_from_m4(const float mat[4][4], float ofs[3], float quat[4], const float *dist)
bool ED_view3d_clipping_test(const struct RegionView3D *rv3d, const float co[3], bool is_local)
bool ED_view3d_local_collections_set(struct Main *bmain, struct View3D *v3d)
Definition: view3d_view.c:1215
void ED_view3d_draw_setup_view(const struct wmWindowManager *wm, struct wmWindow *win, struct Depsgraph *depsgraph, struct Scene *scene, struct ARegion *region, struct View3D *v3d, const float viewmat[4][4], const float winmat[4][4], const struct rcti *rect)
bool ED_view3d_persp_ensure(const struct Depsgraph *depsgraph, struct View3D *v3d, struct ARegion *region)
eV3DProjStatus ED_view3d_project_int_global(const struct ARegion *region, const float co[3], int r_co[2], eV3DProjTest flag)
bool ED_view3d_quat_to_axis_view(const float viewquat[4], float epsilon, char *r_view, char *r_view_axis_rotation)
bool ED_view3d_win_to_ray_clipped(struct Depsgraph *depsgraph, const struct ARegion *region, const struct View3D *v3d, const float mval[2], float r_ray_start[3], float r_ray_normal[3], bool do_clip_planes)
int view3d_opengl_select_with_id_filter(struct ViewContext *vc, struct GPUSelectResult *buffer, unsigned int buffer_len, const struct rcti *input, eV3DSelectMode select_mode, eV3DSelectObjectFilter select_filter, uint select_id)
float ED_view3d_radius_to_dist_persp(float angle, float radius)
void mesh_foreachScreenEdge(struct ViewContext *vc, void(*func)(void *userData, struct BMEdge *eed, const float screen_co_a[2], const float screen_co_b[2], int index), void *userData, eV3DProjTest clip_flag)
bool ED_view3d_is_object_under_cursor(struct bContext *C, const int mval[2])
void ED_view3d_from_object(const struct Object *ob, float ofs[3], float quat[4], float *dist, float *lens)
void ED_view3d_win_to_vector(const struct ARegion *region, const float mval[2], float r_out[3])
bool ED_view3d_context_activate(struct bContext *C)
Definition: view3d_utils.c:219
void meshobject_foreachScreenVert(struct ViewContext *vc, void(*func)(void *userData, struct MVert *eve, const float screen_co[2], int index), void *userData, eV3DProjTest clip_flag)
bool ED_view3d_distance_set_from_location(struct RegionView3D *rv3d, const float dist_co[3], float dist_min)
eV3DProjStatus ED_view3d_project_short_object(const struct ARegion *region, const float co[3], short r_co[2], eV3DProjTest flag)
void ED_view3d_cursor3d_position(struct bContext *C, const int mval[2], bool use_depth, float r_cursor_co[3])
Definition: view3d_edit.c:823
void ED_view3d_select_id_validate(struct ViewContext *vc)
Definition: view3d_draw.c:2190
struct ViewDepths ViewDepths
void ED_view3d_project_float_v2_m4(const struct ARegion *region, const float co[3], float r_co[2], const float mat[4][4])
void ED_view3d_draw_bgpic_test(const struct Scene *scene, struct Depsgraph *depsgraph, struct ARegion *region, struct View3D *v3d, bool do_foreground, bool do_camera_frame)
bool ED_view3d_camera_view_zoom_scale(struct RegionView3D *rv3d, const float scale)
Definition: view3d_utils.c:512
void ED_view3d_update_viewmat(struct Depsgraph *depsgraph, const struct Scene *scene, struct View3D *v3d, struct ARegion *region, const float viewmat[4][4], const float winmat[4][4], const struct rcti *rect, bool offscreen)
void ED_view3d_to_object(const struct Depsgraph *depsgraph, struct Object *ob, const float ofs[3], const float quat[4], float dist)
void ED_view3d_gizmo_mesh_preselect_get_active(struct bContext *C, struct wmGizmo *gz, struct Base **r_base, struct BMElem **r_ele)
struct ViewContext ViewContext
bool ED_view3d_depth_read_cached_normal(const struct ARegion *region, const ViewDepths *depths, const int mval[2], float r_normal[3])
void ED_view3d_depths_free(ViewDepths *depths)
Definition: view3d_draw.c:2366
void ED_view3d_project_v2(const struct ARegion *region, const float world[3], float r_region_co[2])
eV3DDepthOverrideMode
Definition: ED_view3d.h:180
@ V3D_DEPTH_NO_GPENCIL
Definition: ED_view3d.h:182
@ V3D_DEPTH_GPENCIL_ONLY
Definition: ED_view3d.h:184
@ V3D_DEPTH_OBJECT_ONLY
Definition: ED_view3d.h:186
bool ED_view3d_camera_lock_undo_test(const View3D *v3d, const RegionView3D *rv3d, struct bContext *C)
Definition: view3d_utils.c:692
bool ED_view3d_camera_lock_autokey(struct View3D *v3d, struct RegionView3D *rv3d, struct bContext *C, bool do_rotate, bool do_translate)
Definition: view3d_utils.c:665
struct Object * ED_view3d_give_material_slot_under_cursor(struct bContext *C, const int mval[2], int *r_material_slot)
void view3d_opengl_select_cache_begin(void)
Definition: view3d_view.c:465
eV3DCursorOrient
Definition: ED_view3d.h:85
@ V3D_CURSOR_ORIENT_XFORM
Definition: ED_view3d.h:88
@ V3D_CURSOR_ORIENT_GEOM
Definition: ED_view3d.h:89
@ V3D_CURSOR_ORIENT_VIEW
Definition: ED_view3d.h:87
@ V3D_CURSOR_ORIENT_NONE
Definition: ED_view3d.h:86
struct SnapObjectContext * ED_view3d_cursor_snap_context_ensure(struct Scene *scene)
void ED_view3d_global_to_vector(const struct RegionView3D *rv3d, const float coord[3], float vec[3])
void lattice_foreachScreenVert(struct ViewContext *vc, void(*func)(void *userData, struct BPoint *bp, const float screen_co[2]), void *userData, eV3DProjTest clip_flag)
void ED_view3d_grid_steps(const struct Scene *scene, struct View3D *v3d, struct RegionView3D *rv3d, float r_grid_steps[8])
struct Camera * ED_view3d_camera_data_get(struct View3D *v3d, struct RegionView3D *rv3d)
Definition: view3d_utils.c:94
void ED_view3d_camera_lock_init_ex(const struct Depsgraph *depsgraph, struct View3D *v3d, struct RegionView3D *rv3d, bool calc_dist)
float ED_view3d_radius_to_dist(const struct View3D *v3d, const struct ARegion *region, const struct Depsgraph *depsgraph, char persp, bool use_aspect, float radius)
void ED_view3d_persp_switch_from_camera(const struct Depsgraph *depsgraph, struct View3D *v3d, struct RegionView3D *rv3d, char persp)
void ED_view3d_local_collections_reset(struct bContext *C, bool reset_all)
Definition: view3d_view.c:1239
float ED_view3d_calc_zfac(const struct RegionView3D *rv3d, const float co[3])
bool ED_view3d_depth_unproject_v3(const struct ARegion *region, const int mval[2], double depth, float r_location_world[3])
eV3DProjStatus ED_view3d_project_float_object(const struct ARegion *region, const float co[3], float r_co[2], eV3DProjTest flag)
float ED_view3d_grid_view_scale(struct Scene *scene, struct View3D *v3d, struct ARegion *region, const char **r_grid_unit)
Definition: view3d_draw.c:901
eV3DSelectMode
Definition: ED_view3d.h:896
@ VIEW3D_SELECT_PICK_ALL
Definition: ED_view3d.h:900
@ VIEW3D_SELECT_PICK_NEAREST
Definition: ED_view3d.h:902
@ VIEW3D_SELECT_ALL
Definition: ED_view3d.h:898
void view3d_region_operator_needs_opengl(struct wmWindow *win, struct ARegion *region)
bool ED_view3d_camera_lock_undo_push(const char *str, View3D *v3d, struct RegionView3D *rv3d, struct bContext *C)
Definition: view3d_utils.c:726
bool ED_view3d_camera_autokey(const struct Scene *scene, struct ID *id_key, struct bContext *C, bool do_rotate, bool do_translate)
bool ED_view3d_autodist_simple(struct ARegion *region, const int mval[2], float mouse_worldloc[3], int margin, const float *force_depth)
void ED_view3d_cursor_snap_deactive(V3DSnapCursorState *state)
void ED_view3d_clipping_calc(struct BoundBox *bb, float planes[4][4], const struct ARegion *region, const struct Object *ob, const struct rcti *rect)
void ED_view3d_lastview_store(struct RegionView3D *rv3d)
Definition: view3d_utils.c:440
void ED_view3d_win_to_3d(const struct View3D *v3d, const struct ARegion *region, const float depth_pt[3], const float mval[2], float r_out[3])
bool ED_view3d_lock(struct RegionView3D *rv3d)
eV3DSelectObjectFilter ED_view3d_select_filter_from_mode(const struct Scene *scene, const struct Object *obact)
bool ED_view3d_win_to_3d_on_plane_int(const struct ARegion *region, const float plane[4], const int mval[2], bool do_clip, float r_out[3])
V3DSnapCursorState * ED_view3d_cursor_snap_active(void)
void ED_view3d_clipping_local(struct RegionView3D *rv3d, const float mat[4][4])
Definition: view3d_edit.c:755
void ED_view3d_camera_lock_init(const struct Depsgraph *depsgraph, struct View3D *v3d, struct RegionView3D *rv3d)
void ED_draw_object_facemap(struct Depsgraph *depsgraph, struct Object *ob, const float col[4], int facemap)
Definition: drawobject.c:44
eV3DProjStatus ED_view3d_project_short_ex(const struct ARegion *region, float perspmat[4][4], bool is_local, const float co[3], short r_co[2], eV3DProjTest flag)
void ED_view3d_background_color_get(const struct Scene *scene, const struct View3D *v3d, float r_color[3])
void view3d_operator_needs_opengl(const struct bContext *C)
void ED_view3d_screen_datamask(const struct bContext *C, const struct Scene *scene, const struct bScreen *screen, struct CustomData_MeshMasks *r_cddata_masks)
V3DSnapCursorState * ED_view3d_cursor_snap_state_get(void)
eV3DPlaceDepth
Definition: ED_view3d.h:291
@ V3D_PLACE_DEPTH_CURSOR_VIEW
Definition: ED_view3d.h:294
@ V3D_PLACE_DEPTH_CURSOR_PLANE
Definition: ED_view3d.h:293
@ V3D_PLACE_DEPTH_SURFACE
Definition: ED_view3d.h:292
struct RegionView3D * ED_view3d_context_rv3d(struct bContext *C)
Definition: space_view3d.c:82
bool ED_view3d_camera_lock_undo_grouped_push(const char *str, View3D *v3d, struct RegionView3D *rv3d, struct bContext *C)
Definition: view3d_utils.c:731
void nurbs_foreachScreenVert(struct ViewContext *vc, void(*func)(void *userData, struct Nurb *nu, struct BPoint *bp, struct BezTriple *bezt, int beztindex, bool handle_visible, const float screen_co[2]), void *userData, eV3DProjTest clip_flag)
struct RV3DMatrixStore * ED_view3d_mats_rv3d_backup(struct RegionView3D *rv3d)
Definition: view3d_draw.c:2447
void ED_view3d_clipping_calc_from_boundbox(float clip[4][4], const struct BoundBox *clipbb, bool is_flip)
void ED_view3d_init_mats_rv3d(const struct Object *ob, struct RegionView3D *rv3d)
Definition: space_view3d.c:166
int ED_view3d_backbuf_sample_size_clamp(struct ARegion *region, float dist)
Definition: view3d_draw.c:2195
bool edge_inside_circle(const float cent[2], float radius, const float screen_co_a[2], const float screen_co_b[2])
void ED_view3d_shade_update(struct Main *bmain, struct View3D *v3d, struct ScrArea *area)
Definition: space_view3d.c:223
bool ED_view3d_context_user_region(struct bContext *C, struct View3D **r_v3d, struct ARegion **r_region)
Definition: space_view3d.c:98
eV3DProjStatus ED_view3d_project_float_ex(const struct ARegion *region, float perspmat[4][4], bool is_local, const float co[3], float r_co[2], eV3DProjTest flag)
void ED_view3d_lock_clear(struct View3D *v3d)
Definition: view3d_utils.c:450
void ED_view3d_calc_camera_border(const struct Scene *scene, struct Depsgraph *depsgraph, const struct ARegion *region, const struct View3D *v3d, const struct RegionView3D *rv3d, struct rctf *r_viewborder, bool no_shift)
eV3DSelectObjectFilter
Definition: ED_view3d.h:905
@ VIEW3D_SELECT_FILTER_NOP
Definition: ED_view3d.h:907
@ VIEW3D_SELECT_FILTER_OBJECT_MODE_LOCK
Definition: ED_view3d.h:909
@ VIEW3D_SELECT_FILTER_WPAINT_POSE_MODE_LOCK
Definition: ED_view3d.h:911
bool ED_view3d_calc_render_border(const struct Scene *scene, struct Depsgraph *depsgraph, struct View3D *v3d, struct ARegion *region, struct rcti *rect)
void ED_view3d_depth_override(struct Depsgraph *depsgraph, struct ARegion *region, struct View3D *v3d, struct Object *obact, eV3DDepthOverrideMode mode, struct ViewDepths **r_depths)
Definition: view3d_draw.c:2294
float ED_view3d_select_dist_px(void)
void ED_view3d_quadview_update(struct ScrArea *area, struct ARegion *region, bool do_clip)
Definition: view3d_utils.c:938
void ED_view3d_gizmo_mesh_preselect_clear(struct wmGizmo *gz)
#define ED_view3d_check_mats_rv3d(rv3d)
Definition: ED_view3d.h:1031
float ED_view3d_calc_zfac_ex(const struct RegionView3D *rv3d, const float co[3], bool *r_flip)
bool ED_view3d_autodist(struct Depsgraph *depsgraph, struct ARegion *region, struct View3D *v3d, const int mval[2], float mouse_worldloc[3], bool alphaoverride, const float fallback_depth_pt[3])
void ED_view3d_backbuf_depth_validate(struct ViewContext *vc)
struct Object * ED_view3d_give_object_under_cursor(struct bContext *C, const int mval[2])
void ED_view3d_datamask(const struct bContext *C, const struct Scene *scene, const struct View3D *v3d, struct CustomData_MeshMasks *r_cddata_masks)
void armature_foreachScreenBone(struct ViewContext *vc, void(*func)(void *userData, struct EditBone *ebone, const float screen_co_a[2], const float screen_co_b[2]), void *userData, eV3DProjTest clip_flag)
bool ED_view3d_has_workbench_in_texture_color(const struct Scene *scene, const struct Object *ob, const struct View3D *v3d)
float ED_view3d_calc_depth_for_comparison(const struct RegionView3D *rv3d, const float co[3])
void mesh_foreachScreenFace(struct ViewContext *vc, void(*func)(void *userData, struct BMFace *efa, const float screen_co[2], int index), void *userData, eV3DProjTest clip_flag)
static AppView * view
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
const int facemap[6][4]
Definition: Projections.cpp:43
#define C
Definition: RandGen.cpp:25
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
Definition: btVector3.h:356
Scene scene
World world
const Depsgraph * depsgraph
#define str(s)
uint col
IconTextureDrawCall normal
ccl_global float * buffer
ccl_global KernelShaderEvalInput * input
const int state
static void area(int d1, int d2, int e1, int e2, float weights[2])
static double epsilon
#define min(a, b)
Definition: sort.c:35
float lens
Definition: DNA_ID.h:368
Definition: BKE_main.h:121
struct Material ** mat
float scale[3]
eSnapMode snap_elem
Definition: ED_view3d.h:303
float plane_omat[3][3]
Definition: ED_view3d.h:308
float obmat[4][4]
Definition: ED_view3d.h:306
eV3DSnapCursor flag
Definition: ED_view3d.h:317
uchar color_box[4]
Definition: ED_view3d.h:322
eV3DPlaceOrient plane_orient
Definition: ED_view3d.h:319
float box_dimensions[3]
Definition: ED_view3d.h:325
uchar color_point[4]
Definition: ED_view3d.h:321
struct wmGizmoGroupType * gzgrp_type
Definition: ED_view3d.h:323
eV3DPlaceDepth plane_depth
Definition: ED_view3d.h:318
eSnapMode snap_elem_force
Definition: ED_view3d.h:326
uchar color_line[4]
Definition: ED_view3d.h:320
bool use_plane_axis_auto
Definition: ED_view3d.h:328
struct Depsgraph * depsgraph
Definition: ED_view3d.h:64
int mval[2]
Definition: ED_view3d.h:74
struct Scene * scene
Definition: ED_view3d.h:65
struct ARegion * region
Definition: ED_view3d.h:69
struct ViewLayer * view_layer
Definition: ED_view3d.h:66
struct BMEditMesh * em
Definition: ED_view3d.h:73
struct Main * bmain
Definition: ED_view3d.h:59
struct bContext * C
Definition: ED_view3d.h:58
struct Object * obact
Definition: ED_view3d.h:67
struct Object * obedit
Definition: ED_view3d.h:68
struct wmWindow * win
Definition: ED_view3d.h:71
struct View3D * v3d
Definition: ED_view3d.h:70
struct RegionView3D * rv3d
Definition: ED_view3d.h:72
short y
Definition: ED_view3d.h:79
unsigned short w
Definition: ED_view3d.h:78
float * depths
Definition: ED_view3d.h:80
short x
Definition: ED_view3d.h:79
double depth_range[2]
Definition: ED_view3d.h:81
unsigned short h
Definition: ED_view3d.h:78
float max