Blender V4.3
ED_view3d.hh File Reference

Go to the source code of this file.

Classes

struct  ViewContext
 
struct  ViewDepths
 
struct  V3DSnapCursorData
 
struct  V3DSnapCursorState
 
class  ViewportColorSampleSession
 

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
 
#define V3D_PROJ_TEST_CLIP_CONTENT_DEFAULT
 
#define USE_SNAP_DETECT_FROM_KEYMAP_HACK
 
#define VIEW3D_MARGIN   1.4f
 
#define VIEW3D_DIST_FALLBACK   1.0f
 
#define SHADING_XRAY_ALPHA(shading)    (((shading).type == OB_WIRE) ? (shading).xray_alpha_wire : (shading).xray_alpha)
 
#define SHADING_XRAY_FLAG(shading)    (((shading).type == OB_WIRE) ? V3D_SHADING_XRAY_WIREFRAME : V3D_SHADING_XRAY)
 
#define SHADING_XRAY_FLAG_ENABLED(shading)   (((shading).flag & SHADING_XRAY_FLAG(shading)) != 0)
 
#define SHADING_XRAY_ENABLED(shading)    (SHADING_XRAY_FLAG_ENABLED(shading) && (SHADING_XRAY_ALPHA(shading) < 1.0f))
 
#define SHADING_XRAY_ACTIVE(shading)    (SHADING_XRAY_ENABLED(shading) && ((shading).type < OB_MATERIAL))
 
#define XRAY_ALPHA(v3d)   SHADING_XRAY_ALPHA((v3d)->shading)
 
#define XRAY_FLAG(v3d)   SHADING_XRAY_FLAG((v3d)->shading)
 
#define XRAY_FLAG_ENABLED(v3d)   SHADING_XRAY_FLAG_ENABLED((v3d)->shading)
 
#define XRAY_ENABLED(v3d)   SHADING_XRAY_ENABLED((v3d)->shading)
 
#define XRAY_ACTIVE(v3d)   SHADING_XRAY_ACTIVE((v3d)->shading)
 
#define OVERLAY_RETOPOLOGY_ENABLED(overlay)    (((overlay).edit_flag & V3D_OVERLAY_EDIT_RETOPOLOGY) != 0)
 
#define OVERLAY_RETOPOLOGY_MIN_OFFSET   FLT_EPSILON
 
#define OVERLAY_RETOPOLOGY_OFFSET(overlay)
 
#define RETOPOLOGY_ENABLED(v3d)   (OVERLAY_RETOPOLOGY_ENABLED((v3d)->overlay))
 
#define RETOPOLOGY_OFFSET(v3d)   (OVERLAY_RETOPOLOGY_OFFSET((v3d)->overlay))
 

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_OVERLAYS = 0 , V3D_DEPTH_NO_GPENCIL , V3D_DEPTH_GPENCIL_ONLY , V3D_DEPTH_OBJECT_ONLY ,
  V3D_DEPTH_SELECTED_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) , V3D_PROJ_TEST_CLIP_CONTENT = (1 << 5)
}
 
enum  eV3DSnapCursor {
  V3D_SNAPCURSOR_TOGGLE_ALWAYS_TRUE = 1 << 0 , V3D_SNAPCURSOR_OCCLUSION_ALWAYS_TRUE = 1 << 1 , V3D_SNAPCURSOR_OCCLUSION_ALWAYS_FALSE = 1 << 2 , V3D_SNAPCURSOR_SNAP_EDIT_GEOM_FINAL = 1 << 3 ,
  V3D_SNAPCURSOR_SNAP_EDIT_GEOM_CAGE = 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 Scene *scene, const View3D *v3d, float r_color[3])
 
void ED_view3d_text_colors_get (const Scene *scene, const View3D *v3d, float r_text_color[4], float r_shadow_color[4])
 
bool ED_view3d_has_workbench_in_texture_color (const Scene *scene, const Object *ob, const View3D *v3d)
 
void ED_view3d_cursor3d_position (bContext *C, const int mval[2], bool use_depth, float r_cursor_co[3])
 
void ED_view3d_cursor3d_position_rotation (bContext *C, const int mval[2], bool use_depth, enum eV3DCursorOrient orientation, float r_cursor_co[3], float r_cursor_quat[4])
 
void ED_view3d_cursor3d_update (bContext *C, const int mval[2], bool use_depth, enum eV3DCursorOrient orientation)
 
CameraED_view3d_camera_data_get (View3D *v3d, RegionView3D *rv3d)
 
void ED_view3d_to_m4 (float mat[4][4], const float ofs[3], const float quat[4], float dist)
 
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 Object *ob, float ofs[3], float quat[4], const float *dist, float *lens)
 
void ED_view3d_to_object (const Depsgraph *depsgraph, Object *ob, const float ofs[3], const float quat[4], float dist)
 
bool ED_view3d_camera_to_view_selected (Main *bmain, Depsgraph *depsgraph, const Scene *scene, Object *camera_ob)
 
bool ED_view3d_camera_to_view_selected_with_set_clipping (Main *bmain, Depsgraph *depsgraph, const Scene *scene, Object *camera_ob)
 
void ED_view3d_lastview_store (RegionView3D *rv3d)
 
void ED_view3d_depth_override (Depsgraph *depsgraph, ARegion *region, View3D *v3d, Object *obact, eV3DDepthOverrideMode mode, ViewDepths **r_depths)
 
void ED_view3d_depths_free (ViewDepths *depths)
 
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 ARegion *region, const ViewDepths *depths, const int mval[2], float r_normal[3])
 
bool ED_view3d_depth_unproject_v3 (const ARegion *region, const int mval[2], double depth, float r_location_world[3])
 
bool ED_view3d_has_depth_buffer_updated (const Depsgraph *depsgraph, const View3D *v3d)
 
ViewOpsDataED_view3d_navigation_init (bContext *C, const wmKeyMapItem *kmi_merge)
 
bool ED_view3d_navigation_do (bContext *C, ViewOpsData *vod, const wmEvent *event, const float depth_loc_override[3])
 
void ED_view3d_navigation_free (bContext *C, ViewOpsData *vod)
 
 ENUM_OPERATORS (eV3DProjStatus, V3D_PROJ_RET_OVERFLOW)
 
 ENUM_OPERATORS (eV3DProjTest, V3D_PROJ_TEST_CLIP_CONTENT)
 
bool ED_view3d_snap_selected_to_location (bContext *C, wmOperator *op, const float snap_target_global[3], int pivot_point)
 
void ED_view3d_cursor_snap_state_default_set (V3DSnapCursorState *state)
 
V3DSnapCursorStateED_view3d_cursor_snap_state_active_get ()
 
void ED_view3d_cursor_snap_state_active_set (V3DSnapCursorState *state)
 
V3DSnapCursorStateED_view3d_cursor_snap_state_create ()
 
void ED_view3d_cursor_snap_state_free (V3DSnapCursorState *state)
 
void ED_view3d_cursor_snap_state_prevpoint_set (V3DSnapCursorState *state, const float prev_point[3])
 
void ED_view3d_cursor_snap_data_update (V3DSnapCursorState *state, const bContext *C, const ARegion *region, int x, int y)
 
V3DSnapCursorDataED_view3d_cursor_snap_data_get ()
 
SnapObjectContextED_view3d_cursor_snap_context_ensure (Scene *scene)
 
void ED_view3d_cursor_snap_draw_util (RegionView3D *rv3d, const float source_loc[3], const float target_loc[3], const eSnapMode source_type, const eSnapMode target_type, const uchar source_color[4], const uchar target_color[4])
 
void meshobject_foreachScreenVert (const ViewContext *vc, void(*func)(void *user_data, const float screen_co[2], int index), void *user_data, eV3DProjTest clip_flag)
 
void mesh_foreachScreenVert (const ViewContext *vc, void(*func)(void *user_data, BMVert *eve, const float screen_co[2], int index), void *user_data, eV3DProjTest clip_flag)
 
void mesh_foreachScreenEdge (const ViewContext *vc, void(*func)(void *user_data, BMEdge *eed, const float screen_co_a[2], const float screen_co_b[2], int index), void *user_data, eV3DProjTest clip_flag)
 
void mesh_foreachScreenEdge_clip_bb_segment (const ViewContext *vc, void(*func)(void *user_data, BMEdge *eed, const float screen_co_a[2], const float screen_co_b[2], int index), void *user_data, eV3DProjTest clip_flag)
 
void mesh_foreachScreenFace (const ViewContext *vc, void(*func)(void *user_data, BMFace *efa, const float screen_co[2], int index), void *user_data, eV3DProjTest clip_flag)
 
void nurbs_foreachScreenVert (const ViewContext *vc, void(*func)(void *user_data, Nurb *nu, BPoint *bp, BezTriple *bezt, int beztindex, bool handle_visible, const float screen_co[2]), void *user_data, eV3DProjTest clip_flag)
 
void mball_foreachScreenElem (const ViewContext *vc, void(*func)(void *user_data, MetaElem *ml, const float screen_co[2]), void *user_data, eV3DProjTest clip_flag)
 
void lattice_foreachScreenVert (const ViewContext *vc, void(*func)(void *user_data, BPoint *bp, const float screen_co[2]), void *user_data, eV3DProjTest clip_flag)
 
void armature_foreachScreenBone (const ViewContext *vc, void(*func)(void *user_data, EditBone *ebone, const float screen_co_a[2], const float screen_co_b[2]), void *user_data, eV3DProjTest clip_flag)
 
void pose_foreachScreenBone (const ViewContext *vc, void(*func)(void *user_data, bPoseChannel *pchan, const float screen_co_a[2], const float screen_co_b[2]), void *user_data, eV3DProjTest clip_flag)
 
blender::float2 ED_view3d_project_float_v2_m4 (const ARegion *region, const float co[3], const blender::float4x4 &mat)
 
void ED_view3d_project_float_v3_m4 (const ARegion *region, const float co[3], float r_co[3], const float mat[4][4])
 
eV3DProjStatus ED_view3d_project_base (const ARegion *region, Base *base, float r_co[2])
 
eV3DProjStatus ED_view3d_project_short_ex (const ARegion *region, float perspmat[4][4], bool is_local, const float co[3], short r_co[2], eV3DProjTest flag)
 
eV3DProjStatus ED_view3d_project_short_global (const ARegion *region, const float co[3], short r_co[2], eV3DProjTest flag)
 
eV3DProjStatus ED_view3d_project_short_object (const ARegion *region, const float co[3], short r_co[2], eV3DProjTest flag)
 
eV3DProjStatus ED_view3d_project_int_ex (const ARegion *region, float perspmat[4][4], bool is_local, const float co[3], int r_co[2], eV3DProjTest flag)
 
eV3DProjStatus ED_view3d_project_int_global (const ARegion *region, const float co[3], int r_co[2], eV3DProjTest flag)
 
eV3DProjStatus ED_view3d_project_int_object (const ARegion *region, const float co[3], int r_co[2], eV3DProjTest flag)
 
eV3DProjStatus ED_view3d_project_float_ex (const ARegion *region, float perspmat[4][4], bool is_local, const float co[3], float r_co[2], eV3DProjTest flag)
 
eV3DProjStatus ED_view3d_project_float_global (const ARegion *region, const float co[3], float r_co[2], eV3DProjTest flag)
 
eV3DProjStatus ED_view3d_project_float_object (const ARegion *region, const float co[3], float r_co[2], eV3DProjTest flag)
 
float ED_view3d_pixel_size (const RegionView3D *rv3d, const float co[3])
 
float ED_view3d_pixel_size_no_ui_scale (const RegionView3D *rv3d, const float co[3])
 
float ED_view3d_calc_zfac_ex (const RegionView3D *rv3d, const float co[3], bool *r_flip)
 
float ED_view3d_calc_zfac (const RegionView3D *rv3d, const float co[3])
 
float ED_view3d_calc_depth_for_comparison (const RegionView3D *rv3d, const float co[3])
 
bool ED_view3d_clip_segment (const RegionView3D *rv3d, float ray_start[3], float ray_end[3])
 
bool ED_view3d_win_to_ray_clipped (Depsgraph *depsgraph, const ARegion *region, const View3D *v3d, const float mval[2], float r_ray_start[3], float r_ray_normal[3], bool do_clip_planes)
 
bool ED_view3d_win_to_ray_clipped_ex (Depsgraph *depsgraph, const ARegion *region, const View3D *v3d, const float mval[2], const bool do_clip_planes, float r_ray_co[3], float r_ray_normal[3], float r_ray_start[3], float r_ray_end[3])
 
void ED_view3d_win_to_ray (const ARegion *region, const float mval[2], float r_ray_start[3], float r_ray_normal[3])
 
void ED_view3d_global_to_vector (const RegionView3D *rv3d, const float coord[3], float r_out[3])
 
void ED_view3d_win_to_3d (const View3D *v3d, const ARegion *region, const float depth_pt[3], const float mval[2], float r_out[3])
 
void ED_view3d_win_to_3d_int (const View3D *v3d, const ARegion *region, const float depth_pt[3], const int mval[2], float r_out[3])
 
bool ED_view3d_win_to_3d_on_plane (const ARegion *region, const float plane[4], const float mval[2], bool do_clip, float r_out[3])
 
bool ED_view3d_win_to_3d_on_plane_with_fallback (const ARegion *region, const float plane[4], const float mval[2], bool do_clip, const float plane_fallback[4], float r_out[3])
 
bool ED_view3d_win_to_3d_on_plane_int (const ARegion *region, const float plane[4], const int mval[2], bool do_clip, float r_out[3])
 
void ED_view3d_win_to_delta (const ARegion *region, const float xy_delta[2], float zfac, float r_out[3])
 
void ED_view3d_win_to_origin (const ARegion *region, const float mval[2], float r_out[3])
 
void ED_view3d_win_to_vector (const ARegion *region, const float mval[2], float r_out[3])
 
bool ED_view3d_win_to_segment_clipped (const Depsgraph *depsgraph, const ARegion *region, const View3D *v3d, const float mval[2], float r_ray_start[3], float r_ray_end[3], bool do_clip_planes)
 
blender::float4x4 ED_view3d_ob_project_mat_get (const RegionView3D *rv3d, const Object *ob)
 
blender::float4x4 ED_view3d_ob_project_mat_get_from_obmat (const RegionView3D *rv3d, const blender::float4x4 &obmat)
 
void ED_view3d_project_v3 (const ARegion *region, const float world[3], float r_region_co[3])
 
void ED_view3d_project_v2 (const ARegion *region, const float world[3], float r_region_co[2])
 
bool ED_view3d_unproject_v3 (const ARegion *region, float regionx, float regiony, float regionz, float world[3])
 
void ED_view3d_dist_range_get (const View3D *v3d, float r_dist_range[2])
 
bool ED_view3d_clip_range_get (const Depsgraph *depsgraph, const View3D *v3d, const RegionView3D *rv3d, bool use_ortho_factor, float *r_clip_start, float *r_clip_end)
 
bool ED_view3d_viewplane_get (const Depsgraph *depsgraph, const View3D *v3d, const RegionView3D *rv3d, int winx, int winy, rctf *r_viewplane, float *r_clip_start, float *r_clip_end, float *r_pixsize)
 
void ED_view3d_polygon_offset (const RegionView3D *rv3d, float dist)
 
void ED_view3d_calc_camera_border (const Scene *scene, const Depsgraph *depsgraph, const ARegion *region, const View3D *v3d, const RegionView3D *rv3d, bool no_shift, rctf *r_viewborder)
 
void ED_view3d_calc_camera_border_size (const Scene *scene, Depsgraph *depsgraph, const ARegion *region, const View3D *v3d, const RegionView3D *rv3d, float r_size[2])
 
bool ED_view3d_calc_render_border (const Scene *scene, Depsgraph *depsgraph, View3D *v3d, ARegion *region, rcti *r_rect)
 
void ED_view3d_clipping_calc_from_boundbox (float clip[4][4], const BoundBox *bb, bool is_flip)
 
void ED_view3d_clipping_calc (BoundBox *bb, float planes[4][4], const ARegion *region, const Object *ob, const rcti *rect)
 
bool ED_view3d_clipping_clamp_minmax (const RegionView3D *rv3d, float min[3], float max[3])
 
void ED_view3d_clipping_local (RegionView3D *rv3d, const float mat[4][4])
 
bool ED_view3d_clipping_test (const RegionView3D *rv3d, const float co[3], bool is_local)
 
float ED_view3d_radius_to_dist_persp (float angle, float radius)
 
float ED_view3d_radius_to_dist_ortho (float lens, float radius)
 
float ED_view3d_radius_to_dist (const View3D *v3d, const ARegion *region, const Depsgraph *depsgraph, char persp, bool use_aspect, float radius)
 
int ED_view3d_backbuf_sample_size_clamp (ARegion *region, float dist)
 
void ED_view3d_select_id_validate (const ViewContext *vc)
 
bool ED_view3d_autodist_last_check (wmWindow *win, const wmEvent *event)
 
bool ED_view3d_autodist_last_get (wmWindow *win, float r_ofs[3])
 
void ED_view3d_autodist_last_set (wmWindow *win, const wmEvent *event, const float ofs[3], const bool has_depth)
 
void ED_view3d_autodist_last_clear (wmWindow *win)
 
bool ED_view3d_autodist (ARegion *region, View3D *v3d, const int mval[2], float mouse_worldloc[3], const float fallback_depth_pt[3])
 
bool ED_view3d_autodist_simple (ARegion *region, const int mval[2], float mouse_worldloc[3], int margin, const float *force_depth)
 
bool ED_view3d_depth_read_cached_seg (const ViewDepths *vd, const int mval_sta[2], const int mval_end[2], int margin, float *r_depth)
 
eV3DSelectObjectFilter ED_view3d_select_filter_from_mode (const Scene *scene, const Object *obact)
 
void view3d_opengl_select_cache_begin ()
 
void view3d_opengl_select_cache_end ()
 
int view3d_opengl_select_ex (const ViewContext *vc, GPUSelectBuffer *buffer, const rcti *input, eV3DSelectMode select_mode, eV3DSelectObjectFilter select_filter, bool do_material_slot_selection)
 
int view3d_opengl_select (const ViewContext *vc, GPUSelectBuffer *buffer, const rcti *input, eV3DSelectMode select_mode, eV3DSelectObjectFilter select_filter)
 
int view3d_opengl_select_with_id_filter (const ViewContext *vc, GPUSelectBuffer *buffer, const rcti *input, eV3DSelectMode select_mode, eV3DSelectObjectFilter select_filter, uint select_id)
 
float ED_view3d_select_dist_px ()
 
ViewContext ED_view3d_viewcontext_init (bContext *C, Depsgraph *depsgraph)
 
void ED_view3d_viewcontext_init_object (ViewContext *vc, Object *obact)
 
void view3d_operator_needs_opengl (const bContext *C)
 
void view3d_region_operator_needs_opengl (wmWindow *win, ARegion *region)
 
bool edge_inside_circle (const float cent[2], float radius, const float screen_co_a[2], const float screen_co_b[2])
 
RegionView3DED_view3d_context_rv3d (bContext *C)
 
bool ED_view3d_context_user_region (bContext *C, View3D **r_v3d, ARegion **r_region)
 
bool ED_view3d_area_user_region (const ScrArea *area, const View3D *v3d, ARegion **r_region)
 
bool ED_operator_rv3d_user_region_poll (bContext *C)
 
void ED_view3d_init_mats_rv3d (const Object *ob, RegionView3D *rv3d)
 
void ED_view3d_init_mats_rv3d_gl (const Object *ob, RegionView3D *rv3d)
 
void ED_view3d_clear_mats_rv3d (RegionView3D *rv3d)
 
void ED_view3d_check_mats_rv3d (RegionView3D *rv3d)
 
RV3DMatrixStoreED_view3d_mats_rv3d_backup (RegionView3D *rv3d)
 
void ED_view3d_mats_rv3d_restore (RegionView3D *rv3d, RV3DMatrixStore *rv3dmat)
 
RenderEngineTypeED_view3d_engine_type (const Scene *scene, int drawtype)
 
bool ED_view3d_context_activate (bContext *C)
 
void ED_view3d_draw_setup_view (const wmWindowManager *wm, wmWindow *win, Depsgraph *depsgraph, Scene *scene, ARegion *region, View3D *v3d, const float viewmat[4][4], const float winmat[4][4], const rcti *rect)
 
BaseED_view3d_give_base_under_cursor (bContext *C, const int mval[2])
 
ObjectED_view3d_give_object_under_cursor (bContext *C, const int mval[2])
 
ObjectED_view3d_give_material_slot_under_cursor (bContext *C, const int mval[2], int *r_material_slot)
 
bool ED_view3d_is_object_under_cursor (bContext *C, const int mval[2])
 
void ED_view3d_quadview_update (ScrArea *area, ARegion *region, bool do_clip)
 
void ED_view3d_update_viewmat (const Depsgraph *depsgraph, const Scene *scene, View3D *v3d, ARegion *region, const float viewmat[4][4], const float winmat[4][4], const rcti *rect, bool offscreen)
 
bool ED_view3d_quat_from_axis_view (char view, char view_axis_roll, float r_quat[4])
 
bool ED_view3d_quat_to_axis_view (const float quat[4], float epsilon, char *r_view, char *r_view_axis_roll)
 
bool ED_view3d_quat_to_axis_view_and_reset_quat (float quat[4], float epsilon, char *r_view, char *r_view_axis_roll)
 
char ED_view3d_lock_view_from_index (int index)
 
char ED_view3d_axis_view_opposite (char view)
 
bool ED_view3d_lock (RegionView3D *rv3d)
 
void ED_view3d_datamask (const Scene *scene, ViewLayer *view_layer, const View3D *v3d, CustomData_MeshMasks *r_cddata_masks)
 
void ED_view3d_screen_datamask (const Scene *scene, ViewLayer *view_layer, const bScreen *screen, CustomData_MeshMasks *r_cddata_masks)
 
bool ED_view3d_offset_lock_check (const View3D *v3d, const RegionView3D *rv3d)
 
void ED_view3d_persp_switch_from_camera (const Depsgraph *depsgraph, View3D *v3d, RegionView3D *rv3d, char persp)
 
bool ED_view3d_persp_ensure (const Depsgraph *depsgraph, View3D *v3d, ARegion *region)
 
bool ED_view3d_camera_view_zoom_scale (RegionView3D *rv3d, const float scale)
 
bool ED_view3d_camera_view_pan (ARegion *region, const float event_ofs[2])
 
bool ED_view3d_camera_lock_check (const View3D *v3d, const RegionView3D *rv3d)
 
void ED_view3d_camera_lock_init_ex (const Depsgraph *depsgraph, View3D *v3d, RegionView3D *rv3d, bool calc_dist)
 
void ED_view3d_camera_lock_init (const Depsgraph *depsgraph, View3D *v3d, RegionView3D *rv3d)
 
bool ED_view3d_camera_lock_sync (const Depsgraph *depsgraph, View3D *v3d, RegionView3D *rv3d)
 
bool ED_view3d_camera_autokey (const Scene *scene, ID *id_key, bContext *C, bool do_rotate, bool do_translate)
 
bool ED_view3d_camera_lock_autokey (View3D *v3d, RegionView3D *rv3d, bContext *C, bool do_rotate, bool do_translate)
 
void ED_view3d_lock_clear (View3D *v3d)
 
bool ED_view3d_camera_lock_undo_test (const View3D *v3d, const RegionView3D *rv3d, bContext *C)
 
bool ED_view3d_camera_lock_undo_push (const char *str, const View3D *v3d, const RegionView3D *rv3d, bContext *C)
 
bool ED_view3d_camera_lock_undo_grouped_push (const char *str, const View3D *v3d, const RegionView3D *rv3d, bContext *C)
 
float ED_view3d_offset_distance (const float mat[4][4], const float ofs[3], float fallback_dist)
 
void ED_view3d_distance_set (RegionView3D *rv3d, float dist)
 
bool ED_view3d_distance_set_from_location (RegionView3D *rv3d, const float dist_co[3], float dist_min)
 
float ED_scene_grid_scale (const Scene *scene, const char **r_grid_unit)
 
float ED_view3d_grid_scale (const Scene *scene, const View3D *v3d, const char **r_grid_unit)
 
void ED_view3d_grid_steps (const Scene *scene, const View3D *v3d, const RegionView3D *rv3d, float r_grid_steps[8])
 
float ED_view3d_grid_view_scale (const Scene *scene, const View3D *v3d, const ARegion *region, const char **r_grid_unit)
 
void ED_scene_draw_fps (const Scene *scene, int xoffset, int *yoffset)
 
void ED_view3d_stop_render_preview (wmWindowManager *wm, ARegion *region)
 
void ED_view3d_shade_update (Main *bmain, View3D *v3d, ScrArea *area)
 
void ED_view3d_gizmo_mesh_preselect_get_active (const bContext *C, const wmGizmo *gz, Base **r_base, BMElem **r_ele)
 
void ED_view3d_gizmo_mesh_preselect_clear (wmGizmo *gz)
 
void ED_view3d_buttons_region_layout_ex (const bContext *C, ARegion *region, const char *category_override)
 
bool ED_localview_exit_if_empty (const Depsgraph *depsgraph, Scene *scene, ViewLayer *view_layer, wmWindowManager *wm, wmWindow *win, View3D *v3d, ScrArea *area, bool frame_selected=true, int smooth_viewtx=0)
 
bool ED_view3d_local_collections_set (const Main *bmain, View3D *v3d)
 
void ED_view3d_local_collections_reset (const bContext *C, bool reset_all)
 

Macro Definition Documentation

◆ IS_CLIPPED

◆ OVERLAY_RETOPOLOGY_ENABLED

#define OVERLAY_RETOPOLOGY_ENABLED ( overlay)     (((overlay).edit_flag & V3D_OVERLAY_EDIT_RETOPOLOGY) != 0)

Definition at line 1300 of file ED_view3d.hh.

◆ OVERLAY_RETOPOLOGY_MIN_OFFSET

#define OVERLAY_RETOPOLOGY_MIN_OFFSET   FLT_EPSILON

Definition at line 1306 of file ED_view3d.hh.

◆ OVERLAY_RETOPOLOGY_OFFSET

#define OVERLAY_RETOPOLOGY_OFFSET ( overlay)
Value:
max_ff((overlay).retopology_offset, OVERLAY_RETOPOLOGY_MIN_OFFSET) : \
0.0f)
#define OVERLAY_RETOPOLOGY_ENABLED(overlay)
#define OVERLAY_RETOPOLOGY_MIN_OFFSET

Definition at line 1309 of file ED_view3d.hh.

◆ RETOPOLOGY_ENABLED

#define RETOPOLOGY_ENABLED ( v3d)    (OVERLAY_RETOPOLOGY_ENABLED((v3d)->overlay))

◆ RETOPOLOGY_OFFSET

#define RETOPOLOGY_OFFSET ( v3d)    (OVERLAY_RETOPOLOGY_OFFSET((v3d)->overlay))

◆ SHADING_XRAY_ACTIVE

#define SHADING_XRAY_ACTIVE ( shading)     (SHADING_XRAY_ENABLED(shading) && ((shading).type < OB_MATERIAL))

Definition at line 1284 of file ED_view3d.hh.

◆ SHADING_XRAY_ALPHA

#define SHADING_XRAY_ALPHA ( shading)     (((shading).type == OB_WIRE) ? (shading).xray_alpha_wire : (shading).xray_alpha)

Definition at line 1277 of file ED_view3d.hh.

Referenced by blender::workbench::SceneState::init().

◆ SHADING_XRAY_ENABLED

#define SHADING_XRAY_ENABLED ( shading)     (SHADING_XRAY_FLAG_ENABLED(shading) && (SHADING_XRAY_ALPHA(shading) < 1.0f))

Definition at line 1282 of file ED_view3d.hh.

Referenced by blender::workbench::SceneState::init().

◆ SHADING_XRAY_FLAG

#define SHADING_XRAY_FLAG ( shading)     (((shading).type == OB_WIRE) ? V3D_SHADING_XRAY_WIREFRAME : V3D_SHADING_XRAY)

Definition at line 1279 of file ED_view3d.hh.

◆ SHADING_XRAY_FLAG_ENABLED

#define SHADING_XRAY_FLAG_ENABLED ( shading)    (((shading).flag & SHADING_XRAY_FLAG(shading)) != 0)

Definition at line 1281 of file ED_view3d.hh.

◆ USE_SNAP_DETECT_FROM_KEYMAP_HACK

#define USE_SNAP_DETECT_FROM_KEYMAP_HACK

Definition at line 315 of file ED_view3d.hh.

◆ V3D_PROJ_TEST_ALL

#define V3D_PROJ_TEST_ALL
Value:
@ V3D_PROJ_TEST_CLIP_FAR
Definition ED_view3d.hh:270
@ V3D_PROJ_TEST_CLIP_ZERO
Definition ED_view3d.hh:271
@ V3D_PROJ_TEST_CLIP_CONTENT
Definition ED_view3d.hh:292
#define V3D_PROJ_TEST_CLIP_DEFAULT
Definition ED_view3d.hh:296

Definition at line 298 of file ED_view3d.hh.

Referenced by ed_view3d_project__internal().

◆ V3D_PROJ_TEST_CLIP_CONTENT_DEFAULT

◆ V3D_PROJ_TEST_CLIP_DEFAULT

◆ VIEW3D_DIST_FALLBACK

#define VIEW3D_DIST_FALLBACK   1.0f

◆ VIEW3D_MARGIN

#define VIEW3D_MARGIN   1.4f

Definition at line 1214 of file ED_view3d.hh.

Referenced by view3d_from_minmax(), and view3d_localview_init().

◆ XRAY_ACTIVE

◆ XRAY_ALPHA

#define XRAY_ALPHA ( v3d)    SHADING_XRAY_ALPHA((v3d)->shading)

◆ XRAY_ENABLED

#define XRAY_ENABLED ( v3d)    SHADING_XRAY_ENABLED((v3d)->shading)

◆ XRAY_FLAG

#define XRAY_FLAG ( v3d)    SHADING_XRAY_FLAG((v3d)->shading)

Definition at line 1288 of file ED_view3d.hh.

◆ XRAY_FLAG_ENABLED

Enumeration Type Documentation

◆ eV3DCursorOrient

Enumerator
V3D_CURSOR_ORIENT_NONE 
V3D_CURSOR_ORIENT_VIEW 
V3D_CURSOR_ORIENT_XFORM 
V3D_CURSOR_ORIENT_GEOM 

Definition at line 90 of file ED_view3d.hh.

◆ eV3DDepthOverrideMode

Enumerator
V3D_DEPTH_NO_OVERLAYS 

Redraw viewport without overlays.

V3D_DEPTH_NO_GPENCIL 

Redraw viewport without Grease Pencil.

V3D_DEPTH_GPENCIL_ONLY 

Redraw viewport with Grease Pencil only.

V3D_DEPTH_OBJECT_ONLY 

Redraw viewport with active object only.

V3D_DEPTH_SELECTED_ONLY 

Redraw viewport with objects from the supplied collection only.

Definition at line 184 of file ED_view3d.hh.

◆ 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 

Set when the coordinate is so close to the view-point that the projection isn't usable. Where there is potential numeric error in the resulting 2D value. This can be used to numeric errors even in cases where the caller* wishes to ignore the near clipping plane.

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 242 of file ED_view3d.hh.

◆ 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 
V3D_PROJ_TEST_CLIP_CONTENT 

Clip the contents of the data being iterated over. Currently this is only used to edges when projecting into screen space.

Clamp the edge within the viewport limits defined by V3D_PROJ_TEST_CLIP_WIN, V3D_PROJ_TEST_CLIP_NEAR & V3D_PROJ_TEST_CLIP_FAR. This resolves the problem of a visible edge having one of it's vertices behind the viewport. See: #32214.

This is not default behavior as it may be important for the screen-space location of an edges vertex to represent that vertices location (instead of a location along the edge).

Note
Perspective views should enable V3D_PROJ_TEST_CLIP_WIN along with V3D_PROJ_TEST_CLIP_NEAR as the near-plane-clipped location of a point may become very large (even infinite) when projected into screen-space. Unless that point happens to coincide with the camera's point of view.

Use V3D_PROJ_TEST_CLIP_CONTENT_DEFAULT instead of V3D_PROJ_TEST_CLIP_CONTENT, to avoid accidentally enabling near clipping without clipping by window bounds.

Definition at line 265 of file ED_view3d.hh.

◆ eV3DSelectMode

Enumerator
VIEW3D_SELECT_ALL 
VIEW3D_SELECT_PICK_ALL 
VIEW3D_SELECT_PICK_NEAREST 

Definition at line 914 of file ED_view3d.hh.

◆ 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 923 of file ED_view3d.hh.

◆ eV3DSnapCursor

Enumerator
V3D_SNAPCURSOR_TOGGLE_ALWAYS_TRUE 
V3D_SNAPCURSOR_OCCLUSION_ALWAYS_TRUE 
V3D_SNAPCURSOR_OCCLUSION_ALWAYS_FALSE 
V3D_SNAPCURSOR_SNAP_EDIT_GEOM_FINAL 
V3D_SNAPCURSOR_SNAP_EDIT_GEOM_CAGE 

Definition at line 316 of file ED_view3d.hh.

Function Documentation

◆ armature_foreachScreenBone()

◆ ED_localview_exit_if_empty()

bool ED_localview_exit_if_empty ( const Depsgraph * depsgraph,
Scene * scene,
ViewLayer * view_layer,
wmWindowManager * wm,
wmWindow * win,
View3D * v3d,
ScrArea * area,
bool frame_selected = true,
int smooth_viewtx = 0 )

Exit 'local view' of given View3D editor, if it is active and there is nothing to display in it anymore.

Parameters
depsgraphOptional, only required for #frame_selected.
frame_selectedFrame the newly out-of-local view to show currently visible selected objects. Will only do something if a valid depsgraph pointer is also provided.
smooth_viewtxSmooth transition time (in milliseconds) between current view and final view, if changes are happening. Currently only used if #frame_selected is enabled.
Returns
true if the local view was actually exited.

Definition at line 1038 of file view3d_view.cc.

References BKE_view_layer_object_bases_get(), BKE_view_layer_synced_ensure(), depsgraph, View3D_Runtime::flag, LISTBASE_FOREACH, View3D::local_view_uid, View3D::localvd, View3D::runtime, and view3d_localview_exit().

Referenced by localview_remove_from_exec(), and space_view3d_refresh().

◆ ED_operator_rv3d_user_region_poll()

◆ ED_scene_draw_fps()

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

◆ ED_scene_grid_scale()

◆ ED_view3d_area_user_region()

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

Similar to ED_view3d_context_user_region() but does not use context. Always performs a lookup. Also works if v3d is not the active space.

Definition at line 89 of file space_view3d.cc.

References BLI_assert, ELEM, LISTBASE_FOREACH, RegionView3D::persp, View3D::regionbase, RGN_TYPE_WINDOW, RV3D_CAMOB, RV3D_LOCK_ROTATION, RV3D_PERSP, SPACE_VIEW3D, View3D::spacetype, and RegionView3D::viewlock.

Referenced by ED_view3d_context_user_region().

◆ ED_view3d_autodist()

bool ED_view3d_autodist ( ARegion * region,
View3D * v3d,
const int mval[2],
float mouse_worldloc[3],
const float fallback_depth_pt[3] )

Get the world-space 3D location from a screen-space 2D point. It may be useful to call ED_view3d_depth_override before.

Parameters
mvalInput screen-space pixel location.
mouse_worldlocOutput world-space location.
fallback_depth_ptUse this points depth when no depth can be found.

Definition at line 1142 of file view3d_utils.cc.

References ARRAY_SIZE, ED_view3d_unproject_v3(), ED_view3d_win_to_3d_int(), float, FLT_MAX, and view_autodist_depth_margin().

Referenced by depthdropper_depth_sample_pt(), ED_view3d_cursor3d_position(), navigate_pivot_get(), paint_proj_stroke(), and viewcenter_pick_invoke().

◆ ED_view3d_autodist_last_check()

bool ED_view3d_autodist_last_check ( wmWindow * win,
const wmEvent * event )

Check if the last auto-dist can be used.

Definition at line 1062 of file view3d_utils.cc.

References wmEvent::flag, view3d_autodepth_last_id, WM_event_consecutive_data_get(), and WM_EVENT_IS_CONSECUTIVE.

Referenced by navigate_pivot_get().

◆ ED_view3d_autodist_last_clear()

void ED_view3d_autodist_last_clear ( wmWindow * win)

Clear and free auto-dist data.

Definition at line 1074 of file view3d_utils.cc.

References WM_event_consecutive_data_free().

Referenced by ED_view3d_autodist_last_set(), and navigate_pivot_get().

◆ ED_view3d_autodist_last_get()

bool ED_view3d_autodist_last_get ( wmWindow * win,
float r_ofs[3] )
Returns
true when r_ofs is set.
Warning
ED_view3d_autodist_last_check should be called first to ensure the data is available.

Definition at line 1097 of file view3d_utils.cc.

References BLI_assert, copy_v3_v3(), View3D_AutoDistLast::has_depth, View3D_AutoDistLast::ofs, view3d_autodepth_last_id, WM_event_consecutive_data_get(), and zero_v3().

Referenced by navigate_pivot_get().

◆ ED_view3d_autodist_last_set()

void ED_view3d_autodist_last_set ( wmWindow * win,
const wmEvent * event,
const float ofs[3],
const bool has_depth )

◆ ED_view3d_autodist_simple()

bool ED_view3d_autodist_simple ( 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_sample_size_clamp()

int ED_view3d_backbuf_sample_size_clamp ( ARegion * region,
float dist )

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

Definition at line 2269 of file view3d_draw.cc.

References ceilf, int, max_ii(), and min_ff().

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

◆ ED_view3d_background_color_get()

◆ ED_view3d_buttons_region_layout_ex()

◆ ED_view3d_calc_camera_border()

◆ ED_view3d_calc_camera_border_size()

void ED_view3d_calc_camera_border_size ( const Scene * scene,
Depsgraph * depsgraph,
const ARegion * region,
const View3D * v3d,
const RegionView3D * rv3d,
float r_size[2] )

◆ ED_view3d_calc_depth_for_comparison()

float ED_view3d_calc_depth_for_comparison ( const RegionView3D * rv3d,
const float co[3] )

Calculate a depth value from co (result should only be used for comparison).

Definition at line 317 of file view3d_project.cc.

References dot_v3v3(), ED_view3d_calc_zfac(), RegionView3D::is_persp, and RegionView3D::viewinv.

Referenced by annotation_stroke_eraser_is_occluded().

◆ ED_view3d_calc_render_border()

◆ ED_view3d_calc_zfac()

◆ ED_view3d_calc_zfac_ex()

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

Calculate a depth value from co, use with ED_view3d_win_to_delta.

Parameters
r_flipSet to zfac < 0.0 before the value is made signed. Since it's important in some cases to know if the value was flipped.
Returns
The unsigned depth component of co multiplied by rv3d->persmat matrix, with additional sanitation to ensure the result is never negative as this isn't useful for tool-code.

Definition at line 289 of file view3d_project.cc.

References mul_project_m4_v3_zfac(), and RegionView3D::persmat.

Referenced by ED_view3d_calc_zfac(), and ED_view3d_cursor3d_position().

◆ ED_view3d_camera_autokey()

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

◆ ED_view3d_camera_data_get()

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

◆ ED_view3d_camera_lock_autokey()

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

◆ ED_view3d_camera_lock_check()

◆ ED_view3d_camera_lock_init()

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

◆ ED_view3d_camera_lock_init_ex()

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

Copy the camera to the view before starting a view transformation.

Apply the camera object transformation to the 3D Viewport. (needed so we can use regular 3D Viewport manipulation operators, that sync back to the camera).

Definition at line 594 of file view3d_utils.cc.

References View3D::camera, DEG_get_evaluated_object(), depsgraph, RegionView3D::dist, ED_view3d_camera_lock_check(), ED_view3d_from_object(), ED_view3d_offset_distance(), RegionView3D::ofs, VIEW3D_DIST_FALLBACK, and RegionView3D::viewquat.

Referenced by ED_view3d_camera_lock_init(), and ViewOpsData::init_navigation().

◆ ED_view3d_camera_lock_sync()

◆ ED_view3d_camera_lock_undo_grouped_push()

bool ED_view3d_camera_lock_undo_grouped_push ( const char * str,
const View3D * v3d,
const RegionView3D * rv3d,
bContext * C )

A version of ED_view3d_camera_lock_undo_push that performs a grouped undo push.

Note
use for actions that are likely to be repeated such as mouse wheel to zoom, where adding a separate undo step each time isn't desirable.

Definition at line 772 of file view3d_utils.cc.

References str, and view3d_camera_lock_undo_ex().

Referenced by ED_view3d_smooth_view_undo_end(), and viewzoom_exec().

◆ ED_view3d_camera_lock_undo_push()

bool ED_view3d_camera_lock_undo_push ( const char * str,
const View3D * v3d,
const RegionView3D * rv3d,
bContext * C )

Create an undo step when the camera is locked to the view.

Parameters
strThe name of the undo step (typically wmOperatorType.name should be used).
Returns
true when the call to push an undo step was made.

Definition at line 764 of file view3d_utils.cc.

References str, and view3d_camera_lock_undo_ex().

Referenced by ED_view3d_smooth_view_undo_end(), fly_modal(), view3d_navigate_modal_fn(), viewdolly_modal(), and walk_modal().

◆ ED_view3d_camera_lock_undo_test()

bool ED_view3d_camera_lock_undo_test ( const View3D * v3d,
const RegionView3D * rv3d,
bContext * C )

Check if creating an undo step should be performed if the viewport moves.

Returns
true if ED_view3d_camera_lock_undo_push would do an undo push.

Definition at line 728 of file view3d_utils.cc.

References ED_undo_is_memfile_compatible(), and ED_view3d_camera_lock_check().

Referenced by ED_view3d_smooth_view_undo_begin(), ED_view3d_smooth_view_undo_end(), and view3d_camera_lock_undo_ex().

◆ ED_view3d_camera_to_view_selected()

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

◆ ED_view3d_camera_to_view_selected_with_set_clipping()

bool ED_view3d_camera_to_view_selected_with_set_clipping ( Main * bmain,
Depsgraph * depsgraph,
const Scene * scene,
Object * camera_ob )

◆ ED_view3d_camera_view_pan()

bool ED_view3d_camera_view_pan ( ARegion * region,
const float event_ofs[2] )

Utility to pan when in camera view.

Parameters
event_ofsThe offset the pan in screen (pixel) coordinates.
Returns
true when a change was made.

Definition at line 568 of file view3d_utils.cc.

References BKE_screen_view3d_zoom_to_fac(), RegionView3D::camdx, RegionView3D::camdy, RegionView3D::camzoom, and CLAMP.

Referenced by viewmove_apply().

◆ ED_view3d_camera_view_zoom_scale()

bool ED_view3d_camera_view_zoom_scale ( RegionView3D * rv3d,
const float scale )

Utility to scale zoom level when in camera-view RegionView3D.camzoom and apply limits.

Returns
true a change was made.

Definition at line 555 of file view3d_utils.cc.

References BKE_screen_view3d_zoom_from_fac(), BKE_screen_view3d_zoom_to_fac(), RegionView3D::camzoom, CLAMP, RV3D_CAMZOOM_MAX, RV3D_CAMZOOM_MAX_FACTOR, RV3D_CAMZOOM_MIN, and RV3D_CAMZOOM_MIN_FACTOR.

◆ ED_view3d_check_mats_rv3d()

◆ ED_view3d_clear_mats_rv3d()

void ED_view3d_clear_mats_rv3d ( RegionView3D * rv3d)

Ensure we correctly initialize.

Definition at line 148 of file space_view3d.cc.

References RegionView3D::persmatob, RegionView3D::viewmatob, and zero_m4().

◆ ED_view3d_clip_range_get()

bool ED_view3d_clip_range_get ( const Depsgraph * depsgraph,
const View3D * v3d,
const RegionView3D * rv3d,
bool use_ortho_factor,
float * r_clip_start,
float * r_clip_end )

◆ ED_view3d_clip_segment()

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

◆ ED_view3d_clipping_calc()

◆ ED_view3d_clipping_calc_from_boundbox()

void ED_view3d_clipping_calc_from_boundbox ( float clip[4][4],
const BoundBox * bb,
bool is_flip )

◆ ED_view3d_clipping_clamp_minmax()

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

Clamp min/max by the viewport clipping.

Note
This is an approximation, with the limitation that the bounding box from the (mix, max) calculation might not have any geometry inside the clipped region. Performing a clipping test on each vertex would work well enough for most cases, although it's not perfect either as edges/faces may intersect the clipping without having any of their vertices inside it. A more accurate result would be quite involved.
Returns
True when the arguments were clamped.

Definition at line 358 of file view3d_utils.cc.

References RegionView3D::clip, copy_v3_v3(), INIT_MINMAX, isect_planes_v3_fn(), PointsInPlanesMinMax_UserData::max, min, PointsInPlanesMinMax_UserData::min, negate_v4_v4(), points_in_planes_minmax_fn(), RV3D_BOXCLIP, RV3D_LOCK_FLAGS, and zero_v3().

Referenced by view3d_all_exec(), and viewselected_exec().

◆ ED_view3d_clipping_local()

◆ ED_view3d_clipping_test()

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

Return true when co is hidden by the 3D views clipping planes.

Parameters
is_localWhen true use local (object-space) ED_view3d_clipping_local must run first, then all comparisons can be done in local-space.
Returns
True when co is outside all clipping planes.
Note
Callers should check RV3D_CLIPPING_ENABLED first.

Definition at line 2179 of file view3d_draw.cc.

References RegionView3D::clip, RegionView3D::clip_local, and view3d_clipping_test().

Referenced by ed_view3d_project__internal(), blender::ed::sculpt_paint::filter_region_clip_factors(), blender::ed::sculpt_paint::filter_region_clip_factors(), find_nearest_edge__doClosest(), knife_bvh_raycast_cb(), knife_find_closest_edge_of_face(), knife_find_closest_vert_of_edge(), knife_sample_screen_density_from_closest_face(), point_is_visible(), project_paint_face_init(), and project_paint_occlude_ptv_clip().

◆ ED_view3d_context_activate()

◆ ED_view3d_context_rv3d()

◆ ED_view3d_context_user_region()

◆ ED_view3d_cursor3d_position()

◆ ED_view3d_cursor3d_position_rotation()

◆ ED_view3d_cursor3d_update()

◆ ED_view3d_cursor_snap_context_ensure()

SnapObjectContext * ED_view3d_cursor_snap_context_ensure ( Scene * scene)

◆ ED_view3d_cursor_snap_data_get()

◆ ED_view3d_cursor_snap_data_update()

◆ ED_view3d_cursor_snap_draw_util()

◆ ED_view3d_cursor_snap_state_active_get()

◆ ED_view3d_cursor_snap_state_active_set()

◆ ED_view3d_cursor_snap_state_create()

◆ ED_view3d_cursor_snap_state_default_set()

◆ ED_view3d_cursor_snap_state_free()

◆ ED_view3d_cursor_snap_state_prevpoint_set()

◆ ED_view3d_datamask()

◆ ED_view3d_depth_override()

void ED_view3d_depth_override ( Depsgraph * depsgraph,
ARegion * region,
View3D * v3d,
Object * obact,
eV3DDepthOverrideMode mode,
ViewDepths ** r_depths )

◆ ED_view3d_depth_read_cached()

◆ ED_view3d_depth_read_cached_normal()

◆ ED_view3d_depth_read_cached_seg()

bool ED_view3d_depth_read_cached_seg ( const ViewDepths * vd,
const int mval_sta[2],
const int mval_end[2],
int margin,
float * r_depth )

◆ ED_view3d_depth_unproject_v3()

◆ ED_view3d_depths_free()

◆ ED_view3d_dist_range_get()

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

◆ ED_view3d_distance_set()

void ED_view3d_distance_set ( RegionView3D * rv3d,
float dist )

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

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

Definition at line 1363 of file view3d_utils.cc.

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],
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 1383 of file view3d_utils.cc.

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_setup_view()

◆ ED_view3d_engine_type()

◆ 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 1577 of file view3d_utils.cc.

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

Referenced by ED_view3d_from_object(), and object_apply_mat4_with_protect().

◆ ED_view3d_from_object()

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

Set the RegionView3D members from an objects transformation and optionally lens.

Parameters
obThe object to set the view to.
ofsThe view offset to be set, normally from RegionView3D.ofs.
quatThe view rotation to be set, quaternion normally from RegionView3D.viewquat.
distThe view distance from ofsto be set, normally from RegionView3D.dist.
lensThe view lens angle set for cameras and lights, normally from View3D.lens.

Definition at line 1613 of file view3d_utils.cc.

References BKE_camera_params_from_object(), BKE_camera_params_init(), ED_view3d_from_m4(), and params.

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

◆ ED_view3d_give_base_under_cursor()

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

mval comes from event->mval, only use within region handlers.

Definition at line 2448 of file view3d_select.cc.

References ed_view3d_give_base_under_cursor_ex().

Referenced by datadropper_id_sample_pt(), ED_view3d_give_object_under_cursor(), and blender::ed::object::object_transfer_mode_invoke().

◆ ED_view3d_give_material_slot_under_cursor()

Object * ED_view3d_give_material_slot_under_cursor ( bContext * C,
const int mval[2],
int * r_material_slot )

◆ ED_view3d_give_object_under_cursor()

◆ ED_view3d_gizmo_mesh_preselect_clear()

◆ ED_view3d_gizmo_mesh_preselect_get_active()

◆ ED_view3d_global_to_vector()

void ED_view3d_global_to_vector ( const RegionView3D * rv3d,
const float coord[3],
float r_out[3] )

Calculate a normalized 3D direction vector from the viewpoint towards a global location. In orthographic view the resulting vector will match the view vector.

Parameters
rv3dThe region (used for the window width and height).
coordThe world-space location.
r_outThe resulting normalized vector.

Definition at line 424 of file view3d_project.cc.

References copy_v3_v3(), RegionView3D::is_persp, mul_m4_v4(), mul_v3_fl(), normalize_v3(), sub_v3_v3v3(), RegionView3D::viewinv, and RegionView3D::viewmat.

Referenced by add_vertex_invoke(), dial_ghostarc_get_angles(), gizmo_get_idot(), blender::ed::sculpt_paint::project_brush_radius(), update_location_for_2d_curve(), and v3d_cursor_plane_draw().

◆ ED_view3d_grid_scale()

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

◆ ED_view3d_grid_steps()

void ED_view3d_grid_steps ( const Scene * scene,
const View3D * v3d,
const RegionView3D * rv3d,
float r_grid_steps[8] )

Referenced by OVERLAY_grid_init().

◆ ED_view3d_grid_view_scale()

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

Simulates the grid scale that is actually viewed. The actual code is seen in object_grid_frag.glsl (see grid_res). Currently the simulation is only done when RV3D_VIEW_IS_AXIS.

Definition at line 920 of file view3d_draw.cc.

References BKE_unit_display_name_get(), ED_view3d_grid_scale(), IFACE_, RegionView3D::is_persp, RV3D_VIEW_IS_AXIS, STEPS_LEN, RegionView3D::view, view3d_grid_steps_ex(), and RegionView3D::winmat.

Referenced by draw_grid_unit_name(), blender::ed::greasepencil::grease_pencil_snap_to_grid_exec(), idp_snap_calc_incremental(), snap_curs_to_grid_exec(), snap_object_context_runtime_init(), snap_sel_to_grid_exec(), and transform_snap_grid_init().

◆ ED_view3d_has_depth_buffer_updated()

◆ ED_view3d_has_workbench_in_texture_color()

◆ ED_view3d_init_mats_rv3d()

void ED_view3d_init_mats_rv3d ( const Object * ob,
RegionView3D * rv3d )

Most of the time this isn't needed since you could assume the view matrix was set while drawing, however when functions like mesh_foreachScreenVert are called by selection tools, we can't be sure this object was the last.

for example, transparent objects are drawn after edit-mode and will cause the rv3d mat's to change and break selection.

'ED_view3d_init_mats_rv3d' should be called before view3d_project_short_clip and view3d_project_short_noclip in cases where these functions are not used during draw_object

Definition at line 127 of file space_view3d.cc.

References ED_view3d_clipping_local(), mul_m4_m4m4(), RegionView3D::persmat, RegionView3D::persmatob, RegionView3D::viewmat, and RegionView3D::viewmatob.

Referenced by armature_circle_select(), do_lasso_select_armature(), do_lasso_select_curve(), do_lasso_select_lattice(), do_lasso_select_mesh(), do_lasso_select_meta(), do_lasso_select_paintvert(), do_lasso_tag_pose(), do_lattice_box_select(), do_mesh_box_select(), do_nurbs_box_select(), do_paintvert_box_select(), drw_manager_init(), ED_curve_editfont_select_pick(), ED_curve_pick_vert_ex(), ED_mesh_pick_vert(), ED_view3d_init_mats_rv3d_gl(), edbm_dupli_extrude_cursor_invoke(), EDBM_edge_find_nearest_ex(), EDBM_face_find_nearest_ex(), edbm_polybuild_delete_at_cursor_invoke(), edbm_polybuild_face_at_cursor_invoke(), edbm_polybuild_split_at_cursor_invoke(), edbm_polybuild_transform_at_cursor_invoke(), EDBM_project_snap_verts(), EDBM_vert_find_nearest_ex(), findnearestLattvert(), knifetool_modal(), lattice_circle_select(), mball_circle_select(), mesh_circle_select(), mouse_mesh_loop(), nurbscurve_circle_select(), paint_vertsel_circle_select(), paint_weight_gradient_exec(), paintface_select_loop(), pose_circle_select(), blender::ed::sculpt_paint::stroke_test_start(), vpaint_stroke_update_step(), weight_sample_group_invoke(), weight_sample_invoke(), and wpaint_stroke_update_step().

◆ ED_view3d_init_mats_rv3d_gl()

void ED_view3d_init_mats_rv3d_gl ( const Object * ob,
RegionView3D * rv3d )

Definition at line 137 of file space_view3d.cc.

References ED_view3d_init_mats_rv3d(), and GPU_matrix_mul.

◆ ED_view3d_is_object_under_cursor()

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

Definition at line 2473 of file view3d_select.cc.

References ED_view3d_give_object_under_cursor().

Referenced by view3d_ima_bg_drop_poll().

◆ ED_view3d_lastview_store()

◆ ED_view3d_local_collections_reset()

◆ ED_view3d_local_collections_set()

bool ED_view3d_local_collections_set ( const Main * bmain,
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 1270 of file view3d_view.cc.

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

◆ ED_view3d_lock()

◆ ED_view3d_lock_clear()

void ED_view3d_lock_clear ( View3D * v3d)

◆ ED_view3d_lock_view_from_index()

char ED_view3d_lock_view_from_index ( int index)

◆ ED_view3d_mats_rv3d_backup()

◆ ED_view3d_mats_rv3d_restore()

◆ ED_view3d_navigation_do()

◆ ED_view3d_navigation_free()

void ED_view3d_navigation_free ( bContext * C,
ViewOpsData * vod )

◆ ED_view3d_navigation_init()

ViewOpsData * ED_view3d_navigation_init ( bContext * C,
const wmKeyMapItem * kmi_merge )

Utilities to perform navigation. Call ED_view3d_navigation_init to create a context and ED_view3d_navigation_do to perform navigation in modal operators.

Note
modal map events can also be used in ED_view3d_navigation_do.

Definition at line 1063 of file view3d_navigate.cc.

References CTX_wm_region_view3d().

Referenced by blender::ed::greasepencil::grease_pencil_primitive_invoke(), and initTransInfo().

◆ ED_view3d_ob_project_mat_get()

blender::float4x4 ED_view3d_ob_project_mat_get ( const RegionView3D * rv3d,
const Object * ob )

Definition at line 699 of file view3d_project.cc.

References mul_m4_m4m4(), blender::MatBase< T, NumCol, NumRow, Alignment >::ptr(), RegionView3D::viewmat, and RegionView3D::winmat.

Referenced by blender::ed::sculpt_paint::CombOperationExecutor::comb_projected(), content_planes_from_clip_flag(), blender::ed::sculpt_paint::DeleteOperationExecutor::delete_projected(), ed_curves_select_pick(), edbm_rip_edge_invoke(), edbm_rip_invoke__edge(), edbm_rip_invoke__vert(), blender::ed::sculpt_paint::PuffOperationExecutor::find_curve_weights_projected(), blender::ed::sculpt_paint::find_curves_brush_position(), blender::ed::sculpt_paint::SmoothOperationExecutor::find_projected_smooth_factors(), blender::ed::sculpt_paint::CurvesEffectOperationExecutor::gather_influences_projected(), blender::ed::greasepencil::grease_pencil_primitive_invoke(), blender::ed::greasepencil::grease_pencil_primitive_modal(), blender::ed::sculpt_paint::gesture::init_from_lasso(), knifeproject_poly_from_object(), obedit_circle_select(), blender::ed::sculpt_paint::greasepencil::GrabOperation::on_stroke_begin(), paint_convert_bb_to_rect(), blender::ed::sculpt_paint::SelectionPaintOperationExecutor::paint_curve_selection_projected(), blender::ed::sculpt_paint::SelectionPaintOperationExecutor::paint_point_selection_projected(), blender::ed::sculpt_paint::PinchOperationExecutor::pinch_projected(), blender::ed::sculpt_paint::SnakeHookOperatorExecutor::projected_snake_hook(), blender::ed::sculpt_paint::DensitySubtractOperationExecutor::reduce_density_projected(), blender::ed::sculpt_paint::DensityAddOperationExecutor::sample_projected_with_symmetry(), blender::ed::sculpt_paint::sculpt_update_cache_invariants(), blender::ed::sculpt_paint::SlideOperationExecutor::slide(), blender::ed::sculpt_paint::vwpaint::update_cache_invariants(), EdgeSlideData::update_proj_mat(), VertSlideData::update_proj_mat(), view3d_box_select_exec(), and view3d_lasso_select().

◆ ED_view3d_ob_project_mat_get_from_obmat()

◆ ED_view3d_offset_distance()

float ED_view3d_offset_distance ( const float mat[4][4],
const float ofs[3],
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 1342 of file view3d_utils.cc.

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 View3D * v3d,
const RegionView3D * rv3d )

◆ ED_view3d_persp_ensure()

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

Action to take when rotating the view, handle auto-perspective and logic for switching out of views.

shared with NDOF.

Definition at line 520 of file view3d_utils.cc.

References BLI_assert, depsgraph, ED_view3d_camera_lock_check(), ED_view3d_persp_switch_from_camera(), RegionView3D::lpersp, RegionView3D::lview, RegionView3D::persp, RV3D_CAMOB, RV3D_LOCK_ANY_TRANSFORM, RV3D_LOCK_FLAGS, RV3D_PERSP, RV3D_VIEW_IS_AXIS, USER_AUTOPERSP, and RegionView3D::view.

Referenced by ViewOpsData::init_navigation().

◆ ED_view3d_persp_switch_from_camera()

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

For viewport operators that exit camera perspective.

Note
This differs from simply setting rv3d->persp = persp because it sets the ofs and dist values of the viewport so it matches the camera, otherwise switching out of camera view may jump to a different part of the scene.

Definition at line 501 of file view3d_utils.cc.

References BLI_assert, View3D::camera, DEG_get_evaluated_object(), depsgraph, RegionView3D::dist, ED_view3d_camera_lock_check(), ED_view3d_from_object(), ED_view3d_offset_distance(), RegionView3D::ofs, RegionView3D::persp, RV3D_CAMOB, VIEW3D_DIST_FALLBACK, and RegionView3D::viewquat.

Referenced by ED_view3d_persp_ensure(), view3d_zoom_border_exec(), and viewdolly_invoke().

◆ ED_view3d_pixel_size()

◆ ED_view3d_pixel_size_no_ui_scale()

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

◆ ED_view3d_polygon_offset()

void ED_view3d_polygon_offset ( const RegionView3D * rv3d,
float dist )

Use instead of: GPU_polygon_offset(rv3d->dist, ...) see bug #37727.

Definition at line 239 of file view3d_utils.cc.

References RegionView3D::dist, fabsf, GPU_polygon_offset(), RegionView3D::is_persp, max_ff(), RegionView3D::persp, RegionView3D::rflag, RV3D_CAMOB, RV3D_ZOFFSET_DISABLED, and RegionView3D::winmat.

◆ ED_view3d_project_base()

eV3DProjStatus ED_view3d_project_base ( const ARegion * region,
Base * base,
float r_co[2] )

◆ ED_view3d_project_float_ex()

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

◆ ED_view3d_project_float_global()

◆ ED_view3d_project_float_object()

◆ ED_view3d_project_float_v2_m4()

blender::float2 ED_view3d_project_float_v2_m4 ( const ARegion * region,
const float co[3],
const blender::float4x4 & mat )
Note
use ED_view3d_ob_project_mat_get to get the projection matrix

Definition at line 34 of file view3d_project.cc.

References copy_v3_v3(), float, mul_m4_v4(), blender::MatBase< T, NumCol, NumRow, Alignment >::ptr(), vec4, and zero_v2().

Referenced by blender::ed::greasepencil::build_curves_2d_bvh_from_visible(), blender::ed::sculpt_paint::CombOperationExecutor::comb_projected(), blender::ed::sculpt_paint::DeleteOperationExecutor::delete_projected(), edbm_rip_edge_invoke(), edbm_rip_edge_side_measure(), edbm_rip_edgedist_squared(), blender::ed::sculpt_paint::PuffOperationExecutor::find_curve_weights_projected(), blender::ed::sculpt_paint::find_curves_brush_position(), blender::ed::sculpt_paint::SmoothOperationExecutor::find_projected_smooth_factors(), blender::ed::sculpt_paint::CurvesEffectOperationExecutor::gather_influences_projected(), blender::ed::sculpt_paint::gesture::is_affected_lasso(), knifeproject_poly_from_object(), paint_convert_bb_to_rect(), blender::ed::sculpt_paint::PinchOperationExecutor::pinch_projected(), blender::ed::greasepencil::primitive_local_to_screen(), blender::ed::sculpt_paint::SnakeHookOperatorExecutor::projected_snake_hook(), blender::ed::sculpt_paint::DensityAddOperationExecutor::sample_projected_with_symmetry(), sculpt_apply_texture(), SCULPT_vertex_is_occluded(), blender::ed::curves::select_box(), blender::ed::curves::select_box_mask(), blender::ed::curves::select_circle(), blender::ed::curves::select_circle_mask(), blender::ed::curves::select_lasso(), and blender::ed::curves::select_lasso_mask().

◆ ED_view3d_project_float_v3_m4()

void ED_view3d_project_float_v3_m4 ( const ARegion * region,
const float co[3],
float r_co[3],
const float mat[4][4] )
Note
use ED_view3d_ob_project_mat_get to get projecting mat

Definition at line 57 of file view3d_project.cc.

References copy_v3_v3(), float, mul_m4_v4(), vec4, and zero_v3().

◆ ED_view3d_project_int_ex()

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

◆ ED_view3d_project_int_global()

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

◆ ED_view3d_project_int_object()

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

◆ ED_view3d_project_short_ex()

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

◆ ED_view3d_project_short_global()

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

Definition at line 222 of file view3d_project.cc.

References ED_view3d_project_short_ex(), flag, and RegionView3D::persmat.

◆ ED_view3d_project_short_object()

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

◆ ED_view3d_project_v2()

◆ ED_view3d_project_v3()

void ED_view3d_project_v3 ( const ARegion * region,
const float world[3],
float r_region_co[3] )

Convert between region relative coordinates (x,y) and depth component z and a point in world space.

Definition at line 715 of file view3d_project.cc.

References GPU_matrix_project_3fv(), RegionView3D::viewmat, and RegionView3D::winmat.

Referenced by blender::ed::sculpt_paint::cursor_draw_point_screen_space(), key_test_depth(), and blender::ed::object::object_transform_axis_target_calc_depth_init().

◆ ED_view3d_quadview_update()

◆ ED_view3d_quat_from_axis_view()

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

◆ ED_view3d_quat_to_axis_view()

bool ED_view3d_quat_to_axis_view ( const float quat[4],
float epsilon,
char * r_view,
char * r_view_axis_roll )

◆ ED_view3d_quat_to_axis_view_and_reset_quat()

bool ED_view3d_quat_to_axis_view_and_reset_quat ( float quat[4],
float epsilon,
char * r_view,
char * r_view_axis_roll )

A version of ED_view3d_quat_to_axis_view that updates quat if it's within epsilon to an axis-view.

Note
Include the special case function since most callers need to perform these operations.

Definition at line 1518 of file view3d_utils.cc.

References BLI_assert, ED_view3d_quat_from_axis_view(), ED_view3d_quat_to_axis_view(), and RV3D_VIEW_USER.

Referenced by view_roll_angle(), and viewrotate_apply_snap().

◆ ED_view3d_radius_to_dist()

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

Return a new RegionView3D.dist value to fit the radius.

Note
Depth isn't taken into account, this will fit a flat plane exactly, but points towards the view (with a perspective projection), may be within the radius but outside the view. eg:
          +
pt --> + /^ radius
        / |
       /  |
view  +   +
       \  |
        \ |
         |
          +
Parameters
regionCan be NULL if use_aspect is false.
perspAllow the caller to tell what kind of perspective to use (ortho/view/camera)
use_aspectIncrease the distance to account for non 1:1 view aspect.
radiusThe radius will be fitted exactly, typically pre-scaled by a margin (VIEW3D_MARGIN).

Definition at line 1262 of file view3d_utils.cc.

References atanf, BKE_camera_params_from_object(), BKE_camera_params_init(), BKE_camera_sensor_size(), BLI_assert, View3D::camera, CAMERA_PARAM_ZOOM_INIT_CAMOB, CAMERA_PARAM_ZOOM_INIT_PERSP, View3D::clip_end, View3D::clip_start, DEFAULT_SENSOR_WIDTH, DEG_get_evaluated_object(), depsgraph, ED_view3d_radius_to_dist_ortho(), ED_view3d_radius_to_dist_persp(), ELEM, focallength_to_fov(), View3D::lens, params, RV3D_CAMOB, RV3D_ORTHO, RV3D_PERSP, tanf, and RegionView3D::viewcamtexcofac.

Referenced by view3d_from_minmax(), and view3d_localview_init().

◆ ED_view3d_radius_to_dist_ortho()

float ED_view3d_radius_to_dist_ortho ( float lens,
float radius )

Definition at line 1257 of file view3d_utils.cc.

References DEFAULT_SENSOR_WIDTH.

Referenced by ED_view3d_radius_to_dist().

◆ ED_view3d_radius_to_dist_persp()

float ED_view3d_radius_to_dist_persp ( float angle,
float radius )

Definition at line 1252 of file view3d_utils.cc.

References tanf.

Referenced by ED_view3d_radius_to_dist().

◆ ED_view3d_screen_datamask()

void ED_view3d_screen_datamask ( const Scene * scene,
ViewLayer * view_layer,
const bScreen * screen,
CustomData_MeshMasks * r_cddata_masks )

Goes over all modes and view3d settings.

Definition at line 2539 of file view3d_draw.cc.

References CD_MASK_BAREMESH, CustomData_MeshMasks_update(), ED_view3d_datamask(), LISTBASE_FOREACH, and SPACE_VIEW3D.

Referenced by wm_event_do_depsgraph().

◆ ED_view3d_select_dist_px()

◆ ED_view3d_select_filter_from_mode()

◆ ED_view3d_select_id_validate()

◆ ED_view3d_shade_update()

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

◆ ED_view3d_snap_selected_to_location()

bool ED_view3d_snap_selected_to_location ( bContext * C,
wmOperator * op,
const float snap_target_global[3],
int pivot_point )

◆ ED_view3d_stop_render_preview()

◆ ED_view3d_text_colors_get()

void ED_view3d_text_colors_get ( const Scene * scene,
const View3D * v3d,
float r_text_color[4],
float r_shadow_color[4] )

◆ ED_view3d_to_m4()

void ED_view3d_to_m4 ( float mat[4][4],
const float ofs[3],
const float quat[4],
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 1603 of file view3d_utils.cc.

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 Depsgraph * depsgraph,
Object * ob,
const float ofs[3],
const float quat[4],
float dist )

Set the object transformation from RegionView3D members.

Parameters
depsgraphThe depsgraph to get the evaluated object parent for the transformation calculation.
obThe object which has the transformation assigned.
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 1627 of file view3d_utils.cc.

References BKE_object_apply_mat4_ex(), DEG_get_evaluated_object(), depsgraph, ED_view3d_to_m4(), Object::parent, and Object::parentinv.

Referenced by ED_view3d_camera_lock_sync(), and view3d_camera_to_view_exec().

◆ ED_view3d_unproject_v3()

◆ ED_view3d_update_viewmat()

◆ ED_view3d_viewcontext_init()

ViewContext ED_view3d_viewcontext_init ( bContext * C,
Depsgraph * depsgraph )

Definition at line 127 of file view3d_select.cc.

References ViewContext::bmain, C, ViewContext::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(), blender::ed::sculpt_paint::filter::cache_init(), blender::ed::curves::curve_draw_init(), curve_draw_init(), curve_pen_invoke(), curve_pen_modal(), blender::ed::sculpt_paint::dyntopo::dyntopo_detail_size_edit_invoke(), 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_curves_select_pick(), ed_grease_pencil_select_pick(), ED_lattice_deselect_all_multi(), ED_lattice_select_pick(), ED_mball_deselect_all_multi(), ed_mball_findnearest_metaelem(), ED_mesh_pick_face(), ED_mesh_pick_vert(), ed_object_select_pick(), ED_pose_deselect_all_multi(), ed_view3d_give_base_under_cursor_ex(), EDBM_mesh_deselect_all_multi(), EDBM_selectmode_disable_multi(), edcu_shortest_path_pick_invoke(), em_setup_viewcontext(), blender::ed::sculpt_paint::grease_pencil_apply_fill(), blender::ed::greasepencil::grease_pencil_primitive_invoke(), blender::ed::sculpt_paint::gesture::init_common(), blender::ed::object::object_transform_axis_target_invoke(), blender::ed::sculpt_paint::paint_cursor_context_init(), paint_sample_color(), blender::ed::sculpt_paint::paint_stroke_new(), paintface_select_loop(), PE_set_view3d_data(), blender::ed::sculpt_paint::dyntopo::sample_detail(), SCULPT_cursor_geometry_info_update(), SCULPT_stroke_get_location_ex(), blender::ed::greasepencil::select_ends_exec(), blender::ed::greasepencil::select_less_exec(), select_linked_pick_invoke(), blender::ed::greasepencil::select_more_exec(), blender::ed::greasepencil::select_random_exec(), blender::ed::sculpt_paint::image::ops::paint::texture_paint_init(), blender::ed::sculpt_paint::update_modal_transform(), view3d_box_select_exec(), view3d_circle_select_exec(), view3d_lasso_select_exec(), view3d_select_exec(), vpaint_init_vpaint(), weight_sample_group_invoke(), blender::ed::greasepencil::weight_sample_invoke(), weight_sample_invoke(), and wpaint_stroke_test_start().

◆ ED_view3d_viewcontext_init_object()

void ED_view3d_viewcontext_init_object ( ViewContext * vc,
Object * obact )

Re-initialize vc with obact as if it's active object (with some differences).

This is often used when operating on multiple objects in modes (edit, pose mode etc) where the vc is passed in as an argument which then references its object data.

Note
members ViewContext.obedit & ViewContext.em are only initialized if they're already set, by ED_view3d_viewcontext_init in most cases. This is necessary because the active object defines the current object-mode. When iterating over objects in object-mode it doesn't make sense to perform an edit-mode action on an object that happens to contain edit-mode data. In some cases these values are cleared allowing the owner of vc to explicitly disable edit-mode operation (to force object selection in edit-mode for e.g.). So object-mode specific values should remain cleared when initialized with another object.

Definition at line 145 of file view3d_select.cc.

References BKE_editmesh_from_object(), BKE_object_is_in_editmode(), BLI_assert, ViewContext::em, ViewContext::obact, and ViewContext::obedit.

Referenced by do_lasso_select_pose(), ED_curve_pick_vert_ex(), ED_lattice_select_pick(), edbm_dupli_extrude_cursor_invoke(), EDBM_edge_find_nearest_ex(), EDBM_face_find_nearest_ex(), edbm_preselect_or_active_init_viewcontext(), edbm_select_linked_pick_invoke(), EDBM_select_pick(), edbm_shortest_path_pick_invoke(), EDBM_unified_findnearest_from_raycast(), EDBM_vert_find_nearest_ex(), edcu_shortest_path_pick_invoke(), findnearestLattvert(), knifeproject_exec(), loopcut_init(), loopcut_mouse_move(), mouse_mesh_loop(), view3d_box_select_exec(), view3d_circle_select_exec(), view3d_circle_select_recalc(), and view3d_lasso_select().

◆ ED_view3d_viewplane_get()

bool ED_view3d_viewplane_get ( const Depsgraph * depsgraph,
const View3D * v3d,
const RegionView3D * rv3d,
int winx,
int winy,
rctf * r_viewplane,
float * r_clip_start,
float * r_clip_end,
float * r_pixsize )

◆ ED_view3d_win_to_3d()

void ED_view3d_win_to_3d ( const View3D * v3d,
const ARegion * region,
const float depth_pt[3],
const float mval[2],
float r_out[3] )

Calculate a 3D location from 2D window coordinates.

Parameters
regionThe region (used for the window width and height).
depth_ptThe reference location used to calculate the Z depth.
mvalThe area relative location (such as event->mval converted to floats).
r_outThe resulting world-space location.

Definition at line 482 of file view3d_project.cc.

References BKE_camera_sensor_fit(), BKE_screen_view3d_zoom_to_fac(), RegionView3D::camdx, RegionView3D::camdy, View3D::camera, CAMERA_SENSOR_FIT_HOR, RegionView3D::camzoom, copy_v3_v3(), Object::data, ED_view3d_win_to_vector(), fabsf, float, RegionView3D::is_persp, isect_ray_plane_v3_factor(), madd_v3_v3v3fl(), RegionView3D::persinv, RegionView3D::persp, ray_point_factor_v3(), RV3D_CAMOB, Camera::sensor_fit, Camera::shiftx, Camera::shifty, and RegionView3D::viewinv.

Referenced by armature_click_extrude_invoke(), blender::ed::sculpt_paint::brush_delta_update(), blender::ed::sculpt_paint::CombOperationExecutor::comb_projected(), blender::ed::sculpt_paint::CombOperationExecutor::comb_spherical_with_symmetry(), curve_draw_invoke(), blender::ed::curves::curves_draw_invoke(), blender::ed::sculpt_paint::DeleteOperationExecutor::delete_spherical_with_symmetry(), depthdropper_depth_sample_pt(), ED_view3d_win_to_3d_int(), blender::ed::sculpt_paint::PuffOperationExecutor::find_curves_weights_spherical_with_symmetry(), blender::ed::sculpt_paint::SmoothOperationExecutor::find_spherical_smooth_factors_with_symmetry(), blender::ed::sculpt_paint::CurvesEffectOperationExecutor::gather_influences_projected(), blender::ed::sculpt_paint::CurvesEffectOperationExecutor::gather_influences_spherical(), blender::ed::sculpt_paint::trim::generate_geometry(), gizmo_window_project_3d(), ViewOpsData::init_navigation(), initBend(), knife_constrain_axis(), knifetool_raycast_planes(), blender::ed::sculpt_paint::gesture::line_calculate_plane_points(), mesh_bisect_interactive_calc(), blender::ed::sculpt_paint::SelectionPaintOperationExecutor::paint_curve_selection_spherical_with_symmetry(), blender::ed::sculpt_paint::SelectionPaintOperationExecutor::paint_point_selection_spherical_with_symmetry(), blender::ed::sculpt_paint::PinchOperationExecutor::pinch_projected(), blender::ed::sculpt_paint::PinchOperationExecutor::pinch_spherical_with_symmetry(), blender::ed::greasepencil::DrawingPlacement::project(), blender::ed::sculpt_paint::SnakeHookOperatorExecutor::projected_snake_hook(), screenspace_to_worldspace(), blender::ed::sculpt_paint::SnakeHookOperatorExecutor::spherical_snake_hook_with_symmetry(), blender::ed::curves::stroke_elem_project_fallback(), stroke_elem_project_fallback(), and v3d_cursor_snap_update().

◆ ED_view3d_win_to_3d_int()

◆ ED_view3d_win_to_3d_on_plane()

◆ ED_view3d_win_to_3d_on_plane_int()

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

Definition at line 577 of file view3d_project.cc.

References ED_view3d_win_to_3d_on_plane(), and float.

Referenced by gizmo_mesh_spin_redo_setup().

◆ ED_view3d_win_to_3d_on_plane_with_fallback()

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

A wrapper for ED_view3d_win_to_3d_on_plane that projects onto plane_fallback then maps this back to plane.

This is intended to be used when plane is orthogonal to the views Z axis where projecting the mval doesn't work well (or fail completely when exactly aligned).

Definition at line 587 of file view3d_project.cc.

References closest_to_plane_v3(), copy_m4_m3(), ED_view3d_win_to_3d_on_plane(), isect_plane_plane_v3(), mat4, mul_m4_v3(), normalize_v3(), rotation_between_vecs_to_mat3(), and transform_pivot_set_m4().

Referenced by view3d_win_to_3d_on_plane_maybe_fallback().

◆ ED_view3d_win_to_delta()

void ED_view3d_win_to_delta ( const ARegion * region,
const float xy_delta[2],
float zfac,
float r_out[3] )

Calculate a 3D difference vector from 2D window offset.

Note
that ED_view3d_calc_zfac() must be called first to determine the depth used to calculate the delta.

When the zfac is calculated based on a world-space location directly under the cursor, the value of r_out can be subtracted from RegionView3D.ofs to pan the view with the contents following the cursor perfectly (without sliding).

Parameters
regionThe region (used for the window width and height).
xy_delta2D difference (in pixels) such as event->mval[0] - other_x.
zfacThe depth result typically calculated by ED_view3d_calc_zfac (see its doc-string for details).
r_outThe resulting world-space delta.

Definition at line 622 of file view3d_project.cc.

References RegionView3D::persinv.

Referenced by annotation_stroke_convertcoords(), brush_edit_apply(), blender::ed::sculpt_paint::calc_local_from_screen(), convertViewVec(), blender::ed::sculpt_paint::greasepencil::get_screen_projection_fn(), gpencil_stroke_convertcoords(), mesh_bisect_interactive_calc(), move3d_get_translate(), paint_calc_object_space_radius(), blender::ed::greasepencil::pixel_radius_to_world_space_radius(), view3d_zoom_border_exec(), view_zoom_to_window_xy_3d(), and viewmove_apply().

◆ ED_view3d_win_to_origin()

void ED_view3d_win_to_origin ( const ARegion * region,
const float mval[2],
float r_out[3] )

Calculate a 3D origin from 2D window coordinates.

Note
Orthographic views have a less obvious origin, Since far clip can be a very large value resulting in numeric precision issues, the origin in this case is close to zero coordinate.
Parameters
regionThe region (used for the window width and height).
mvalThe area relative 2D location (such as event->mval converted to float).
r_outThe resulting normalized world-space direction vector.

Definition at line 638 of file view3d_project.cc.

References copy_v3_v3(), RegionView3D::is_persp, mul_project_m4_v3(), RegionView3D::persinv, RegionView3D::persp, RV3D_CAMOB, and RegionView3D::viewinv.

Referenced by ED_view3d_win_to_3d_on_plane(), ED_view3d_win_to_ray(), SCULPT_raycast_init(), and view3d_win_to_ray_segment().

◆ ED_view3d_win_to_ray()

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

Calculate a 3D viewpoint and direction vector from 2D window coordinates. This ray_start is located at the viewpoint, ray_normal is the direction towards mval.

Parameters
regionThe region (used for the window width and height).
mvalThe area relative 2D location (such as event->mval, converted into float[2]).
r_ray_startThe world-space point where the ray intersects the window plane.
r_ray_normalThe normalized world-space direction of towards mval.
Note
Ignores view near/far clipping, to take this into account use ED_view3d_win_to_ray_clipped.

Definition at line 415 of file view3d_project.cc.

References ED_view3d_win_to_origin(), and ED_view3d_win_to_vector().

Referenced by gizmo_arrow_modal(), and blender::ed::object::object_transform_axis_target_calc_depth_init().

◆ ED_view3d_win_to_ray_clipped()

bool ED_view3d_win_to_ray_clipped ( Depsgraph * depsgraph,
const ARegion * region,
const View3D * v3d,
const float mval[2],
float r_ray_start[3],
float r_ray_normal[3],
bool do_clip_planes )

Calculate a 3D viewpoint and direction vector from 2D window coordinates. This ray_start is located at the viewpoint, ray_normal is the direction towards mval. ray_start is clipped by the view near limit so points in front of it are always in view. In orthographic view the resulting ray_normal will match the view vector.

Parameters
regionThe region (used for the window width and height).
v3dThe 3D viewport (used for near clipping value).
mvalThe area relative 2D location (such as event->mval, converted into float[2]).
r_ray_startThe world-space point where the ray intersects the window plane.
r_ray_normalThe normalized world-space direction of towards mval.
do_clip_planesOptionally clip the start of the ray by the view clipping planes.
Returns
success, false if the ray is totally clipped.

Definition at line 395 of file view3d_project.cc.

References depsgraph, and ED_view3d_win_to_ray_clipped_ex().

Referenced by EDBM_unified_findnearest_from_raycast(), and knife_snap_curr().

◆ ED_view3d_win_to_ray_clipped_ex()

bool ED_view3d_win_to_ray_clipped_ex ( Depsgraph * depsgraph,
const ARegion * region,
const View3D * v3d,
const float mval[2],
const bool do_clip_planes,
float r_ray_co[3],
float r_ray_normal[3],
float r_ray_start[3],
float r_ray_end[3] )

Calculate a 3D viewpoint and direction vector from 2D window coordinates. This ray_start is located at the viewpoint, ray_normal is the direction towards mval. ray_start is clipped by the view near limit so points in front of it are always in view. In orthographic view the resulting ray_normal will match the view vector. This version also returns the ray_co point of the ray on window plane, useful to fix precision issues especially with orthographic view, where default ray_start is set rather far away.

Parameters
regionThe region (used for the window width and height).
v3dThe 3D viewport (used for near clipping value).
mvalThe area relative 2D location (such as event->mval, converted into float[2]).
do_clip_planesOptionally clip the start of the ray by the view clipping planes.
r_ray_coThe world-space point where the ray intersects the window plane.
r_ray_normalThe normalized world-space direction of towards mval.
r_ray_startThe world-space starting point of the ray.
r_ray_endThe world-space end point of the segment.
Returns
success, false if the ray is totally clipped.

Definition at line 373 of file view3d_project.cc.

References depsgraph, ED_view3d_clip_segment(), and view3d_win_to_ray_segment().

Referenced by ED_transform_snap_object_project_all_view3d_ex(), ED_transform_snap_object_project_view3d_ex(), and ED_view3d_win_to_ray_clipped().

◆ ED_view3d_win_to_segment_clipped()

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

Calculate a 3D segment from 2D window coordinates. This ray_start is located at the viewpoint, ray_end is a far point. ray_start and ray_end are clipped by the view near and far limits so points along this line are always in view. In orthographic view all resulting segments will be parallel.

Parameters
regionThe region (used for the window width and height).
v3dThe 3D viewport (used for near and far clipping range).
mvalThe area relative 2D location (such as event->mval, converted into float[2]).
r_ray_startThe world-space starting point of the segment.
r_ray_endThe world-space end point of the segment.
do_clip_planesOptionally clip the ray by the view clipping planes.
Returns
success, false if the segment is totally clipped.

Definition at line 676 of file view3d_project.cc.

References depsgraph, ED_view3d_clip_segment(), and view3d_win_to_ray_segment().

Referenced by BMBVH_EdgeVisible(), brush_add_count_iter(), imapaint_pick_face(), knife_find_line_hits(), knife_input_ray_segment(), blender::ed::sculpt_paint::min_distance_edit::min_distance_edit_invoke(), blender::ed::sculpt_paint::sample_curves_3d_brush(), blender::ed::sculpt_paint::sample_curves_surface_3d_brush(), blender::ed::sculpt_paint::AddOperationExecutor::sample_in_center_with_symmetry(), blender::ed::sculpt_paint::AddOperationExecutor::sample_projected(), blender::ed::sculpt_paint::DensityAddOperationExecutor::sample_projected_with_symmetry(), blender::ed::sculpt_paint::AddOperationExecutor::sample_spherical_with_symmetry(), and SCULPT_raycast_init().

◆ ED_view3d_win_to_vector()

void ED_view3d_win_to_vector ( const ARegion * region,
const float mval[2],
float r_out[3] )

Calculate a 3D direction vector from 2D window coordinates. The resulting direction points away from the view-point, making the result useful to perform ray-casts into a 3D scene. In orthographic view all input coordinates result in the same vector.

Note
doesn't rely on ED_view3d_calc_zfac for perspective view, get the vector direction to the mouse cursor as a normalized vector.
Parameters
regionThe region (used for the window width and height).
mvalThe area relative 2D location (such as event->mval converted to float).
r_outThe resulting normalized world-space direction vector.

Definition at line 659 of file view3d_project.cc.

References RegionView3D::is_persp, mul_project_m4_v3(), negate_v3_v3(), normalize_v3(), RegionView3D::persinv, sub_v3_v3(), and RegionView3D::viewinv.

Referenced by ED_view3d_win_to_3d(), ED_view3d_win_to_3d_on_plane(), ED_view3d_win_to_ray(), gizmo_find_intersected_3d_intern(), ViewOpsData::init_navigation(), mesh_bisect_interactive_calc(), and view3d_win_to_ray_segment().

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

◆ ENUM_OPERATORS() [1/2]

ENUM_OPERATORS ( eV3DProjStatus ,
V3D_PROJ_RET_OVERFLOW  )

◆ ENUM_OPERATORS() [2/2]

ENUM_OPERATORS ( eV3DProjTest ,
V3D_PROJ_TEST_CLIP_CONTENT  )

◆ lattice_foreachScreenVert()

◆ mball_foreachScreenElem()

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

◆ mesh_foreachScreenEdge()

◆ mesh_foreachScreenEdge_clip_bb_segment()

◆ mesh_foreachScreenFace()

◆ mesh_foreachScreenVert()

◆ meshobject_foreachScreenVert()

◆ nurbs_foreachScreenVert()

◆ pose_foreachScreenBone()

◆ view3d_opengl_select()

◆ view3d_opengl_select_cache_begin()

void view3d_opengl_select_cache_begin ( )

Optionally cache data for multiple calls to view3d_opengl_select

just avoid GPU_select headers outside this file

Definition at line 469 of file view3d_view.cc.

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

Definition at line 474 of file view3d_view.cc.

References GPU_select_cache_end().

Referenced by get_nearest_editbonepoint(), and mixed_bones_object_selectbuffer().

◆ view3d_opengl_select_ex()

int view3d_opengl_select_ex ( const ViewContext * vc,
GPUSelectBuffer * buffer,
const rcti * input,
eV3DSelectMode select_mode,
eV3DSelectObjectFilter select_filter,
bool do_material_slot_selection )
Note
(vc->obedit == NULL) can be set to explicitly skip edit-object selection.

Definition at line 544 of file view3d_view.cc.

References BKE_modifiers_get_virtual_modifierlist(), BKE_view_layer_edit_object_get(), BKE_view_layer_synced_ensure(), BLI_assert, BLI_linklist_prepend_alloca, BLI_rcti_init_pt_radius(), DrawSelectLoopUserData::buffer, ViewContext::C, CTX_wm_manager(), depsgraph, ViewContext::depsgraph, DRW_draw_select_loop(), DRW_gpu_context_disable(), DRW_gpu_context_enable(), drw_select_filter_object_mode_lock(), drw_select_filter_object_mode_lock_for_weight_paint(), drw_select_loop_pass(), ED_view3d_draw_setup_view(), eModifierType_Armature, G, G_FLAG_PICKSEL, GPU_BACKEND_VULKAN, GPU_DEPTH_LESS_EQUAL, GPU_DEPTH_NONE, GPU_depth_test(), GPU_DEVICE_ATI, GPU_DEVICE_NVIDIA, GPU_DRIVER_OFFICIAL, GPU_OS_ANY, GPU_SELECT_ALL, GPU_select_begin_next(), GPU_select_cache_end(), GPU_select_cache_load_id(), GPU_select_end(), GPU_select_is_cached(), DrawSelectLoopUserData::gpu_select_mode, GPU_SELECT_NEAREST_FIRST_PASS, GPU_SELECT_PICK_ALL, GPU_SELECT_PICK_NEAREST, GPU_type_matches_ex(), DrawSelectLoopUserData::hits, Object::mode, ModifierData::next, OB_MODE_ALL_WEIGHT_PAINT, OB_MODE_OBJECT, OB_MODE_POSE, OB_WIRE, ViewContext::obact, ViewContext::obedit, ArmatureModifierData::object, DrawSelectLoopUserData::pass, DrawSelectLoopUserData::rect, ViewContext::region, RGN_TYPE_WINDOW, ViewContext::rv3d, ViewContext::scene, View3D::shading, SPACE_VIEW3D, ModifierData::type, View3DShading::type, UI_SetTheme(), UI_Theme_Restore(), UI_Theme_Store(), USER_GPU_FLAG_NO_DEPT_PICK, ViewContext::v3d, VIEW3D_SELECT_FILTER_NOP, VIEW3D_SELECT_FILTER_OBJECT_MODE_LOCK, VIEW3D_SELECT_FILTER_WPAINT_POSE_MODE_LOCK, VIEW3D_SELECT_PICK_ALL, VIEW3D_SELECT_PICK_NEAREST, ViewContext::view_layer, RegionView3D::viewmat, ViewContext::win, XRAY_ACTIVE, XRAY_ENABLED, and xy.

Referenced by mixed_bones_object_selectbuffer(), and view3d_opengl_select().

◆ view3d_opengl_select_with_id_filter()

◆ view3d_operator_needs_opengl()

◆ view3d_region_operator_needs_opengl()