Blender  V2.93
Classes | Macros | Typedefs | Enumerations | Functions
ED_view3d.h File Reference

Go to the source code of this file.

Classes

struct  ViewContext
 
struct  ViewDepths
 

Macros

#define IS_CLIPPED   12000
 
#define V3D_PROJ_TEST_CLIP_DEFAULT    (V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_WIN | V3D_PROJ_TEST_CLIP_NEAR)
 
#define V3D_PROJ_TEST_ALL    (V3D_PROJ_TEST_CLIP_DEFAULT | V3D_PROJ_TEST_CLIP_FAR | V3D_PROJ_TEST_CLIP_ZERO)
 
#define MAXPICKELEMS   2500
 
#define MAXPICKBUF   (4 * MAXPICKELEMS)
 
#define ED_view3d_clear_mats_rv3d(rv3d)   (void)(rv3d)
 
#define ED_view3d_check_mats_rv3d(rv3d)   (void)(rv3d)
 
#define VIEW3D_MARGIN   1.4f
 
#define VIEW3D_DIST_FALLBACK   1.0f
 
#define XRAY_ALPHA(v3d)    (((v3d)->shading.type == OB_WIRE) ? (v3d)->shading.xray_alpha_wire : (v3d)->shading.xray_alpha)
 
#define XRAY_FLAG(v3d)    (((v3d)->shading.type == OB_WIRE) ? V3D_SHADING_XRAY_WIREFRAME : V3D_SHADING_XRAY)
 
#define XRAY_FLAG_ENABLED(v3d)   (((v3d)->shading.flag & XRAY_FLAG(v3d)) != 0)
 
#define XRAY_ENABLED(v3d)   (XRAY_FLAG_ENABLED(v3d) && (XRAY_ALPHA(v3d) < 1.0f))
 
#define XRAY_ACTIVE(v3d)   (XRAY_ENABLED(v3d) && ((v3d)->shading.type < OB_MATERIAL))
 

Typedefs

typedef struct ViewContext ViewContext
 
typedef struct ViewDepths ViewDepths
 

Enumerations

enum  eV3DCursorOrient { V3D_CURSOR_ORIENT_NONE = 0 , V3D_CURSOR_ORIENT_VIEW , V3D_CURSOR_ORIENT_XFORM , V3D_CURSOR_ORIENT_GEOM }
 
enum  eV3DDepthOverrideMode { V3D_DEPTH_NO_GPENCIL = 0 , V3D_DEPTH_GPENCIL_ONLY , V3D_DEPTH_OBJECT_ONLY }
 
enum  eV3DProjStatus {
  V3D_PROJ_RET_OK = 0 , V3D_PROJ_RET_CLIP_NEAR = 1 , V3D_PROJ_RET_CLIP_FAR = 2 , V3D_PROJ_RET_CLIP_ZERO = 3 ,
  V3D_PROJ_RET_CLIP_BB = 4 , V3D_PROJ_RET_CLIP_WIN = 5 , V3D_PROJ_RET_OVERFLOW = 6
}
 
enum  eV3DProjTest {
  V3D_PROJ_TEST_NOP = 0 , V3D_PROJ_TEST_CLIP_BB = (1 << 0) , V3D_PROJ_TEST_CLIP_WIN = (1 << 1) , V3D_PROJ_TEST_CLIP_NEAR = (1 << 2) ,
  V3D_PROJ_TEST_CLIP_FAR = (1 << 3) , V3D_PROJ_TEST_CLIP_ZERO = (1 << 4)
}
 
enum  eV3DSelectMode { VIEW3D_SELECT_ALL = 0 , VIEW3D_SELECT_PICK_ALL = 1 , VIEW3D_SELECT_PICK_NEAREST = 2 }
 
enum  eV3DSelectObjectFilter { VIEW3D_SELECT_FILTER_NOP = 0 , VIEW3D_SELECT_FILTER_OBJECT_MODE_LOCK = 1 , VIEW3D_SELECT_FILTER_WPAINT_POSE_MODE_LOCK = 2 }
 

Functions

void ED_view3d_background_color_get (const struct Scene *scene, const struct View3D *v3d, float r_color[3])
 
bool ED_view3d_has_workbench_in_texture_color (const struct Scene *scene, const struct Object *ob, const struct View3D *v3d)
 
void ED_view3d_cursor3d_position (struct bContext *C, const int mval[2], const bool use_depth, float r_cursor_co[3])
 
void ED_view3d_cursor3d_position_rotation (struct bContext *C, const int mval[2], const bool use_depth, enum eV3DCursorOrient orientation, float r_cursor_co[3], float r_cursor_quat[4])
 
void ED_view3d_cursor3d_update (struct bContext *C, const int mval[2], const bool use_depth, enum eV3DCursorOrient orientation)
 
struct CameraED_view3d_camera_data_get (struct View3D *v3d, struct RegionView3D *rv3d)
 
void ED_view3d_to_m4 (float mat[4][4], const float ofs[3], const float quat[4], const float dist)
 
void ED_view3d_from_m4 (const float mat[4][4], float ofs[3], float quat[4], const float *dist)
 
void ED_view3d_from_object (const struct Object *ob, float ofs[3], float quat[4], float *dist, float *lens)
 
void ED_view3d_to_object (const struct Depsgraph *depsgraph, struct Object *ob, const float ofs[3], const float quat[4], const float dist)
 
bool ED_view3d_camera_to_view_selected (struct Main *bmain, struct Depsgraph *depsgraph, const struct Scene *scene, struct Object *camera_ob)
 
void ED_view3d_lastview_store (struct RegionView3D *rv3d)
 
void ED_view3d_depth_override (struct Depsgraph *depsgraph, struct ARegion *region, struct View3D *v3d, struct Object *obact, eV3DDepthOverrideMode mode, bool update_cache)
 
bool ED_view3d_depth_read_cached (const ViewDepths *vd, const int mval[2], int margin, float *r_depth)
 
bool ED_view3d_depth_read_cached_normal (const ViewContext *vc, const int mval[2], float r_normal[3])
 
bool ED_view3d_depth_unproject (const struct ARegion *region, const int mval[2], const double depth, float r_location_world[3])
 
void ED_view3d_depth_tag_update (struct RegionView3D *rv3d)
 
void meshobject_foreachScreenVert (struct ViewContext *vc, void(*func)(void *userData, struct MVert *eve, const float screen_co[2], int index), void *userData, const eV3DProjTest clip_flag)
 
void mesh_foreachScreenVert (struct ViewContext *vc, void(*func)(void *userData, struct BMVert *eve, const float screen_co[2], int index), void *userData, const eV3DProjTest clip_flag)
 
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, const eV3DProjTest clip_flag)
 
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, const eV3DProjTest clip_flag)
 
void mesh_foreachScreenFace (struct ViewContext *vc, void(*func)(void *userData, struct BMFace *efa, const float screen_co[2], int index), void *userData, const eV3DProjTest clip_flag)
 
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, const eV3DProjTest clip_flag)
 
void mball_foreachScreenElem (struct ViewContext *vc, void(*func)(void *userData, struct MetaElem *ml, const float screen_co[2]), void *userData, const eV3DProjTest clip_flag)
 
void lattice_foreachScreenVert (struct ViewContext *vc, void(*func)(void *userData, struct BPoint *bp, const float screen_co[2]), void *userData, const eV3DProjTest clip_flag)
 
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, const eV3DProjTest clip_flag)
 
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, const eV3DProjTest clip_flag)
 
void ED_view3d_project_float_v2_m4 (const struct ARegion *region, const float co[3], float r_co[2], float mat[4][4])
 
void ED_view3d_project_float_v3_m4 (const struct ARegion *region, const float co[3], float r_co[3], float mat[4][4])
 
eV3DProjStatus ED_view3d_project_base (const struct ARegion *region, struct Base *base)
 
eV3DProjStatus ED_view3d_project_short_ex (const struct ARegion *region, float perspmat[4][4], const bool is_local, const float co[3], short r_co[2], const eV3DProjTest flag)
 
eV3DProjStatus ED_view3d_project_short_global (const struct ARegion *region, const float co[3], short r_co[2], const eV3DProjTest flag)
 
eV3DProjStatus ED_view3d_project_short_object (const struct ARegion *region, const float co[3], short r_co[2], const eV3DProjTest flag)
 
eV3DProjStatus ED_view3d_project_int_ex (const struct ARegion *region, float perspmat[4][4], const bool is_local, const float co[3], int r_co[2], const eV3DProjTest flag)
 
eV3DProjStatus ED_view3d_project_int_global (const struct ARegion *region, const float co[3], int r_co[2], const eV3DProjTest flag)
 
eV3DProjStatus ED_view3d_project_int_object (const struct ARegion *region, const float co[3], int r_co[2], const eV3DProjTest flag)
 
eV3DProjStatus ED_view3d_project_float_ex (const struct ARegion *region, float perspmat[4][4], const bool is_local, const float co[3], float r_co[2], const eV3DProjTest flag)
 
eV3DProjStatus ED_view3d_project_float_global (const struct ARegion *region, const float co[3], float r_co[2], const eV3DProjTest flag)
 
eV3DProjStatus ED_view3d_project_float_object (const struct ARegion *region, const float co[3], float r_co[2], const eV3DProjTest flag)
 
float ED_view3d_pixel_size (const struct RegionView3D *rv3d, const float co[3])
 
float ED_view3d_pixel_size_no_ui_scale (const struct RegionView3D *rv3d, const float co[3])
 
float ED_view3d_calc_zfac (const struct RegionView3D *rv3d, const float co[3], bool *r_flip)
 
bool ED_view3d_clip_segment (const struct RegionView3D *rv3d, float ray_start[3], float ray_end[3])
 
bool ED_view3d_win_to_ray_clipped (struct Depsgraph *depsgraph, const struct ARegion *region, const struct View3D *v3d, const float mval[2], float ray_start[3], float ray_normal[3], const bool do_clip)
 
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)
 
void ED_view3d_win_to_ray (const struct ARegion *region, const float mval[2], float r_ray_start[3], float r_ray_normal[3])
 
void ED_view3d_global_to_vector (const struct RegionView3D *rv3d, const float coord[3], float vec[3])
 
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])
 
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])
 
bool ED_view3d_win_to_3d_on_plane (const struct ARegion *region, const float plane[4], const float mval[2], const bool do_clip, float r_out[3])
 
bool ED_view3d_win_to_3d_on_plane_with_fallback (const struct ARegion *region, const float plane[4], const float mval[2], const bool do_clip, const float plane_fallback[4], float r_out[3])
 
bool ED_view3d_win_to_3d_on_plane_int (const struct ARegion *region, const float plane[4], const int mval[2], const bool do_clip, float r_out[3])
 
void ED_view3d_win_to_delta (const struct ARegion *region, const float mval[2], float out[3], const float zfac)
 
void ED_view3d_win_to_origin (const struct ARegion *region, const float mval[2], float out[3])
 
void ED_view3d_win_to_vector (const struct ARegion *region, const float mval[2], float out[3])
 
bool ED_view3d_win_to_segment_clipped (struct Depsgraph *depsgraph, const struct ARegion *region, struct View3D *v3d, const float mval[2], float r_ray_start[3], float r_ray_end[3], const bool do_clip)
 
void ED_view3d_ob_project_mat_get (const struct RegionView3D *v3d, struct Object *ob, float r_pmat[4][4])
 
void ED_view3d_ob_project_mat_get_from_obmat (const struct RegionView3D *rv3d, const float obmat[4][4], float r_pmat[4][4])
 
void ED_view3d_project (const struct ARegion *region, const float world[3], float r_region_co[3])
 
bool ED_view3d_unproject (const struct ARegion *region, float regionx, float regiony, float regionz, float world[3])
 
void ED_view3d_dist_range_get (const struct View3D *v3d, float r_dist_range[2])
 
bool ED_view3d_clip_range_get (struct Depsgraph *depsgraph, const struct View3D *v3d, const struct RegionView3D *rv3d, float *r_clipsta, float *r_clipend, const bool use_ortho_factor)
 
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)
 
void ED_view3d_polygon_offset (const struct RegionView3D *rv3d, const float dist)
 
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, const bool no_shift)
 
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])
 
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_clipping_calc_from_boundbox (float clip[6][4], const struct BoundBox *clipbb, const bool is_flip)
 
void ED_view3d_clipping_calc (struct BoundBox *bb, float planes[4][4], const struct ARegion *region, const struct Object *ob, const struct rcti *rect)
 
bool ED_view3d_clipping_clamp_minmax (const struct RegionView3D *rv3d, float min[3], float max[3])
 
void ED_view3d_clipping_local (struct RegionView3D *rv3d, const float mat[4][4])
 
bool ED_view3d_clipping_test (const struct RegionView3D *rv3d, const float co[3], const bool is_local)
 
float ED_view3d_radius_to_dist_persp (const float angle, const float radius)
 
float ED_view3d_radius_to_dist_ortho (const float lens, const float radius)
 
float ED_view3d_radius_to_dist (const struct View3D *v3d, const struct ARegion *region, const struct Depsgraph *depsgraph, const char persp, const bool use_aspect, const float radius)
 
void imm_drawcircball (const float cent[3], float rad, const float tmat[4][4], unsigned int pos)
 
void ED_view3d_backbuf_depth_validate (struct ViewContext *vc)
 
int ED_view3d_backbuf_sample_size_clamp (struct ARegion *region, const float dist)
 
void ED_view3d_select_id_validate (struct ViewContext *vc)
 
bool ED_view3d_autodist (struct Depsgraph *depsgraph, struct ARegion *region, struct View3D *v3d, const int mval[2], float mouse_worldloc[3], const bool alphaoverride, const float fallback_depth_pt[3])
 
bool ED_view3d_autodist_simple (struct ARegion *region, const int mval[2], float mouse_worldloc[3], int margin, const float *force_depth)
 
bool ED_view3d_autodist_depth (struct ARegion *region, const int mval[2], int margin, float *depth)
 
bool ED_view3d_autodist_depth_seg (struct ARegion *region, const int mval_sta[2], const int mval_end[2], int margin, float *depth)
 
eV3DSelectObjectFilter ED_view3d_select_filter_from_mode (const struct Scene *scene, const struct Object *obact)
 
void view3d_opengl_select_cache_begin (void)
 
void view3d_opengl_select_cache_end (void)
 
int view3d_opengl_select (struct ViewContext *vc, unsigned int *buffer, unsigned int bufsize, const struct rcti *input, eV3DSelectMode select_mode, eV3DSelectObjectFilter select_filter)
 
int view3d_opengl_select_with_id_filter (struct ViewContext *vc, unsigned int *buffer, unsigned int bufsize, const struct rcti *input, eV3DSelectMode select_mode, eV3DSelectObjectFilter select_filter, uint select_id)
 
float ED_view3d_select_dist_px (void)
 
void ED_view3d_viewcontext_init (struct bContext *C, struct ViewContext *vc, struct Depsgraph *depsgraph)
 
void ED_view3d_viewcontext_init_object (struct ViewContext *vc, struct Object *obact)
 
void view3d_operator_needs_opengl (const struct bContext *C)
 
void view3d_region_operator_needs_opengl (struct wmWindow *win, struct ARegion *region)
 
bool edge_inside_circle (const float cent[2], float radius, const float screen_co_a[2], const float screen_co_b[2])
 
struct RegionView3DED_view3d_context_rv3d (struct bContext *C)
 
bool ED_view3d_context_user_region (struct bContext *C, struct View3D **r_v3d, struct ARegion **r_region)
 
bool ED_view3d_area_user_region (const struct ScrArea *area, const struct View3D *v3d, struct ARegion **r_region)
 
bool ED_operator_rv3d_user_region_poll (struct bContext *C)
 
void ED_view3d_init_mats_rv3d (struct Object *ob, struct RegionView3D *rv3d)
 
void ED_view3d_init_mats_rv3d_gl (struct Object *ob, struct RegionView3D *rv3d)
 
struct RV3DMatrixStoreED_view3d_mats_rv3d_backup (struct RegionView3D *rv3d)
 
void ED_view3d_mats_rv3d_restore (struct RegionView3D *rv3d, struct RV3DMatrixStore *rv3dmat)
 
void ED_draw_object_facemap (struct Depsgraph *depsgraph, struct Object *ob, const float col[4], const int facemap)
 
struct RenderEngineTypeED_view3d_engine_type (const struct Scene *scene, int drawtype)
 
bool ED_view3d_context_activate (struct bContext *C)
 
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)
 
struct BaseED_view3d_give_base_under_cursor (struct bContext *C, const int mval[2])
 
struct ObjectED_view3d_give_object_under_cursor (struct bContext *C, const int mval[2])
 
bool ED_view3d_is_object_under_cursor (struct bContext *C, const int mval[2])
 
void ED_view3d_quadview_update (struct ScrArea *area, struct ARegion *region, bool do_clip)
 
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)
 
bool ED_view3d_quat_from_axis_view (const char view, const char view_axis_roll, float r_quat[4])
 
bool ED_view3d_quat_to_axis_view (const float viewquat[4], const float epsilon, char *r_view, char *r_view_axis_rotation)
 
char ED_view3d_lock_view_from_index (int index)
 
char ED_view3d_axis_view_opposite (char view)
 
bool ED_view3d_lock (struct RegionView3D *rv3d)
 
void ED_view3d_datamask (const struct bContext *C, const struct Scene *scene, const struct View3D *v3d, struct CustomData_MeshMasks *r_cddata_masks)
 
void ED_view3d_screen_datamask (const struct bContext *C, const struct Scene *scene, const struct bScreen *screen, struct CustomData_MeshMasks *r_cddata_masks)
 
bool ED_view3d_offset_lock_check (const struct View3D *v3d, const struct RegionView3D *rv3d)
 
void ED_view3d_persp_switch_from_camera (const struct Depsgraph *depsgraph, struct View3D *v3d, struct RegionView3D *rv3d, const char persp)
 
bool ED_view3d_persp_ensure (const struct Depsgraph *depsgraph, struct View3D *v3d, struct ARegion *region)
 
bool ED_view3d_camera_lock_check (const struct View3D *v3d, const struct RegionView3D *rv3d)
 
void ED_view3d_camera_lock_init_ex (const struct Depsgraph *depsgraph, struct View3D *v3d, struct RegionView3D *rv3d, const bool calc_dist)
 
void ED_view3d_camera_lock_init (const struct Depsgraph *depsgraph, struct View3D *v3d, struct RegionView3D *rv3d)
 
bool ED_view3d_camera_lock_sync (const struct Depsgraph *depsgraph, struct View3D *v3d, struct RegionView3D *rv3d)
 
bool ED_view3d_camera_autokey (const struct Scene *scene, struct ID *id_key, struct bContext *C, const bool do_rotate, const bool do_translate)
 
bool ED_view3d_camera_lock_autokey (struct View3D *v3d, struct RegionView3D *rv3d, struct bContext *C, const bool do_rotate, const bool do_translate)
 
void ED_view3d_lock_clear (struct View3D *v3d)
 
float ED_view3d_offset_distance (const float mat[4][4], const float ofs[3], const float fallback_dist)
 
void ED_view3d_distance_set (struct RegionView3D *rv3d, const float dist)
 
bool ED_view3d_distance_set_from_location (struct RegionView3D *rv3d, const float dist_co[3], const float dist_min)
 
float ED_scene_grid_scale (const struct Scene *scene, const char **r_grid_unit)
 
float ED_view3d_grid_scale (const struct Scene *scene, struct View3D *v3d, const char **r_grid_unit)
 
void ED_view3d_grid_steps (const struct Scene *scene, struct View3D *v3d, struct RegionView3D *rv3d, float *r_grid_steps)
 
float ED_view3d_grid_view_scale (struct Scene *scene, struct View3D *v3d, struct ARegion *region, const char **r_grid_unit)
 
void ED_scene_draw_fps (const struct Scene *scene, int xoffset, int *yoffset)
 
void ED_view3d_stop_render_preview (struct wmWindowManager *wm, struct ARegion *region)
 
void ED_view3d_shade_update (struct Main *bmain, struct View3D *v3d, struct ScrArea *area)
 
void ED_view3d_draw_bgpic_test (const struct Scene *scene, struct Depsgraph *depsgraph, struct ARegion *region, struct View3D *v3d, const bool do_foreground, const bool do_camera_frame)
 
void ED_view3d_gizmo_mesh_preselect_get_active (struct bContext *C, struct wmGizmo *gz, struct Base **r_base, struct BMElem **r_ele)
 
void ED_view3d_buttons_region_layout_ex (const struct bContext *C, struct ARegion *region, const char *category_override)
 
bool ED_view3d_local_collections_set (struct Main *bmain, struct View3D *v3d)
 
void ED_view3d_local_collections_reset (struct bContext *C, const bool reset_all)
 

Macro Definition Documentation

◆ ED_view3d_check_mats_rv3d

#define ED_view3d_check_mats_rv3d (   rv3d)    (void)(rv3d)

Definition at line 583 of file ED_view3d.h.

◆ ED_view3d_clear_mats_rv3d

#define ED_view3d_clear_mats_rv3d (   rv3d)    (void)(rv3d)

Definition at line 582 of file ED_view3d.h.

◆ IS_CLIPPED

#define IS_CLIPPED   12000

Definition at line 172 of file ED_view3d.h.

◆ MAXPICKBUF

#define MAXPICKBUF   (4 * MAXPICKELEMS)

Definition at line 511 of file ED_view3d.h.

◆ MAXPICKELEMS

#define MAXPICKELEMS   2500

Definition at line 510 of file ED_view3d.h.

◆ V3D_PROJ_TEST_ALL

Definition at line 203 of file ED_view3d.h.

◆ V3D_PROJ_TEST_CLIP_DEFAULT

#define V3D_PROJ_TEST_CLIP_DEFAULT    (V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_WIN | V3D_PROJ_TEST_CLIP_NEAR)

Definition at line 201 of file ED_view3d.h.

◆ VIEW3D_DIST_FALLBACK

#define VIEW3D_DIST_FALLBACK   1.0f

Definition at line 676 of file ED_view3d.h.

◆ VIEW3D_MARGIN

#define VIEW3D_MARGIN   1.4f

Definition at line 675 of file ED_view3d.h.

◆ XRAY_ACTIVE

#define XRAY_ACTIVE (   v3d)    (XRAY_ENABLED(v3d) && ((v3d)->shading.type < OB_MATERIAL))

Definition at line 711 of file ED_view3d.h.

◆ XRAY_ALPHA

#define XRAY_ALPHA (   v3d)     (((v3d)->shading.type == OB_WIRE) ? (v3d)->shading.xray_alpha_wire : (v3d)->shading.xray_alpha)

Definition at line 705 of file ED_view3d.h.

◆ XRAY_ENABLED

#define XRAY_ENABLED (   v3d)    (XRAY_FLAG_ENABLED(v3d) && (XRAY_ALPHA(v3d) < 1.0f))

Definition at line 710 of file ED_view3d.h.

◆ XRAY_FLAG

#define XRAY_FLAG (   v3d)     (((v3d)->shading.type == OB_WIRE) ? V3D_SHADING_XRAY_WIREFRAME : V3D_SHADING_XRAY)

Definition at line 707 of file ED_view3d.h.

◆ XRAY_FLAG_ENABLED

#define XRAY_FLAG_ENABLED (   v3d)    (((v3d)->shading.flag & XRAY_FLAG(v3d)) != 0)

Definition at line 709 of file ED_view3d.h.

Typedef Documentation

◆ ViewContext

typedef struct ViewContext ViewContext

◆ ViewDepths

typedef struct ViewDepths ViewDepths

Enumeration Type Documentation

◆ eV3DCursorOrient

Enumerator
V3D_CURSOR_ORIENT_NONE 
V3D_CURSOR_ORIENT_VIEW 
V3D_CURSOR_ORIENT_XFORM 
V3D_CURSOR_ORIENT_GEOM 

Definition at line 98 of file ED_view3d.h.

◆ eV3DDepthOverrideMode

Enumerator
V3D_DEPTH_NO_GPENCIL 
V3D_DEPTH_GPENCIL_ONLY 
V3D_DEPTH_OBJECT_ONLY 

Definition at line 147 of file ED_view3d.h.

◆ eV3DProjStatus

Enumerator
V3D_PROJ_RET_OK 
V3D_PROJ_RET_CLIP_NEAR 

can't avoid this when in perspective mode, (can't avoid)

V3D_PROJ_RET_CLIP_FAR 

After clip_end.

V3D_PROJ_RET_CLIP_ZERO 

so close to zero we can't apply a perspective matrix usefully

V3D_PROJ_RET_CLIP_BB 

bounding box clip - RV3D_CLIPPING

V3D_PROJ_RET_CLIP_WIN 

outside window bounds

V3D_PROJ_RET_OVERFLOW 

outside range (mainly for short), (can't avoid)

Definition at line 175 of file ED_view3d.h.

◆ eV3DProjTest

Enumerator
V3D_PROJ_TEST_NOP 
V3D_PROJ_TEST_CLIP_BB 
V3D_PROJ_TEST_CLIP_WIN 
V3D_PROJ_TEST_CLIP_NEAR 
V3D_PROJ_TEST_CLIP_FAR 
V3D_PROJ_TEST_CLIP_ZERO 

Definition at line 192 of file ED_view3d.h.

◆ eV3DSelectMode

Enumerator
VIEW3D_SELECT_ALL 
VIEW3D_SELECT_PICK_ALL 
VIEW3D_SELECT_PICK_NEAREST 

Definition at line 513 of file ED_view3d.h.

◆ eV3DSelectObjectFilter

Enumerator
VIEW3D_SELECT_FILTER_NOP 

Don't exclude anything.

VIEW3D_SELECT_FILTER_OBJECT_MODE_LOCK 

Don't select objects outside the current mode.

VIEW3D_SELECT_FILTER_WPAINT_POSE_MODE_LOCK 

A version of VIEW3D_SELECT_FILTER_OBJECT_MODE_LOCK that allows pose-bone selection.

Definition at line 522 of file ED_view3d.h.

Function Documentation

◆ armature_foreachScreenBone()

void armature_foreachScreenBone ( struct ViewContext vc,
void(*)(void *userData, struct EditBone *ebone, const float screen_co_a[2], const float screen_co_b[2])  func,
void *  userData,
const eV3DProjTest  clip_flag 
)

◆ ED_draw_object_facemap()

void ED_draw_object_facemap ( struct Depsgraph depsgraph,
struct Object ob,
const float  col[4],
const int  facemap 
)

◆ ED_operator_rv3d_user_region_poll()

bool ED_operator_rv3d_user_region_poll ( struct bContext C)

◆ ED_scene_draw_fps()

void ED_scene_draw_fps ( const struct Scene scene,
int  xoffset,
int *  yoffset 
)

◆ ED_scene_grid_scale()

float ED_scene_grid_scale ( const struct Scene scene,
const char **  r_grid_unit 
)

◆ ED_view3d_area_user_region()

bool ED_view3d_area_user_region ( const struct ScrArea area,
const struct View3D v3d,
struct ARegion **  r_region 
)

◆ ED_view3d_autodist()

bool ED_view3d_autodist ( struct Depsgraph depsgraph,
struct ARegion region,
struct View3D v3d,
const int  mval[2],
float  mouse_worldloc[3],
const bool  alphaoverride,
const float  fallback_depth_pt[3] 
)

◆ ED_view3d_autodist_depth()

bool ED_view3d_autodist_depth ( struct ARegion region,
const int  mval[2],
int  margin,
float depth 
)

◆ ED_view3d_autodist_depth_seg()

bool ED_view3d_autodist_depth_seg ( struct ARegion region,
const int  mval_sta[2],
const int  mval_end[2],
int  margin,
float depth 
)

◆ ED_view3d_autodist_simple()

bool ED_view3d_autodist_simple ( struct ARegion region,
const int  mval[2],
float  mouse_worldloc[3],
int  margin,
const float force_depth 
)

◆ ED_view3d_axis_view_opposite()

char ED_view3d_axis_view_opposite ( char  view)

◆ ED_view3d_backbuf_depth_validate()

void ED_view3d_backbuf_depth_validate ( struct ViewContext vc)

◆ ED_view3d_backbuf_sample_size_clamp()

int ED_view3d_backbuf_sample_size_clamp ( ARegion region,
const float  dist 
)

allow for small values [0.5 - 2.5], and large values, FLT_MAX by clamping by the area size

Definition at line 2201 of file view3d_draw.c.

References ceilf, max_ii(), min_ff(), and ARegion::winx.

Referenced by EDBM_edge_find_nearest_ex(), EDBM_face_find_nearest_ex(), and EDBM_vert_find_nearest_ex().

◆ ED_view3d_background_color_get()

void ED_view3d_background_color_get ( const struct Scene scene,
const struct View3D v3d,
float  r_color[3] 
)

◆ ED_view3d_buttons_region_layout_ex()

void ED_view3d_buttons_region_layout_ex ( const struct bContext C,
struct ARegion region,
const char *  category_override 
)

◆ ED_view3d_calc_camera_border()

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,
const bool  no_shift 
)

◆ ED_view3d_calc_camera_border_size()

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] 
)

◆ ED_view3d_calc_render_border()

bool ED_view3d_calc_render_border ( const struct Scene scene,
struct Depsgraph depsgraph,
struct View3D v3d,
struct ARegion region,
struct rcti rect 
)

◆ ED_view3d_calc_zfac()

float ED_view3d_calc_zfac ( const struct RegionView3D rv3d,
const float  co[3],
bool *  r_flip 
)

◆ ED_view3d_camera_autokey()

bool ED_view3d_camera_autokey ( const struct Scene scene,
struct ID id_key,
struct bContext C,
const bool  do_rotate,
const bool  do_translate 
)

◆ ED_view3d_camera_data_get()

struct Camera* ED_view3d_camera_data_get ( struct View3D v3d,
struct RegionView3D rv3d 
)

◆ ED_view3d_camera_lock_autokey()

bool ED_view3d_camera_lock_autokey ( View3D v3d,
RegionView3D rv3d,
struct bContext C,
const bool  do_rotate,
const bool  do_translate 
)

Call after modifying a locked view.

Note
Not every view edit currently auto-keys (num-pad for eg), this is complicated because of smooth-view.

Definition at line 710 of file view3d_utils.c.

References C, View3D::camera, CTX_data_scene(), ED_view3d_camera_autokey(), ED_view3d_camera_lock_check(), Object::id, OB_TRANSFORM_ADJUST_ROOT_PARENT_FOR_VIEW_LOCK, Object::parent, scene, and Object::transflag.

Referenced by view3d_smoothview_apply(), viewdolly_modal(), viewmove_modal(), viewroll_modal(), viewrotate_modal(), viewzoom_exec(), viewzoom_invoke(), and viewzoom_modal().

◆ ED_view3d_camera_lock_check()

bool ED_view3d_camera_lock_check ( const struct View3D v3d,
const struct RegionView3D rv3d 
)

◆ ED_view3d_camera_lock_init()

void ED_view3d_camera_lock_init ( const struct Depsgraph depsgraph,
struct View3D v3d,
struct RegionView3D rv3d 
)

◆ ED_view3d_camera_lock_init_ex()

void ED_view3d_camera_lock_init_ex ( const struct Depsgraph depsgraph,
struct View3D v3d,
struct RegionView3D rv3d,
const bool  calc_dist 
)

◆ ED_view3d_camera_lock_sync()

bool ED_view3d_camera_lock_sync ( const struct Depsgraph depsgraph,
struct View3D v3d,
struct RegionView3D rv3d 
)

◆ ED_view3d_camera_to_view_selected()

bool ED_view3d_camera_to_view_selected ( struct Main bmain,
struct Depsgraph depsgraph,
const struct Scene scene,
struct Object camera_ob 
)

◆ ED_view3d_clip_range_get()

bool ED_view3d_clip_range_get ( struct Depsgraph depsgraph,
const struct View3D v3d,
const struct RegionView3D rv3d,
float r_clipsta,
float r_clipend,
const bool  use_ortho_factor 
)

◆ ED_view3d_clip_segment()

bool ED_view3d_clip_segment ( const struct RegionView3D rv3d,
float  ray_start[3],
float  ray_end[3] 
)

◆ ED_view3d_clipping_calc()

void ED_view3d_clipping_calc ( struct BoundBox bb,
float  planes[4][4],
const struct ARegion region,
const struct Object ob,
const struct rcti rect 
)

◆ ED_view3d_clipping_calc_from_boundbox()

void ED_view3d_clipping_calc_from_boundbox ( float  clip[6][4],
const struct BoundBox clipbb,
const bool  is_flip 
)

Referenced by calc_local_clipping().

◆ ED_view3d_clipping_clamp_minmax()

bool ED_view3d_clipping_clamp_minmax ( const struct RegionView3D rv3d,
float  min[3],
float  max[3] 
)

◆ ED_view3d_clipping_local()

void ED_view3d_clipping_local ( struct RegionView3D rv3d,
const float  mat[4][4] 
)

◆ ED_view3d_clipping_test()

bool ED_view3d_clipping_test ( const struct RegionView3D rv3d,
const float  co[3],
const bool  is_local 
)

◆ ED_view3d_context_activate()

bool ED_view3d_context_activate ( struct bContext C)

◆ ED_view3d_context_rv3d()

struct RegionView3D* ED_view3d_context_rv3d ( struct bContext C)

◆ ED_view3d_context_user_region()

bool ED_view3d_context_user_region ( struct bContext C,
struct View3D **  r_v3d,
struct ARegion **  r_region 
)

◆ ED_view3d_cursor3d_position()

void ED_view3d_cursor3d_position ( struct bContext C,
const int  mval[2],
const bool  use_depth,
float  r_cursor_co[3] 
)

◆ ED_view3d_cursor3d_position_rotation()

void ED_view3d_cursor3d_position_rotation ( struct bContext C,
const int  mval[2],
const bool  use_depth,
enum eV3DCursorOrient  orientation,
float  r_cursor_co[3],
float  r_cursor_quat[4] 
)

◆ ED_view3d_cursor3d_update()

void ED_view3d_cursor3d_update ( struct bContext C,
const int  mval[2],
const bool  use_depth,
enum eV3DCursorOrient  orientation 
)

◆ ED_view3d_datamask()

void ED_view3d_datamask ( const struct bContext C,
const struct Scene scene,
const struct View3D v3d,
struct CustomData_MeshMasks r_cddata_masks 
)

◆ ED_view3d_depth_override()

void ED_view3d_depth_override ( Depsgraph depsgraph,
ARegion region,
View3D v3d,
Object obact,
eV3DDepthOverrideMode  mode,
bool  update_cache 
)

Redraw the viewport depth buffer.

Parameters
modeV3D_DEPTH_NO_GPENCIL - Redraw viewport without Grease Pencil and Annotations. V3D_DEPTH_GPENCIL_ONLY - Redraw viewport with Grease Pencil and Annotations only. V3D_DEPTH_OBJECT_ONLY - Redraw viewport with active object only.
update_cacheIf true, store the entire depth buffer in #rv3d->depths.

Definition at line 2331 of file view3d_draw.c.

References ViewDepths::damaged, DEG_get_evaluated_object(), DEG_get_evaluated_scene(), depsgraph, RegionView3D::depths, DRW_draw_depth_loop(), DRW_draw_depth_loop_gpencil(), DRW_draw_depth_object(), ED_view3d_draw_setup_view(), View3D_Runtime::flag, View3D::flag, G_MAIN, NULL, ARegion::regiondata, RegionView3D::rflag, RGN_TYPE_WINDOW, View3D::runtime, RV3D_ZOFFSET_DISABLED, scene, SPACE_VIEW3D, UI_SetTheme(), UI_Theme_Restore(), UI_Theme_Store(), V3D_DEPTH_GPENCIL_ONLY, V3D_DEPTH_NO_GPENCIL, V3D_DEPTH_OBJECT_ONLY, V3D_RUNTIME_DEPTHBUF_OVERRIDDEN, V3D_SELECT_OUTLINE, view3d_depth_cache_update(), WM_draw_region_get_viewport(), WM_draw_region_viewport_bind(), WM_draw_region_viewport_ensure(), and WM_draw_region_viewport_unbind().

Referenced by annotation_paint_strokeend(), annotation_stroke_addpoint(), annotation_stroke_doeraser(), curve_draw_invoke(), ED_view3d_autodist(), gpencil_get_depth_array(), gpencil_paint_strokeend(), gpencil_point_conversion_init(), gpencil_primitive_update_strokes(), gpencil_stroke_doeraser(), object_transform_axis_target_invoke(), PE_set_view3d_data(), and view3d_zoom_border_exec().

◆ ED_view3d_depth_read_cached()

bool ED_view3d_depth_read_cached ( const ViewDepths vd,
const int  mval[2],
int  margin,
float r_depth 
)

◆ ED_view3d_depth_read_cached_normal()

bool ED_view3d_depth_read_cached_normal ( const ViewContext vc,
const int  mval[2],
float  r_normal[3] 
)

◆ ED_view3d_depth_tag_update()

void ED_view3d_depth_tag_update ( struct RegionView3D rv3d)

◆ ED_view3d_depth_unproject()

bool ED_view3d_depth_unproject ( const struct ARegion region,
const int  mval[2],
const double  depth,
float  r_location_world[3] 
)

◆ ED_view3d_dist_range_get()

void ED_view3d_dist_range_get ( const struct View3D v3d,
float  r_dist_range[2] 
)

◆ ED_view3d_distance_set()

void ED_view3d_distance_set ( RegionView3D rv3d,
const float  dist 
)

Set the dist without moving the view (compensate with RegionView3D.ofs)

Note
take care that viewinv is up to date, ED_view3d_update_viewmat first.

Definition at line 1312 of file view3d_utils.c.

References BLI_assert, copy_v3_fl3(), RegionView3D::dist, invert_qt_qt_normalized(), mul_mat3_m4_v3(), mul_qt_v3(), RegionView3D::ofs, sub_v3_v3(), RegionView3D::viewinv, and RegionView3D::viewquat.

Referenced by ED_view3d_cameracontrol_acquire(), and ED_view3d_cameracontrol_release().

◆ ED_view3d_distance_set_from_location()

bool ED_view3d_distance_set_from_location ( RegionView3D rv3d,
const float  dist_co[3],
const float  dist_min 
)

Change the distance & offset to match the depth of dist_co along the view axis.

Parameters
dist_coA world-space location to use for the new depth.
dist_minResulting distances below this will be ignored.
Returns
Success if the distance was set.

Definition at line 1339 of file view3d_utils.c.

References RegionView3D::dist, dot_v3v3(), invert_qt_qt_normalized(), madd_v3_v3fl(), mul_qt_v3(), negate_v3_v3(), RegionView3D::ofs, sub_v3_v3v3(), and RegionView3D::viewquat.

◆ ED_view3d_draw_bgpic_test()

void ED_view3d_draw_bgpic_test ( const struct Scene scene,
struct Depsgraph depsgraph,
struct ARegion region,
struct View3D v3d,
const bool  do_foreground,
const bool  do_camera_frame 
)

◆ ED_view3d_draw_setup_view()

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 
)

◆ ED_view3d_engine_type()

struct RenderEngineType* ED_view3d_engine_type ( const struct Scene scene,
int  drawtype 
)

◆ ED_view3d_from_m4()

void ED_view3d_from_m4 ( const float  mat[4][4],
float  ofs[3],
float  quat[4],
const float dist 
)

Set the view transformation from a 4x4 matrix.

Parameters
matThe view 4x4 transformation matrix to assign.
ofsThe view offset, normally from RegionView3D.ofs.
quatThe view rotation, quaternion normally from RegionView3D.viewquat.
distThe view distance from ofs, normally from RegionView3D.dist.

Definition at line 1505 of file view3d_utils.c.

References BLI_assert, copy_m3_m4(), invert_qt_normalized(), madd_v3_v3fl(), mat3_normalized_to_quat(), negate_v3_v3(), normalize_m3(), and NULL.

Referenced by ED_view3d_from_object(), and object_apply_mat4_with_protect().

◆ ED_view3d_from_object()

void ED_view3d_from_object ( const struct Object ob,
float  ofs[3],
float  quat[4],
float dist,
float lens 
)

◆ ED_view3d_give_base_under_cursor()

struct Base* ED_view3d_give_base_under_cursor ( struct bContext C,
const int  mval[2] 
)

◆ ED_view3d_give_object_under_cursor()

struct Object* ED_view3d_give_object_under_cursor ( struct bContext C,
const int  mval[2] 
)

◆ ED_view3d_gizmo_mesh_preselect_get_active()

void ED_view3d_gizmo_mesh_preselect_get_active ( struct bContext C,
struct wmGizmo gz,
struct Base **  r_base,
struct BMElem **  r_ele 
)

◆ ED_view3d_global_to_vector()

void ED_view3d_global_to_vector ( const struct RegionView3D rv3d,
const float  coord[3],
float  vec[3] 
)

◆ ED_view3d_grid_scale()

float ED_view3d_grid_scale ( const struct Scene scene,
struct View3D v3d,
const char **  r_grid_unit 
)

◆ ED_view3d_grid_steps()

void ED_view3d_grid_steps ( const struct Scene scene,
struct View3D v3d,
struct RegionView3D rv3d,
float r_grid_steps 
)

Referenced by OVERLAY_grid_init().

◆ ED_view3d_grid_view_scale()

float ED_view3d_grid_view_scale ( struct Scene scene,
struct View3D v3d,
struct ARegion region,
const char **  r_grid_unit 
)

◆ ED_view3d_has_workbench_in_texture_color()

bool ED_view3d_has_workbench_in_texture_color ( const struct Scene scene,
const struct Object ob,
const struct View3D v3d 
)

◆ ED_view3d_init_mats_rv3d()

void ED_view3d_init_mats_rv3d ( struct Object ob,
struct RegionView3D rv3d 
)

◆ ED_view3d_init_mats_rv3d_gl()

void ED_view3d_init_mats_rv3d_gl ( struct Object ob,
struct RegionView3D rv3d 
)

Definition at line 200 of file space_view3d.c.

References ED_view3d_init_mats_rv3d(), GPU_matrix_mul, and Object::obmat.

◆ ED_view3d_is_object_under_cursor()

bool ED_view3d_is_object_under_cursor ( struct bContext C,
const int  mval[2] 
)

Definition at line 2198 of file view3d_select.c.

References C, ED_view3d_give_object_under_cursor(), and NULL.

Referenced by view3d_ima_bg_drop_poll().

◆ ED_view3d_lastview_store()

void ED_view3d_lastview_store ( RegionView3D rv3d)

◆ ED_view3d_local_collections_reset()

void ED_view3d_local_collections_reset ( struct bContext C,
const bool  reset_all 
)

◆ ED_view3d_local_collections_set()

bool ED_view3d_local_collections_set ( Main bmain,
struct View3D v3d 
)

See if current uuid is valid, otherwise set a valid uuid to v3d, Try to keep the same uuid previously used to allow users to quickly toggle back and forth.

Definition at line 1637 of file view3d_view.c.

References View3D::flag, free_localcollection_bit(), View3D::local_collections_uuid, reset(), V3D_LOCAL_COLLECTIONS, and view3d_local_collections_reset().

◆ ED_view3d_lock()

bool ED_view3d_lock ( struct RegionView3D rv3d)

◆ ED_view3d_lock_clear()

void ED_view3d_lock_clear ( struct View3D v3d)

◆ ED_view3d_lock_view_from_index()

char ED_view3d_lock_view_from_index ( int  index)

◆ ED_view3d_mats_rv3d_backup()

struct RV3DMatrixStore* ED_view3d_mats_rv3d_backup ( struct RegionView3D rv3d)

◆ ED_view3d_mats_rv3d_restore()

void ED_view3d_mats_rv3d_restore ( struct RegionView3D rv3d,
struct RV3DMatrixStore rv3dmat 
)

◆ ED_view3d_ob_project_mat_get()

void ED_view3d_ob_project_mat_get ( const struct RegionView3D v3d,
struct Object ob,
float  r_pmat[4][4] 
)

◆ ED_view3d_ob_project_mat_get_from_obmat()

void ED_view3d_ob_project_mat_get_from_obmat ( const struct RegionView3D rv3d,
const float  obmat[4][4],
float  r_pmat[4][4] 
)

◆ ED_view3d_offset_distance()

float ED_view3d_offset_distance ( const float  mat[4][4],
const float  ofs[3],
const float  fallback_dist 
)

This function solves the problem of having to switch between camera and non-camera views.

When viewing from the perspective of mat, and having the view center ofs, this calculates a distance from ofs to the matrix mat. Using fallback_dist when the distance would be too small.

Parameters
matA matrix use for the view-point (typically the camera objects matrix).
ofsOrbit center (negated), matching RegionView3D.ofs, which is typically passed in.
fallback_distThe distance to use if the object is too near or in front of ofs.
Returns
A newly calculated distance or the fallback.

Definition at line 1286 of file view3d_utils.c.

References add_v3_v3(), dot_v3v3(), mul_m4_v4(), normalize_v3(), and pos.

Referenced by ED_view3d_camera_lock_init_ex(), ED_view3d_persp_switch_from_camera(), and ED_view3d_smooth_view_ex().

◆ ED_view3d_offset_lock_check()

bool ED_view3d_offset_lock_check ( const struct View3D v3d,
const struct RegionView3D rv3d 
)

◆ ED_view3d_persp_ensure()

bool ED_view3d_persp_ensure ( const struct Depsgraph depsgraph,
struct View3D v3d,
struct ARegion region 
)

◆ ED_view3d_persp_switch_from_camera()

void ED_view3d_persp_switch_from_camera ( const struct Depsgraph depsgraph,
struct View3D v3d,
struct RegionView3D rv3d,
const char  persp 
)

◆ ED_view3d_pixel_size()

float ED_view3d_pixel_size ( const struct RegionView3D rv3d,
const float  co[3] 
)

◆ ED_view3d_pixel_size_no_ui_scale()

float ED_view3d_pixel_size_no_ui_scale ( const struct RegionView3D rv3d,
const float  co[3] 
)

◆ ED_view3d_polygon_offset()

void ED_view3d_polygon_offset ( const struct RegionView3D rv3d,
const float  dist 
)

◆ ED_view3d_project()

void ED_view3d_project ( const struct ARegion region,
const float  world[3],
float  r_region_co[3] 
)

◆ ED_view3d_project_base()

eV3DProjStatus ED_view3d_project_base ( const struct ARegion region,
struct Base base 
)

◆ ED_view3d_project_float_ex()

eV3DProjStatus ED_view3d_project_float_ex ( const struct ARegion region,
float  perspmat[4][4],
const bool  is_local,
const float  co[3],
float  r_co[2],
const eV3DProjTest  flag 
)

◆ ED_view3d_project_float_global()

eV3DProjStatus ED_view3d_project_float_global ( const struct ARegion region,
const float  co[3],
float  r_co[2],
const eV3DProjTest  flag 
)

◆ ED_view3d_project_float_object()

eV3DProjStatus ED_view3d_project_float_object ( const struct ARegion region,
const float  co[3],
float  r_co[2],
const eV3DProjTest  flag 
)

◆ ED_view3d_project_float_v2_m4()

void ED_view3d_project_float_v2_m4 ( const struct ARegion region,
const float  co[3],
float  r_co[2],
float  mat[4][4] 
)

◆ ED_view3d_project_float_v3_m4()

void ED_view3d_project_float_v3_m4 ( const struct ARegion region,
const float  co[3],
float  r_co[3],
float  mat[4][4] 
)

◆ ED_view3d_project_int_ex()

eV3DProjStatus ED_view3d_project_int_ex ( const struct ARegion region,
float  perspmat[4][4],
const bool  is_local,
const float  co[3],
int  r_co[2],
const eV3DProjTest  flag 
)

◆ ED_view3d_project_int_global()

eV3DProjStatus ED_view3d_project_int_global ( const struct ARegion region,
const float  co[3],
int  r_co[2],
const eV3DProjTest  flag 
)

◆ ED_view3d_project_int_object()

eV3DProjStatus ED_view3d_project_int_object ( const struct ARegion region,
const float  co[3],
int  r_co[2],
const eV3DProjTest  flag 
)

◆ ED_view3d_project_short_ex()

eV3DProjStatus ED_view3d_project_short_ex ( const struct ARegion region,
float  perspmat[4][4],
const bool  is_local,
const float  co[3],
short  r_co[2],
const eV3DProjTest  flag 
)

Referenced by DRW_text_cache_draw().

◆ ED_view3d_project_short_global()

eV3DProjStatus ED_view3d_project_short_global ( const struct ARegion region,
const float  co[3],
short  r_co[2],
const eV3DProjTest  flag 
)

◆ ED_view3d_project_short_object()

eV3DProjStatus ED_view3d_project_short_object ( const struct ARegion region,
const float  co[3],
short  r_co[2],
const eV3DProjTest  flag 
)

◆ ED_view3d_quadview_update()

void ED_view3d_quadview_update ( struct ScrArea area,
struct ARegion region,
bool  do_clip 
)

◆ ED_view3d_quat_from_axis_view()

bool ED_view3d_quat_from_axis_view ( const char  view,
const char  view_axis_roll,
float  r_quat[4] 
)

◆ ED_view3d_quat_to_axis_view()

bool ED_view3d_quat_to_axis_view ( const float  viewquat[4],
const float  epsilon,
char *  r_view,
char *  r_view_axis_rotation 
)

◆ ED_view3d_radius_to_dist()

float ED_view3d_radius_to_dist ( const struct View3D v3d,
const struct ARegion region,
const struct Depsgraph depsgraph,
const char  persp,
const bool  use_aspect,
const float  radius 
)

◆ ED_view3d_radius_to_dist_ortho()

float ED_view3d_radius_to_dist_ortho ( const float  lens,
const float  radius 
)

Definition at line 1164 of file view3d_utils.c.

References DEFAULT_SENSOR_WIDTH.

Referenced by ED_view3d_radius_to_dist().

◆ ED_view3d_radius_to_dist_persp()

float ED_view3d_radius_to_dist_persp ( const float  angle,
const float  radius 
)

Definition at line 1159 of file view3d_utils.c.

References angle(), and tanf.

Referenced by ED_view3d_radius_to_dist().

◆ ED_view3d_screen_datamask()

void ED_view3d_screen_datamask ( const struct bContext C,
const struct Scene scene,
const struct bScreen screen,
struct CustomData_MeshMasks r_cddata_masks 
)

Referenced by wm_event_do_depsgraph().

◆ ED_view3d_select_dist_px()

float ED_view3d_select_dist_px ( void  )

◆ ED_view3d_select_filter_from_mode()

eV3DSelectObjectFilter ED_view3d_select_filter_from_mode ( const struct Scene scene,
const struct Object obact 
)

◆ ED_view3d_select_id_validate()

void ED_view3d_select_id_validate ( struct ViewContext vc)

◆ ED_view3d_shade_update()

void ED_view3d_shade_update ( struct Main bmain,
struct View3D v3d,
struct ScrArea area 
)

◆ ED_view3d_stop_render_preview()

void ED_view3d_stop_render_preview ( struct wmWindowManager wm,
struct ARegion region 
)

◆ ED_view3d_to_m4()

void ED_view3d_to_m4 ( float  mat[4][4],
const float  ofs[3],
const float  quat[4],
const float  dist 
)

Calculate the view transformation matrix from RegionView3D input. The resulting matrix is equivalent to RegionView3D.viewinv

Parameters
matThe view 4x4 transformation matrix to calculate.
ofsThe view offset, normally from RegionView3D.ofs.
quatThe view rotation, quaternion normally from RegionView3D.viewquat.
distThe view distance from ofs, normally from RegionView3D.dist.

Definition at line 1539 of file view3d_utils.c.

References mul_mat3_m4_v3(), quat_to_mat4(), and sub_v3_v3v3().

Referenced by ED_view3d_camera_lock_sync(), ED_view3d_cameracontrol_acquire(), ED_view3d_cameracontrol_update(), and ED_view3d_to_object().

◆ ED_view3d_to_object()

void ED_view3d_to_object ( const struct Depsgraph depsgraph,
struct Object ob,
const float  ofs[3],
const float  quat[4],
const float  dist 
)

◆ ED_view3d_unproject()

bool ED_view3d_unproject ( const struct ARegion region,
float  regionx,
float  regiony,
float  regionz,
float  world[3] 
)

◆ ED_view3d_update_viewmat()

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 
)

◆ ED_view3d_viewcontext_init()

void ED_view3d_viewcontext_init ( struct bContext C,
struct ViewContext vc,
struct Depsgraph depsgraph 
)

Definition at line 123 of file view3d_select.c.

References ViewContext::bmain, ViewContext::C, C, CTX_data_active_object(), CTX_data_edit_object(), CTX_data_main(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_region(), CTX_wm_region_view3d(), CTX_wm_view3d(), CTX_wm_window(), depsgraph, ViewContext::depsgraph, ViewContext::obact, ViewContext::obedit, ViewContext::region, ViewContext::rv3d, ViewContext::scene, ViewContext::v3d, ViewContext::view_layer, and ViewContext::win.

Referenced by add_vertex_invoke(), clip_planes_from_rect(), curve_draw_init(), ED_armature_edit_deselect_all_visible_multi(), ED_armature_edit_select_pick(), ed_armature_pick_bone_impl(), ED_curve_deselect_all_multi(), ED_curve_editfont_select_pick(), ED_curve_editnurb_select_pick(), ED_lattice_deselect_all_multi(), ED_lattice_select_pick(), ED_mball_deselect_all_multi(), ED_mball_select_pick(), ED_mesh_pick_face(), ED_mesh_pick_vert(), ed_object_select_pick(), ED_pose_deselect_all_multi(), ED_view3d_give_base_under_cursor(), EDBM_mesh_deselect_all_multi(), EDBM_selectmode_disable_multi(), edcu_shortest_path_pick_invoke(), em_setup_viewcontext(), object_transform_axis_target_invoke(), paint_cursor_context_init(), paint_sample_color(), paint_stroke_new(), PE_set_view3d_data(), sample_detail(), SCULPT_cursor_geometry_info_update(), SCULPT_filter_cache_init(), sculpt_gesture_context_init_common(), SCULPT_stroke_get_location(), select_linked_pick_invoke(), texture_paint_init(), view3d_box_select_exec(), view3d_circle_select_exec(), view3d_lasso_select_exec(), view3d_select_exec(), vpaint_stroke_test_start(), weight_paint_sample_enum_itemf(), weight_sample_group_exec(), weight_sample_invoke(), and wpaint_stroke_test_start().

◆ ED_view3d_viewcontext_init_object()

void ED_view3d_viewcontext_init_object ( struct ViewContext vc,
struct Object obact 
)

◆ ED_view3d_viewplane_get()

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 
)

◆ ED_view3d_win_to_3d()

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] 
)

◆ ED_view3d_win_to_3d_int()

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] 
)

◆ ED_view3d_win_to_3d_on_plane()

bool ED_view3d_win_to_3d_on_plane ( const struct ARegion region,
const float  plane[4],
const float  mval[2],
const bool  do_clip,
float  r_out[3] 
)

◆ ED_view3d_win_to_3d_on_plane_int()

bool ED_view3d_win_to_3d_on_plane_int ( const struct ARegion region,
const float  plane[4],
const int  mval[2],
const bool  do_clip,
float  r_out[3] 
)

◆ ED_view3d_win_to_3d_on_plane_with_fallback()

bool ED_view3d_win_to_3d_on_plane_with_fallback ( const struct ARegion region,
const float  plane[4],
const float  mval[2],
const bool  do_clip,
const float  plane_fallback[4],
float  r_out[3] 
)

◆ ED_view3d_win_to_delta()

void ED_view3d_win_to_delta ( const struct ARegion region,
const float  mval[2],
float  out[3],
const float  zfac 
)

◆ ED_view3d_win_to_origin()

void ED_view3d_win_to_origin ( const struct ARegion region,
const float  mval[2],
float  out[3] 
)

◆ ED_view3d_win_to_ray()

void ED_view3d_win_to_ray ( const struct ARegion region,
const float  mval[2],
float  r_ray_start[3],
float  r_ray_normal[3] 
)

◆ ED_view3d_win_to_ray_clipped()

bool ED_view3d_win_to_ray_clipped ( struct Depsgraph depsgraph,
const struct ARegion region,
const struct View3D v3d,
const float  mval[2],
float  ray_start[3],
float  ray_normal[3],
const bool  do_clip 
)

◆ ED_view3d_win_to_ray_clipped_ex()

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 
)

◆ ED_view3d_win_to_segment_clipped()

bool ED_view3d_win_to_segment_clipped ( struct Depsgraph depsgraph,
const struct ARegion region,
struct View3D v3d,
const float  mval[2],
float  r_ray_start[3],
float  r_ray_end[3],
const bool  do_clip 
)

◆ ED_view3d_win_to_vector()

void ED_view3d_win_to_vector ( const struct ARegion region,
const float  mval[2],
float  out[3] 
)

◆ edge_inside_circle()

bool edge_inside_circle ( const float  cent[2],
float  radius,
const float  screen_co_a[2],
const float  screen_co_b[2] 
)

◆ imm_drawcircball()

void imm_drawcircball ( const float  cent[3],
float  rad,
const float  tmat[4][4],
unsigned int  pos 
)

◆ lattice_foreachScreenVert()

void lattice_foreachScreenVert ( struct ViewContext vc,
void(*)(void *userData, struct BPoint *bp, const float screen_co[2])  func,
void *  userData,
const eV3DProjTest  clip_flag 
)

◆ mball_foreachScreenElem()

void mball_foreachScreenElem ( struct ViewContext vc,
void(*)(void *userData, struct MetaElem *ml, const float screen_co[2])  func,
void *  userData,
const eV3DProjTest  clip_flag 
)

◆ mesh_foreachScreenEdge()

void mesh_foreachScreenEdge ( struct ViewContext vc,
void(*)(void *userData, struct BMEdge *eed, const float screen_co_a[2], const float screen_co_b[2], int index)  func,
void *  userData,
const eV3DProjTest  clip_flag 
)

◆ mesh_foreachScreenEdge_clip_bb_segment()

void mesh_foreachScreenEdge_clip_bb_segment ( struct ViewContext vc,
void(*)(void *userData, struct BMEdge *eed, const float screen_co_a[2], const float screen_co_b[2], int index)  func,
void *  userData,
const eV3DProjTest  clip_flag 
)

◆ mesh_foreachScreenFace()

void mesh_foreachScreenFace ( struct ViewContext vc,
void(*)(void *userData, struct BMFace *efa, const float screen_co[2], int index)  func,
void *  userData,
const eV3DProjTest  clip_flag 
)

◆ mesh_foreachScreenVert()

void mesh_foreachScreenVert ( struct ViewContext vc,
void(*)(void *userData, struct BMVert *eve, const float screen_co[2], int index)  func,
void *  userData,
const eV3DProjTest  clip_flag 
)

◆ meshobject_foreachScreenVert()

void meshobject_foreachScreenVert ( struct ViewContext vc,
void(*)(void *userData, struct MVert *eve, const float screen_co[2], int index)  func,
void *  userData,
const eV3DProjTest  clip_flag 
)

◆ nurbs_foreachScreenVert()

void nurbs_foreachScreenVert ( struct ViewContext vc,
void(*)(void *userData, struct Nurb *nu, struct BPoint *bp, struct BezTriple *bezt, int beztindex, bool handle_visible, const float screen_co[2])  func,
void *  userData,
const eV3DProjTest  clip_flag 
)

◆ pose_foreachScreenBone()

void pose_foreachScreenBone ( struct ViewContext vc,
void(*)(void *userData, struct bPoseChannel *pchan, const float screen_co_a[2], const float screen_co_b[2])  func,
void *  userData,
const eV3DProjTest  clip_flag 
)

◆ view3d_opengl_select()

int view3d_opengl_select ( struct ViewContext vc,
unsigned int *  buffer,
unsigned int  bufsize,
const struct rcti input,
eV3DSelectMode  select_mode,
eV3DSelectObjectFilter  select_filter 
)

◆ view3d_opengl_select_cache_begin()

void view3d_opengl_select_cache_begin ( void  )

Optionally cache data for multiple calls to view3d_opengl_select

just avoid GPU_select headers outside this file

Definition at line 892 of file view3d_view.c.

References GPU_select_cache_begin().

Referenced by get_nearest_editbonepoint(), and mixed_bones_object_selectbuffer().

◆ view3d_opengl_select_cache_end()

void view3d_opengl_select_cache_end ( void  )

Definition at line 897 of file view3d_view.c.

References GPU_select_cache_end().

Referenced by get_nearest_editbonepoint(), and mixed_bones_object_selectbuffer().

◆ view3d_opengl_select_with_id_filter()

int view3d_opengl_select_with_id_filter ( struct ViewContext vc,
unsigned int *  buffer,
unsigned int  bufsize,
const struct rcti input,
eV3DSelectMode  select_mode,
eV3DSelectObjectFilter  select_filter,
uint  select_id 
)

◆ view3d_operator_needs_opengl()

void view3d_operator_needs_opengl ( const struct bContext C)

◆ view3d_region_operator_needs_opengl()

void view3d_region_operator_needs_opengl ( struct wmWindow win,
struct ARegion region 
)