Blender
V3.3
|
Go to the source code of this file.
Classes | |
struct | ViewContext |
struct | ViewDepths |
struct | V3DSnapCursorData |
struct | V3DSnapCursorState |
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 | MAXPICKELEMS 2500 |
#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 |
typedef struct V3DSnapCursorData | V3DSnapCursorData |
typedef struct V3DSnapCursorState | V3DSnapCursorState |
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], bool use_depth, float r_cursor_co[3]) |
void | ED_view3d_cursor3d_position_rotation (struct bContext *C, const int mval[2], bool use_depth, enum eV3DCursorOrient orientation, float r_cursor_co[3], float r_cursor_quat[4]) |
void | ED_view3d_cursor3d_update (struct bContext *C, const int mval[2], bool use_depth, enum eV3DCursorOrient orientation) |
struct Camera * | ED_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], 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], float dist) |
bool | ED_view3d_camera_to_view_selected (struct Main *bmain, struct Depsgraph *depsgraph, const struct Scene *scene, struct Object *camera_ob) |
bool | ED_view3d_camera_to_view_selected_with_set_clipping (struct Main *bmain, struct Depsgraph *depsgraph, const struct Scene *scene, struct Object *camera_ob) |
void | ED_view3d_lastview_store (struct RegionView3D *rv3d) |
void | ED_view3d_depth_override (struct Depsgraph *depsgraph, struct ARegion *region, struct View3D *v3d, struct Object *obact, eV3DDepthOverrideMode mode, struct 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 struct ARegion *region, const ViewDepths *depths, const int mval[2], float r_normal[3]) |
bool | ED_view3d_depth_unproject_v3 (const struct ARegion *region, const int mval[2], double depth, float r_location_world[3]) |
ENUM_OPERATORS (eV3DProjTest, V3D_PROJ_TEST_CLIP_CONTENT) | |
bool | ED_view3d_snap_selected_to_location (struct bContext *C, const float snap_target_global[3], int pivot_point) |
void | ED_view3d_cursor_snap_state_default_set (V3DSnapCursorState *state) |
V3DSnapCursorState * | ED_view3d_cursor_snap_state_get (void) |
V3DSnapCursorState * | ED_view3d_cursor_snap_active (void) |
void | ED_view3d_cursor_snap_deactive (V3DSnapCursorState *state) |
void | ED_view3d_cursor_snap_prevpoint_set (V3DSnapCursorState *state, const float prev_point[3]) |
void | ED_view3d_cursor_snap_data_update (V3DSnapCursorState *state, const struct bContext *C, int x, int y) |
V3DSnapCursorData * | ED_view3d_cursor_snap_data_get (void) |
struct SnapObjectContext * | ED_view3d_cursor_snap_context_ensure (struct Scene *scene) |
void | ED_view3d_cursor_snap_draw_util (struct RegionView3D *rv3d, const float loc_prev[3], const float loc_curr[3], const float normal[3], const uchar color_line[4], const uchar color_point[4], eSnapMode snap_elem_type) |
void | meshobject_foreachScreenVert (struct ViewContext *vc, void(*func)(void *userData, struct MVert *eve, const float screen_co[2], int index), void *userData, 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, 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, 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, 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, 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, eV3DProjTest clip_flag) |
void | mball_foreachScreenElem (struct ViewContext *vc, void(*func)(void *userData, struct MetaElem *ml, const float screen_co[2]), void *userData, eV3DProjTest clip_flag) |
void | lattice_foreachScreenVert (struct ViewContext *vc, void(*func)(void *userData, struct BPoint *bp, const float screen_co[2]), void *userData, 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, 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, eV3DProjTest clip_flag) |
void | ED_view3d_project_float_v2_m4 (const struct ARegion *region, const float co[3], float r_co[2], const float mat[4][4]) |
void | ED_view3d_project_float_v3_m4 (const struct ARegion *region, const float co[3], float r_co[3], const 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], bool is_local, const float co[3], short r_co[2], eV3DProjTest flag) |
eV3DProjStatus | ED_view3d_project_short_global (const struct ARegion *region, const float co[3], short r_co[2], eV3DProjTest flag) |
eV3DProjStatus | ED_view3d_project_short_object (const struct ARegion *region, const float co[3], short r_co[2], eV3DProjTest flag) |
eV3DProjStatus | ED_view3d_project_int_ex (const struct ARegion *region, float perspmat[4][4], bool is_local, const float co[3], int r_co[2], eV3DProjTest flag) |
eV3DProjStatus | ED_view3d_project_int_global (const struct ARegion *region, const float co[3], int r_co[2], eV3DProjTest flag) |
eV3DProjStatus | ED_view3d_project_int_object (const struct ARegion *region, const float co[3], int r_co[2], eV3DProjTest flag) |
eV3DProjStatus | ED_view3d_project_float_ex (const struct ARegion *region, float perspmat[4][4], bool is_local, const float co[3], float r_co[2], eV3DProjTest flag) |
eV3DProjStatus | ED_view3d_project_float_global (const struct ARegion *region, const float co[3], float r_co[2], eV3DProjTest flag) |
eV3DProjStatus | ED_view3d_project_float_object (const struct ARegion *region, const float co[3], float r_co[2], 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_ex (const struct RegionView3D *rv3d, const float co[3], bool *r_flip) |
float | ED_view3d_calc_zfac (const struct RegionView3D *rv3d, const float co[3]) |
float | ED_view3d_calc_depth_for_comparison (const struct RegionView3D *rv3d, const float co[3]) |
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 r_ray_start[3], float r_ray_normal[3], bool do_clip_planes) |
bool | ED_view3d_win_to_ray_clipped_ex (struct Depsgraph *depsgraph, const struct ARegion *region, const struct View3D *v3d, const float mval[2], float r_ray_co[3], float r_ray_normal[3], float r_ray_start[3], bool do_clip_planes) |
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], 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], 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], bool do_clip, float r_out[3]) |
void | ED_view3d_win_to_delta (const struct ARegion *region, const float xy_delta[2], float zfac, float r_out[3]) |
void | ED_view3d_win_to_origin (const struct ARegion *region, const float mval[2], float r_out[3]) |
void | ED_view3d_win_to_vector (const struct ARegion *region, const float mval[2], float r_out[3]) |
bool | ED_view3d_win_to_segment_clipped (const struct Depsgraph *depsgraph, const struct ARegion *region, const struct View3D *v3d, const float mval[2], float r_ray_start[3], float r_ray_end[3], bool do_clip_planes) |
void | ED_view3d_ob_project_mat_get (const struct RegionView3D *v3d, const 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_v3 (const struct ARegion *region, const float world[3], float r_region_co[3]) |
void | ED_view3d_project_v2 (const struct ARegion *region, const float world[3], float r_region_co[2]) |
bool | ED_view3d_unproject_v3 (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 (const struct Depsgraph *depsgraph, const struct View3D *v3d, const struct RegionView3D *rv3d, float *r_clipsta, float *r_clipend, 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, 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, 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[4][4], const struct BoundBox *clipbb, 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], 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 struct View3D *v3d, const struct ARegion *region, const struct Depsgraph *depsgraph, char persp, bool use_aspect, float radius) |
void | ED_view3d_backbuf_depth_validate (struct ViewContext *vc) |
int | ED_view3d_backbuf_sample_size_clamp (struct ARegion *region, 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], 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_depth_read_cached_seg (const ViewDepths *vd, 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_ex (struct ViewContext *vc, struct GPUSelectResult *buffer, unsigned int buffer_len, const struct rcti *input, eV3DSelectMode select_mode, eV3DSelectObjectFilter select_filter, bool do_material_slot_selection) |
int | view3d_opengl_select (struct ViewContext *vc, struct GPUSelectResult *buffer, unsigned int buffer_len, const struct rcti *input, eV3DSelectMode select_mode, eV3DSelectObjectFilter select_filter) |
int | view3d_opengl_select_with_id_filter (struct ViewContext *vc, struct GPUSelectResult *buffer, unsigned int buffer_len, const struct rcti *input, eV3DSelectMode select_mode, eV3DSelectObjectFilter select_filter, uint select_id) |
float | ED_view3d_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 RegionView3D * | ED_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 (const struct Object *ob, struct RegionView3D *rv3d) |
void | ED_view3d_init_mats_rv3d_gl (const struct Object *ob, struct RegionView3D *rv3d) |
struct RV3DMatrixStore * | ED_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], int facemap) |
struct RenderEngineType * | ED_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 Base * | ED_view3d_give_base_under_cursor (struct bContext *C, const int mval[2]) |
struct Object * | ED_view3d_give_object_under_cursor (struct bContext *C, const int mval[2]) |
struct Object * | ED_view3d_give_material_slot_under_cursor (struct bContext *C, const int mval[2], int *r_material_slot) |
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 (char view, char view_axis_roll, float r_quat[4]) |
bool | ED_view3d_quat_to_axis_view (const float viewquat[4], float epsilon, char *r_view, char *r_view_axis_rotation) |
bool | ED_view3d_quat_to_axis_view_and_reset_quat (float viewquat[4], 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, char persp) |
bool | ED_view3d_persp_ensure (const struct Depsgraph *depsgraph, struct View3D *v3d, struct ARegion *region) |
bool | ED_view3d_camera_view_zoom_scale (struct RegionView3D *rv3d, const float scale) |
bool | ED_view3d_camera_view_pan (struct ARegion *region, const float event_ofs[2]) |
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, 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, bool do_rotate, bool do_translate) |
bool | ED_view3d_camera_lock_autokey (struct View3D *v3d, struct RegionView3D *rv3d, struct bContext *C, bool do_rotate, bool do_translate) |
void | ED_view3d_lock_clear (struct View3D *v3d) |
bool | ED_view3d_camera_lock_undo_test (const View3D *v3d, const RegionView3D *rv3d, struct bContext *C) |
bool | ED_view3d_camera_lock_undo_push (const char *str, View3D *v3d, struct RegionView3D *rv3d, struct bContext *C) |
bool | ED_view3d_camera_lock_undo_grouped_push (const char *str, View3D *v3d, struct RegionView3D *rv3d, struct bContext *C) |
float | ED_view3d_offset_distance (const float mat[4][4], const float ofs[3], float fallback_dist) |
void | ED_view3d_distance_set (struct RegionView3D *rv3d, float dist) |
bool | ED_view3d_distance_set_from_location (struct RegionView3D *rv3d, const float dist_co[3], 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[8]) |
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, bool do_foreground, 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_gizmo_mesh_preselect_clear (struct wmGizmo *gz) |
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, bool reset_all) |
Definition at line 1031 of file ED_view3d.h.
Definition at line 1030 of file ED_view3d.h.
#define IS_CLIPPED 12000 |
Definition at line 213 of file ED_view3d.h.
#define MAXPICKELEMS 2500 |
The default value for the maximum number of elements that can be selected at once using view-port selection.
Definition at line 894 of file ED_view3d.h.
#define USE_SNAP_DETECT_FROM_KEYMAP_HACK |
Definition at line 282 of file ED_view3d.h.
#define V3D_PROJ_TEST_ALL |
Definition at line 266 of file ED_view3d.h.
#define V3D_PROJ_TEST_CLIP_CONTENT_DEFAULT |
Definition at line 270 of file ED_view3d.h.
#define V3D_PROJ_TEST_CLIP_DEFAULT (V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_WIN | V3D_PROJ_TEST_CLIP_NEAR) |
Definition at line 264 of file ED_view3d.h.
#define VIEW3D_DIST_FALLBACK 1.0f |
Definition at line 1230 of file ED_view3d.h.
#define VIEW3D_MARGIN 1.4f |
Definition at line 1229 of file ED_view3d.h.
#define XRAY_ACTIVE | ( | v3d | ) | (XRAY_ENABLED(v3d) && ((v3d)->shading.type < OB_MATERIAL)) |
Definition at line 1300 of file ED_view3d.h.
#define XRAY_ALPHA | ( | v3d | ) | (((v3d)->shading.type == OB_WIRE) ? (v3d)->shading.xray_alpha_wire : (v3d)->shading.xray_alpha) |
Definition at line 1294 of file ED_view3d.h.
#define XRAY_ENABLED | ( | v3d | ) | (XRAY_FLAG_ENABLED(v3d) && (XRAY_ALPHA(v3d) < 1.0f)) |
Definition at line 1299 of file ED_view3d.h.
#define XRAY_FLAG | ( | v3d | ) | (((v3d)->shading.type == OB_WIRE) ? V3D_SHADING_XRAY_WIREFRAME : V3D_SHADING_XRAY) |
Definition at line 1296 of file ED_view3d.h.
Definition at line 1298 of file ED_view3d.h.
typedef struct V3DSnapCursorData V3DSnapCursorData |
typedef struct V3DSnapCursorState V3DSnapCursorState |
typedef struct ViewContext ViewContext |
typedef struct ViewDepths ViewDepths |
enum eV3DCursorOrient |
Enumerator | |
---|---|
V3D_CURSOR_ORIENT_NONE | |
V3D_CURSOR_ORIENT_VIEW | |
V3D_CURSOR_ORIENT_XFORM | |
V3D_CURSOR_ORIENT_GEOM |
Definition at line 85 of file ED_view3d.h.
Definition at line 180 of file ED_view3d.h.
enum eV3DPlaceDepth |
Enumerator | |
---|---|
V3D_PLACE_DEPTH_SURFACE | |
V3D_PLACE_DEPTH_CURSOR_PLANE | |
V3D_PLACE_DEPTH_CURSOR_VIEW |
Definition at line 291 of file ED_view3d.h.
enum eV3DPlaceOrient |
Enumerator | |
---|---|
V3D_PLACE_ORIENT_SURFACE | |
V3D_PLACE_ORIENT_DEFAULT |
Definition at line 297 of file ED_view3d.h.
enum eV3DProjStatus |
Definition at line 216 of file ED_view3d.h.
enum 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: T32214. 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).
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 233 of file ED_view3d.h.
enum eV3DSelectMode |
Enumerator | |
---|---|
VIEW3D_SELECT_ALL | |
VIEW3D_SELECT_PICK_ALL | |
VIEW3D_SELECT_PICK_NEAREST |
Definition at line 896 of file ED_view3d.h.
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 905 of file ED_view3d.h.
enum 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 283 of file ED_view3d.h.
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, | ||
eV3DProjTest | clip_flag | ||
) |
ED_view3d_init_mats_rv3d must be called first.
Definition at line 743 of file view3d_iterators.c.
References content_planes_from_clip_flag(), Object::data, EBONE_VISIBLE, ED_view3d_check_mats_rv3d, bArmature::edbo, ListBase::first, EditBone::head, EditBone::next, ViewContext::obedit, ViewContext::region, ViewContext::rv3d, EditBone::tail, V3D_PROJ_TEST_CLIP_CONTENT, view3d_project_segment_to_screen_with_clip_tag(), view3d_project_segment_to_screen_with_content_clip_planes(), ARegion::winx, ARegion::winy, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by armature_circle_select(), and do_lasso_select_armature().
void ED_draw_object_facemap | ( | struct Depsgraph * | depsgraph, |
struct Object * | ob, | ||
const float | col[4], | ||
int | facemap | ||
) |
Definition at line 44 of file drawobject.c.
References MLoopTri_Store::array, BKE_object_get_evaluated_mesh(), CD_FACEMAP, MVert::co, col, copy_v3_v3(), CustomData_get_layer(), Object::data, DEG_get_evaluated_object(), depsgraph, facemap, GPU_batch_create, GPU_batch_discard(), GPU_batch_draw(), GPU_batch_program_set_builtin(), GPU_batch_uniform_4fv, GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_front_facing(), GPU_PRIM_TRIS, GPU_SHADER_3D_UNIFORM_COLOR, GPU_vertbuf_attr_get_raw_data(), GPU_vertbuf_create_with_format, GPU_vertbuf_data_alloc(), GPU_vertbuf_data_resize(), GPU_vertbuf_discard(), GPU_vertbuf_raw_step(), GPU_vertformat_attr_add(), GPUBatch, MPoly::loopstart, Mesh_Runtime::looptris, Mesh::mloop, Mesh::mpoly, Mesh::mvert, NULL, OB_MESH, OB_NEG_SCALE, Mesh::pdata, poly_to_tri_count(), Mesh::runtime, Mesh::totloop, MPoly::totloop, Mesh::totpoly, Object::transflag, MLoopTri::tri, Object::type, and MLoop::v.
Referenced by ED_gizmo_draw_preset_facemap().
Definition at line 277 of file view3d_view.c.
References C, and ED_view3d_context_user_region().
Referenced by VIEW3D_OT_object_as_camera(), VIEW3D_OT_view_axis(), VIEW3D_OT_view_camera(), VIEW3D_OT_view_orbit(), VIEW3D_OT_view_persportho(), and VIEW3D_OT_view_roll().
Referenced by sequencer_preview_region_draw().
Could move this elsewhere, but tied into ED_view3d_grid_scale
Referenced by ED_object_new_primitive_matrix(), object_camera_add_exec(), OVERLAY_gpencil_cache_init(), and WM_operator_view3d_unit_defaults().
bool ED_view3d_area_user_region | ( | const struct ScrArea * | area, |
const struct View3D * | v3d, | ||
struct 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.
bool ED_view3d_autodist | ( | struct Depsgraph * | depsgraph, |
struct ARegion * | region, | ||
struct View3D * | v3d, | ||
const int | mval[2], | ||
float | mouse_worldloc[3], | ||
bool | alphaoverride, | ||
const float | fallback_depth_pt[3] | ||
) |
Get the world-space 3d location from a screen-space 2d point. TODO: Implement #alphaoverride. We don't want to zoom into billboards.
mval | Input screen-space pixel location. |
mouse_worldloc | Output world-space location. |
fallback_depth_pt | Use this points depth when no depth can be found. |
Referenced by depthdropper_depth_sample_pt(), ED_view3d_cursor3d_position(), paint_proj_stroke(), viewcenter_pick_invoke(), and viewops_data_create().
bool ED_view3d_autodist_simple | ( | struct ARegion * | region, |
const int | mval[2], | ||
float | mouse_worldloc[3], | ||
int | margin, | ||
const float * | force_depth | ||
) |
No 4x4 sampling, run ED_view3d_depth_override first.
Definition at line 1063 of file view3d_utils.c.
References ED_view3d_unproject_v3(), float(), and view_autodist_depth_margin().
Referenced by annotation_stroke_convertcoords(), gpencil_stroke_convertcoords(), gpencil_stroke_convertcoords_tpoint(), and object_transfer_mode_reposition_view_pivot().
char ED_view3d_axis_view_opposite | ( | char | view | ) |
Definition at line 1435 of file view3d_utils.c.
References RV3D_VIEW_BACK, RV3D_VIEW_BOTTOM, RV3D_VIEW_FRONT, RV3D_VIEW_LEFT, RV3D_VIEW_RIGHT, RV3D_VIEW_TOP, RV3D_VIEW_USER, and view.
Referenced by vieworbit_exec().
void ED_view3d_backbuf_depth_validate | ( | struct ViewContext * | vc | ) |
Back-buffer select and draw support.
allow for small values [0.5 - 2.5], and large values, FLT_MAX by clamping by the area size
Definition at line 2195 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().
void ED_view3d_background_color_get | ( | const struct Scene * | scene, |
const struct View3D * | v3d, | ||
float | r_color[3] | ||
) |
Referenced by gizmo_axis_draw(), GPENCIL_draw_scene(), and OVERLAY_fade_cache_init().
void ED_view3d_buttons_region_layout_ex | ( | const struct bContext * | C, |
struct ARegion * | region, | ||
const char * | category_override | ||
) |
Referenced by buttons_main_region_layout().
void ED_view3d_calc_camera_border | ( | const struct Scene * | scene, |
struct Depsgraph * | depsgraph, | ||
const struct ARegion * | region, | ||
const struct View3D * | v3d, | ||
const struct RegionView3D * | rv3d, | ||
struct rctf * | r_viewborder, | ||
bool | no_shift | ||
) |
Referenced by annotation_paint_initstroke(), drawFlyPixel(), drawWalkPixel(), ED_annotation_draw_view3d(), eevee_engine_init(), gpencil_camera_view_subrect(), gpencil_paint_initstroke(), gpencil_point_conversion_init(), initFlyInfo(), blender::io::gpencil::GpencilIO::prepare_camera_params(), render_border_exec(), view_zoom_to_window_xy_camera(), and WIDGETGROUP_camera_view_draw_prepare().
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] | ||
) |
Referenced by view3d_center_camera_exec(), and view3d_set_1_to_1_viewborder().
float ED_view3d_calc_depth_for_comparison | ( | const struct RegionView3D * | rv3d, |
const float | co[3] | ||
) |
Calculate a depth value from co
(result should only be used for comparison).
Referenced by annotation_stroke_eraser_is_occluded(), and gpencil_stroke_eraser_is_occluded().
bool ED_view3d_calc_render_border | ( | const struct Scene * | scene, |
struct Depsgraph * | depsgraph, | ||
struct View3D * | v3d, | ||
struct ARegion * | region, | ||
struct rcti * | rect | ||
) |
Referenced by wm_region_test_render_do_draw().
float ED_view3d_calc_zfac | ( | const struct RegionView3D * | rv3d, |
const float | co[3] | ||
) |
See ED_view3d_calc_zfac_ex doc-string.
Referenced by annotation_stroke_convertcoords(), brush_edit_init(), calc_local_y(), calculateZfac(), blender::io::gpencil::GpencilIO::create_object_list(), drawVertSlide(), ED_view3d_cursor3d_position(), gpencil_brush_calc_midpoint(), gpencil_brush_grab_calc_dvec(), gpencil_point_xy_to_3d(), gpencil_stroke_convertcoords(), gpencil_stroke_convertcoords_tpoint(), mesh_bisect_interactive_calc(), move3d_get_translate(), paint_calc_object_space_radius(), view3d_zoom_border_exec(), view_zoom_to_window_xy_3d(), and viewops_data_create().
float ED_view3d_calc_zfac_ex | ( | const struct RegionView3D * | rv3d, |
const float | co[3], | ||
bool * | r_flip | ||
) |
Calculate a depth value from co, use with ED_view3d_win_to_delta.
r_flip | Set to zfac < 0.0 before the value is made signed. Since it's important in some cases to know if the value was flipped. |
co
multiplied by rv3d->persmat
matrix, with additional sanitation to ensure the result is never negative as this isn't useful for tool-code. Referenced by ED_view3d_cursor3d_position(), and gpencil_brush_randomize_apply().
bool ED_view3d_camera_autokey | ( | const struct Scene * | scene, |
struct ID * | id_key, | ||
struct bContext * | C, | ||
bool | do_rotate, | ||
bool | do_translate | ||
) |
Referenced by ED_view3d_cameracontrol_update().
struct Camera* ED_view3d_camera_data_get | ( | struct View3D * | v3d, |
struct RegionView3D * | rv3d | ||
) |
Definition at line 94 of file view3d_utils.c.
References View3D::camera, Object::data, NULL, OB_CAMERA, RegionView3D::persp, RV3D_CAMOB, and Object::type.
Referenced by uv_from_view_exec(), and uv_from_view_invoke().
bool ED_view3d_camera_lock_autokey | ( | struct View3D * | v3d, |
struct RegionView3D * | rv3d, | ||
struct bContext * | C, | ||
bool | do_rotate, | ||
bool | do_translate | ||
) |
Call after modifying a locked view.
Definition at line 665 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_ex(), viewdolly_modal(), viewmove_modal(), viewroll_modal(), viewrotate_modal(), viewzoom_exec(), viewzoom_invoke(), and viewzoom_modal().
bool ED_view3d_camera_lock_check | ( | const struct View3D * | v3d, |
const struct RegionView3D * | rv3d | ||
) |
Referenced by view3d_all_exec(), view3d_from_minmax(), view3d_from_minmax_multi(), view3d_zoom_border_exec(), viewmove_apply(), vieworbit_exec(), viewroll_exec(), viewselected_exec(), viewzoom_apply(), and viewzoom_exec().
void ED_view3d_camera_lock_init | ( | const struct Depsgraph * | depsgraph, |
struct View3D * | v3d, | ||
struct RegionView3D * | rv3d | ||
) |
Referenced by ED_view3d_smooth_view_ex(), view3d_zoom_border_exec(), viewops_data_create(), vieworbit_exec(), and viewroll_exec().
void ED_view3d_camera_lock_init_ex | ( | const struct Depsgraph * | depsgraph, |
struct View3D * | v3d, | ||
struct 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).
bool ED_view3d_camera_lock_sync | ( | const struct Depsgraph * | depsgraph, |
struct View3D * | v3d, | ||
struct RegionView3D * | rv3d | ||
) |
Copy the view to the camera, return true if.
Apply the 3D Viewport transformation back to the camera object.
Referenced by ED_view3d_smooth_view_ex(), view3d_smoothview_apply_ex(), viewdolly_apply(), viewdolly_exec(), viewmove_apply(), viewroll_apply(), viewroll_modal(), viewrotate_apply(), viewzoom_apply_3d(), and viewzoom_exec().
bool ED_view3d_camera_lock_undo_grouped_push | ( | const char * | str, |
View3D * | v3d, | ||
struct RegionView3D * | rv3d, | ||
struct bContext * | C | ||
) |
A version of ED_view3d_camera_lock_undo_push that performs a grouped undo push.
Definition at line 731 of file view3d_utils.c.
References C, str, and view3d_camera_lock_undo_ex().
Referenced by ED_view3d_smooth_view_undo_end(), and viewzoom_exec().
bool ED_view3d_camera_lock_undo_push | ( | const char * | str, |
View3D * | v3d, | ||
struct RegionView3D * | rv3d, | ||
struct bContext * | C | ||
) |
Create an undo step when the camera is locked to the view.
str | The name of the undo step (typically wmOperatorType.name should be used). |
Definition at line 726 of file view3d_utils.c.
References C, str, and view3d_camera_lock_undo_ex().
Referenced by ED_view3d_smooth_view_undo_end(), fly_modal(), viewdolly_modal(), viewmove_modal(), viewpan_invoke(), viewrotate_modal(), viewzoom_modal(), and walk_modal().
bool ED_view3d_camera_lock_undo_test | ( | const View3D * | v3d, |
const RegionView3D * | rv3d, | ||
struct bContext * | C | ||
) |
Check if creating an undo step should be performed if the viewport moves.
Definition at line 692 of file view3d_utils.c.
References C, 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().
bool ED_view3d_camera_to_view_selected | ( | struct Main * | bmain, |
struct Depsgraph * | depsgraph, | ||
const struct Scene * | scene, | ||
struct Object * | camera_ob | ||
) |
Referenced by view3d_camera_to_view_selected_exec().
bool ED_view3d_camera_to_view_selected_with_set_clipping | ( | struct Main * | bmain, |
struct Depsgraph * | depsgraph, | ||
const struct Scene * | scene, | ||
struct Object * | camera_ob | ||
) |
Referenced by object_preview_scene_create().
Utility to pan when in camera view.
event_ofs | The offset the pan in screen (pixel) coordinates. |
Definition at line 525 of file view3d_utils.c.
References BKE_screen_view3d_zoom_to_fac(), RegionView3D::camdx, RegionView3D::camdy, RegionView3D::camzoom, CLAMP, ARegion::regiondata, ARegion::winx, and ARegion::winy.
Referenced by viewmove_apply().
bool ED_view3d_camera_view_zoom_scale | ( | struct RegionView3D * | rv3d, |
const float | scale | ||
) |
Utility to scale zoom level when in camera-view RegionView3D.camzoom and apply limits.
Definition at line 512 of file view3d_utils.c.
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.
bool ED_view3d_clip_range_get | ( | const struct Depsgraph * | depsgraph, |
const struct View3D * | v3d, | ||
const struct RegionView3D * | rv3d, | ||
float * | r_clipsta, | ||
float * | r_clipend, | ||
bool | use_ortho_factor | ||
) |
Referenced by knife_recalc_ortho(), proj_paint_state_viewport_init(), texture_paint_image_from_view_exec(), and view3d_win_to_ray_segment().
bool ED_view3d_clip_segment | ( | const struct RegionView3D * | rv3d, |
float | ray_start[3], | ||
float | ray_end[3] | ||
) |
void ED_view3d_clipping_calc_from_boundbox | ( | float | clip[4][4], |
const struct BoundBox * | clipbb, | ||
bool | is_flip | ||
) |
Referenced by calc_local_clipping().
bool ED_view3d_clipping_clamp_minmax | ( | const struct RegionView3D * | rv3d, |
float | min[3], | ||
float | max[3] | ||
) |
Clamp min/max by the viewport clipping.
Referenced by view3d_all_exec(), and viewselected_exec().
void ED_view3d_clipping_local | ( | struct RegionView3D * | rv3d, |
const float | mat[4][4] | ||
) |
Definition at line 755 of file view3d_edit.c.
References calc_local_clipping(), RegionView3D::clip_local, RegionView3D::clipbb, RegionView3D::rflag, and RV3D_CLIPPING.
Referenced by DRW_draw_depth_object(), ED_view3d_init_mats_rv3d(), lattice_foreachScreenVert(), mesh_foreachScreenEdge(), mesh_foreachScreenEdge_clip_bb_segment(), mesh_foreachScreenVert(), meshobject_foreachScreenVert(), nurbs_foreachScreenVert(), and project_paint_begin().
bool ED_view3d_clipping_test | ( | const struct RegionView3D * | rv3d, |
const float | co[3], | ||
bool | is_local | ||
) |
Return true when co
is hidden by the 3D views clipping planes.
is_local | When true use local (object-space) ED_view3d_clipping_local must run first, then all comparisons can be done in local-space. |
co
is outside all clipping planes.Referenced by ed_view3d_project__internal(), 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(), project_paint_occlude_ptv_clip(), and sculpt_brush_test_clipping().
Definition at line 219 of file view3d_utils.c.
References blender::compositor::area(), BKE_area_find_region_active_win(), BKE_screen_find_big_area(), C, CTX_wm_area(), CTX_wm_area_set(), CTX_wm_region_set(), CTX_wm_screen(), NULL, and SPACE_VIEW3D.
Referenced by screen_opengl_render_init().
struct RegionView3D* ED_view3d_context_rv3d | ( | struct bContext * | C | ) |
Get 3D region from context, also if mouse is in header or toolbar.
Definition at line 82 of file space_view3d.c.
References blender::compositor::area(), BKE_area_find_region_active_win(), C, CTX_wm_area(), CTX_wm_region_view3d(), NULL, ARegion::regiondata, and SPACE_VIEW3D.
Referenced by clear_render_border_exec(), ED_curve_add_nurbs_primitive(), edbm_screw_invoke(), edbm_sort_elements_exec(), edbm_spin_invoke(), gizmo_mesh_bisect_update_from_op(), gizmo_mesh_spin_init_refresh(), gizmo_mesh_spin_redo_draw_prepare(), mesh_bisect_exec(), render_border_exec(), spin_exec(), and spin_invoke().
bool ED_view3d_context_user_region | ( | struct bContext * | C, |
struct View3D ** | r_v3d, | ||
struct ARegion ** | r_region | ||
) |
Ideally would return an rv3d but in some cases the region is needed too so return that, the caller can then access the region->regiondata
.
Definition at line 98 of file space_view3d.c.
References blender::compositor::area(), C, CTX_wm_area(), CTX_wm_region(), ED_view3d_area_user_region(), if(), NULL, ARegion::regiondata, ARegion::regiontype, RGN_TYPE_WINDOW, RV3D_LOCK_ROTATION, SPACE_VIEW3D, and RegionView3D::viewlock.
Referenced by ED_operator_rv3d_user_region_poll(), region_quadview_exec(), screen_opengl_render_init(), view3d_camera_to_view_exec(), view3d_camera_to_view_poll(), view3d_camera_user_poll(), view3d_center_camera_exec(), view3d_setobjectascamera_exec(), view3d_zoom_1_to_1_camera_exec(), view_axis_exec(), view_camera_exec(), vieworbit_exec(), viewpersportho_exec(), and viewroll_exec().
void ED_view3d_cursor3d_position | ( | struct bContext * | C, |
const int | mval[2], | ||
bool | use_depth, | ||
float | r_cursor_co[3] | ||
) |
Cursor position in r_cursor_co
, result in r_cursor_co
, mval
in region coords.
event->mval
here, called by #object_add(). Definition at line 823 of file view3d_edit.c.
References C, copy_v3_v3(), CTX_data_ensure_evaluated_depsgraph(), CTX_wm_region(), CTX_wm_view3d(), depsgraph, ED_view3d_autodist(), ED_view3d_calc_zfac(), ED_view3d_calc_zfac_ex(), ED_view3d_win_to_3d_int(), negate_v3_v3(), NULL, RegionView3D::ofs, ARegion::regiondata, and view3d_operator_needs_opengl().
Referenced by collection_add_info_get_from_op(), ED_view3d_cursor3d_position_rotation(), empty_drop_named_image_invoke(), object_add_named_exec(), object_data_instance_add_exec(), and object_transform_to_mouse_exec().
void ED_view3d_cursor3d_position_rotation | ( | struct bContext * | C, |
const int | mval[2], | ||
bool | use_depth, | ||
enum eV3DCursorOrient | orientation, | ||
float | r_cursor_co[3], | ||
float | r_cursor_quat[4] | ||
) |
Definition at line 865 of file view3d_edit.c.
References angle_normalized_qt(), axis_dominant_v3_ortho_single(), C, copy_qt_qt(), copy_v3_v3(), CTX_data_ensure_evaluated_depsgraph(), CTX_data_scene(), CTX_wm_region(), CTX_wm_view3d(), dot_v3v3(), ED_transform_calc_orientation_from_type(), ED_transform_snap_object_context_create(), ED_transform_snap_object_context_destroy(), ED_transform_snap_object_project_view3d_ex(), ED_view3d_cursor3d_position(), mat3_to_quat(), mul_qt_qtqt(), mul_qt_v3(), negate_v3(), normalize_v3(), NULL, project_plane_v3_v3v3(), SnapObjectContext::region, ARegion::regiondata, rotation_between_vecs_to_quat(), SCE_SNAP_MODE_FACE_RAYCAST, SCE_SNAP_TARGET_ALL, scene, SNAP_GEOM_FINAL, UNPACK2, SnapObjectContext::v3d, V3D_CURSOR_ORIENT_GEOM, V3D_CURSOR_ORIENT_NONE, V3D_CURSOR_ORIENT_VIEW, V3D_CURSOR_ORIENT_XFORM, and RegionView3D::viewquat.
Referenced by ED_view3d_cursor3d_update().
void ED_view3d_cursor3d_update | ( | struct bContext * | C, |
const int | mval[2], | ||
bool | use_depth, | ||
enum eV3DCursorOrient | orientation | ||
) |
Definition at line 984 of file view3d_edit.c.
References angle_signed_on_axis_v3v3_v3(), axis_angle_to_mat3(), BKE_scene_cursor_quat_to_rot(), BKE_scene_cursor_rot_to_quat(), C, copy_qt_qt(), CTX_data_scene(), CTX_wm_message_bus(), CTX_wm_region(), CTX_wm_view3d(), Scene::cursor, DEG_id_tag_update(), ED_view3d_cursor3d_position_rotation(), ED_view3d_project_float_global(), equals_v4v4(), Scene::id, ID_RECALC_COPY_ON_WRITE, View3D::localvd, View3DCursor::location, SnapObjectContext::mval, NA_EDITED, NC_SCENE, NC_SPACE, ND_SPACE_VIEW3D, negate_v3_v3(), View3D::ob_center_cursor, RegionView3D::ofs_lock, wmMsgParams_RNA::ptr, quat_to_mat3(), SnapObjectContext::region, ARegion::regiondata, RNA_pointer_create(), ROT_MODE_AXISANGLE, View3DCursor::rotation_angle, View3DCursor::rotation_axis, View3DCursor::rotation_mode, RV3D_VIEW_IS_AXIS, scene, USER_LOCK_CURSOR_ADJUST, SnapObjectContext::v3d, V3D_PROJ_RET_OK, V3D_PROJ_TEST_NOP, RegionView3D::view, ARegion::winx, ARegion::winy, WM_event_add_notifier(), WM_msg_publish_rna_params(), and zero_v2().
Referenced by edbm_point_normals_modal(), paintcurve_cursor_invoke(), and view3d_cursor3d_invoke().
V3DSnapCursorState* ED_view3d_cursor_snap_active | ( | void | ) |
Definition at line 966 of file view3d_cursor_snap.c.
References BLI_addtail(), g_data_intern, SnapCursorDataIntern::handle, MEM_mallocN, SnapStateIntern::snap_state, SnapCursorDataIntern::state_default, SnapCursorDataIntern::state_intern, and v3d_cursor_snap_activate().
Referenced by snap_gizmo_setup(), view3d_interactive_add_begin(), view3d_ob_drop_draw_activate(), and WIDGETGROUP_placement_setup().
struct SnapObjectContext* ED_view3d_cursor_snap_context_ensure | ( | struct Scene * | scene | ) |
Definition at line 1037 of file view3d_cursor_snap.c.
References g_data_intern, scene, SnapCursorDataIntern::snap_context_v3d, and v3d_cursor_snap_context_ensure().
Referenced by ED_gizmotypes_snap_3d_context_ensure().
V3DSnapCursorData* ED_view3d_cursor_snap_data_get | ( | void | ) |
Definition at line 1031 of file view3d_cursor_snap.c.
References g_data_intern, and SnapCursorDataIntern::snap_data.
Referenced by ED_gizmotypes_snap_3d_data_get(), ED_gizmotypes_snap_3d_invert_snap_get(), ED_gizmotypes_snap_3d_is_enabled(), gizmo_snap_rna_location_get_fn(), gizmo_snap_rna_location_set_fn(), gizmo_snap_rna_normal_get_fn(), gizmo_snap_rna_snap_elem_index_get_fn(), snap_gizmo_test_select(), view3d_interactive_add_calc_snap(), and view3d_ob_drop_matrix_from_snap().
void ED_view3d_cursor_snap_data_update | ( | V3DSnapCursorState * | state, |
const struct bContext * | C, | ||
int | x, | ||
int | y | ||
) |
Referenced by ED_gizmotypes_snap_3d_data_get(), snap_gizmo_test_select(), and view3d_interactive_add_begin().
void ED_view3d_cursor_snap_deactive | ( | V3DSnapCursorState * | state | ) |
Definition at line 980 of file view3d_cursor_snap.c.
References BLI_listbase_is_empty(), BLI_remlink(), g_data_intern, MEM_freeN, state, SnapCursorDataIntern::state_intern, STATE_INTERN_GET, and v3d_cursor_snap_free().
Referenced by preview_plane_free_fn(), snap_gizmo_free(), view3d_interactive_add_exit(), and view3d_ob_drop_draw_deactivate().
void ED_view3d_cursor_snap_draw_util | ( | struct RegionView3D * | rv3d, |
const float | loc_prev[3], | ||
const float | loc_curr[3], | ||
const float | normal[3], | ||
const uchar | color_line[4], | ||
const uchar | color_point[4], | ||
eSnapMode | snap_elem_type | ||
) |
Definition at line 369 of file view3d_cursor_snap.c.
References add_v3_v3(), add_v3_v3v3(), copy_m4_m4(), ED_view3d_pixel_size(), GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_PRIM_LINES, GPU_SHADER_3D_LINE_DASHED_UNIFORM_COLOR, GPU_SHADER_3D_UNIFORM_COLOR, GPU_vertformat_attr_add(), GPU_viewport_size_get_f(), imm_drawcircball(), immBegin(), immBindBuiltinProgram(), immEnd(), immUnbindProgram(), immUniform1f(), immUniform2f(), immUniformColor4ubv(), immVertex3f(), immVertex3fv(), immVertexFormat(), mul_v3_v3fl(), negate_v3_v3(), normal, pos, SCE_SNAP_MODE_EDGE_PERPENDICULAR, sub_v3_v3v3(), TH_VERTEX_SIZE, UI_GetThemeValuef(), v1, v2, and RegionView3D::viewinv.
Referenced by drawSnapping(), and v3d_cursor_snap_draw_fn().
void ED_view3d_cursor_snap_prevpoint_set | ( | V3DSnapCursorState * | state, |
const float | prev_point[3] | ||
) |
Definition at line 995 of file view3d_cursor_snap.c.
References copy_v3_v3(), ED_view3d_cursor_snap_state_get(), g_data_intern, NULL, SnapCursorDataIntern::prevpoint_stack, and state.
Referenced by gizmo_snap_rna_prevpoint_set_fn(), view3d_interactive_add_begin(), and view3d_interactive_add_modal().
void ED_view3d_cursor_snap_state_default_set | ( | V3DSnapCursorState * | state | ) |
Definition at line 953 of file view3d_cursor_snap.c.
References V3DSnapCursorState::draw_box, V3DSnapCursorState::draw_plane, g_data_intern, V3DSnapCursorState::gzgrp_type, NULL, V3DSnapCursorState::prevpoint, state, and SnapCursorDataIntern::state_default.
Referenced by idp_rna_plane_axis_set_fn(), idp_rna_plane_depth_set_fn(), idp_rna_plane_orient_set_fn(), idp_rna_snap_target_set_fn(), and idp_rna_use_plane_axis_auto_set_fn().
V3DSnapCursorState* ED_view3d_cursor_snap_state_get | ( | void | ) |
Definition at line 905 of file view3d_cursor_snap.c.
References BLI_listbase_is_empty(), g_data_intern, ListBase::last, SnapCursorDataIntern::state_default, and SnapCursorDataIntern::state_intern.
Referenced by ED_view3d_cursor_snap_data_update(), ED_view3d_cursor_snap_prevpoint_set(), gizmo_snap_state_from_rna_get(), idp_rna_plane_axis_get_fn(), idp_rna_plane_axis_set_fn(), idp_rna_plane_depth_get_fn(), idp_rna_plane_depth_set_fn(), idp_rna_plane_orient_get_fn(), idp_rna_plane_orient_set_fn(), idp_rna_snap_target_get_fn(), idp_rna_snap_target_set_fn(), idp_rna_use_plane_axis_auto_get_fn(), idp_rna_use_plane_axis_auto_set_fn(), v3d_cursor_snap_draw_fn(), v3d_cursor_snap_poll_fn(), view3d_interactive_add_begin(), and view3d_ob_drop_copy_local_id().
void ED_view3d_datamask | ( | const struct bContext * | C, |
const struct Scene * | scene, | ||
const struct View3D * | v3d, | ||
struct CustomData_MeshMasks * | r_cddata_masks | ||
) |
Referenced by screen_opengl_render_init().
void ED_view3d_depth_override | ( | struct Depsgraph * | depsgraph, |
struct ARegion * | region, | ||
struct View3D * | v3d, | ||
struct Object * | obact, | ||
eV3DDepthOverrideMode | mode, | ||
struct ViewDepths ** | r_depths | ||
) |
Redraw the viewport depth buffer.
Definition at line 2294 of file view3d_draw.c.
References DEG_get_evaluated_object(), DEG_get_evaluated_scene(), depsgraph, DRW_draw_depth_loop(), DRW_draw_depth_object(), ED_view3d_depths_free(), ED_view3d_draw_setup_view(), View3D_Runtime::flag, View3D::flag, View3D::flag2, 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_HIDE_OVERLAYS, V3D_RUNTIME_DEPTHBUF_OVERRIDDEN, V3D_SELECT_OUTLINE, view3d_depths_create(), 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().
bool ED_view3d_depth_read_cached | ( | const ViewDepths * | vd, |
const int | mval[2], | ||
int | margin, | ||
float * | r_depth | ||
) |
Definition at line 1630 of file view3d_utils.c.
References BLI_array_iter_spiral_square, BLI_assert, data, ViewDepths::depth_range, depth_read_test_fn(), ViewDepths::depths, ViewDepths::h, max_ii(), min_ii(), ReadData::r_depth, ViewDepths::w, x, and y.
Referenced by annotation_stroke_eraser_is_occluded(), annotation_stroke_newfrombuffer(), depth_segment_cb(), ED_view3d_depth_read_cached_normal(), gpencil_get_depth_array(), gpencil_primitive_update_strokes(), gpencil_stroke_eraser_is_occluded(), gpencil_stroke_newfrombuffer(), object_transform_axis_target_modal(), and stroke_elem_project().
bool ED_view3d_depth_read_cached_normal | ( | const struct ARegion * | region, |
const ViewDepths * | depths, | ||
const int | mval[2], | ||
float | r_normal[3] | ||
) |
Referenced by curve_draw_event_add_first(), object_transform_axis_target_modal(), and stroke_elem_project().
bool ED_view3d_depth_read_cached_seg | ( | const ViewDepths * | vd, |
const int | mval_sta[2], | ||
const int | mval_end[2], | ||
int | margin, | ||
float * | depth | ||
) |
Definition at line 1107 of file view3d_utils.c.
References BLI_bitmap_draw_2d_line_v2v2i(), copy_v2_v2_int(), data, depth_segment_cb(), and NULL.
Referenced by annotation_stroke_newfrombuffer(), gpencil_get_depth_array(), gpencil_primitive_update_strokes(), and gpencil_stroke_newfrombuffer().
void ED_view3d_depths_free | ( | ViewDepths * | depths | ) |
Definition at line 2366 of file view3d_draw.c.
References ViewDepths::depths, and MEM_freeN.
Referenced by annotation_session_free(), curve_draw_exit(), ED_view3d_depth_override(), gpencil_fill_exit(), gpencil_primitive_exit(), gpencil_session_free(), object_transform_axis_target_free_data(), and PE_data_free().
Referenced by view3d_zoom_border_exec(), viewzoom_apply_3d(), and viewzoom_exec().
void ED_view3d_distance_set | ( | struct RegionView3D * | rv3d, |
float | dist | ||
) |
Set the dist without moving the view (compensate with RegionView3D.ofs)
Definition at line 1251 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().
bool ED_view3d_distance_set_from_location | ( | struct 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.
dist_co | A world-space location to use for the new depth. |
dist_min | Resulting distances below this will be ignored. |
Definition at line 1271 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.
void ED_view3d_draw_bgpic_test | ( | const struct Scene * | scene, |
struct Depsgraph * | depsgraph, | ||
struct ARegion * | region, | ||
struct View3D * | v3d, | ||
bool | do_foreground, | ||
bool | do_camera_frame | ||
) |
Try avoid using these more move out of legacy.
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 | ||
) |
Set the correct matrices
Referenced by gizmo_find_intersected_3d_intern(), paint_cursor_cursor_draw_3d_view_brush_cursor_active(), paint_cursor_draw_3d_view_brush_cursor_inactive(), and view3d_opengl_select_ex().
struct RenderEngineType* ED_view3d_engine_type | ( | const struct Scene * | scene, |
int | drawtype | ||
) |
Set the view transformation from a 4x4 matrix.
mat | The view 4x4 transformation matrix to assign. |
ofs | The view offset, normally from RegionView3D.ofs. |
quat | The view rotation, quaternion normally from RegionView3D.viewquat. |
dist | The view distance from ofs , normally from RegionView3D.dist. |
Definition at line 1466 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().
void ED_view3d_from_object | ( | const struct Object * | ob, |
float | ofs[3], | ||
float | quat[4], | ||
float * | dist, | ||
float * | lens | ||
) |
Set the RegionView3D members from an objects transformation and optionally lens.
ob | The object to set the view to. |
ofs | The view offset to be set, normally from RegionView3D.ofs. |
quat | The view rotation to be set, quaternion normally from RegionView3D.viewquat. |
dist | The view distance from ofs to be set, normally from RegionView3D.dist. |
lens | The view lens angle set for cameras and lights, normally from View3D.lens. |
Referenced by axis_set_view(), and ED_view3d_smooth_view_ex().
mval
comes from event->mval, only use within region handlers.
Definition at line 2282 of file view3d_select.c.
References C, ed_view3d_give_base_under_cursor_ex(), and NULL.
Referenced by datadropper_id_sample_pt(), ED_view3d_give_object_under_cursor(), and object_transfer_mode_invoke().
struct Object* ED_view3d_give_material_slot_under_cursor | ( | struct bContext * | C, |
const int | mval[2], | ||
int * | r_material_slot | ||
) |
Definition at line 2296 of file view3d_select.c.
References C, ed_view3d_give_base_under_cursor_ex(), NULL, and Base::object.
Referenced by drop_named_material_invoke(), and ED_object_ot_drop_named_material_tooltip().
Definition at line 2287 of file view3d_select.c.
References C, ED_view3d_give_base_under_cursor(), NULL, and Base::object.
Referenced by ED_view3d_is_object_under_cursor(), empty_drop_named_image_invoke(), and view3d_ima_empty_drop_poll().
Definition at line 537 of file view3d_gizmo_preselect_type.c.
References ARRAY_SIZE, MeshElemGizmo3D::base_index, MeshEdgeRingGizmo3D::base_index, BLI_assert_unreachable, MeshElemGizmo3D::edge_index, MeshEdgeRingGizmo3D::edge_index, MeshElemGizmo3D::face_index, wmGizmoType::idname, NULL, wmGizmo::ptr, RNA_property_int_set(), RNA_struct_find_property(), STREQ, wmGizmo::type, and MeshElemGizmo3D::vert_index.
Referenced by gizmo_preselect_poll_for_draw().
void ED_view3d_gizmo_mesh_preselect_get_active | ( | struct bContext * | C, |
struct wmGizmo * | gz, | ||
struct Base ** | r_base, | ||
struct BMElem ** | r_ele | ||
) |
Definition at line 486 of file view3d_gizmo_preselect_type.c.
References BKE_editmesh_from_object(), BKE_view_layer_array_from_bases_in_edit_mode, BMEditMesh::bm, bm, BM_edge_at_index_find(), BM_face_at_index_find(), BM_vert_at_index_find(), C, CTX_data_view_layer(), CTX_wm_view3d(), MEM_freeN, NULL, Base::object, wmGizmo::ptr, RNA_int_get(), RNA_property_int_get(), and RNA_struct_find_property().
Referenced by edbm_preselect_or_active().
void ED_view3d_global_to_vector | ( | const struct RegionView3D * | rv3d, |
const float | coord[3], | ||
float | vec[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.
rv3d | The region (used for the window width and height). |
coord | The world-space location. |
vec | The resulting normalized vector. |
Referenced by add_vertex_invoke(), dial_ghostarc_get_angles(), ED_gpencil_project_point_to_plane(), ED_gpencil_project_stroke_to_plane(), gizmo_get_idot(), project_brush_radius(), update_location_for_2d_curve(), and v3d_cursor_plane_draw().
float ED_view3d_grid_scale | ( | const struct Scene * | scene, |
struct View3D * | v3d, | ||
const char ** | r_grid_unit | ||
) |
Referenced by ED_object_new_primitive_matrix(), object_camera_add_exec(), and WM_operator_view3d_unit_defaults().
void ED_view3d_grid_steps | ( | const struct Scene * | scene, |
struct View3D * | v3d, | ||
struct RegionView3D * | rv3d, | ||
float | r_grid_steps[8] | ||
) |
Referenced by OVERLAY_grid_init().
float ED_view3d_grid_view_scale | ( | struct Scene * | scene, |
struct View3D * | v3d, | ||
struct 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 901 of file view3d_draw.c.
References ARRAY_SIZE, B_UNIT_LENGTH, BKE_unit_display_name_get(), BKE_unit_system_get(), ED_view3d_grid_scale(), ED_view3d_grid_steps(), RegionView3D::is_persp, len, ARegion::regiondata, RV3D_VIEW_IS_AXIS, scene, ARegion::sizex, STEPS_LEN, UnitSettings::system, Scene::unit, RegionView3D::view, and RegionView3D::winmat.
Referenced by draw_grid_unit_name(), gpencil_snap_to_grid(), idp_snap_calc_incremental(), initSnapSpatial(), snap_curs_to_grid_exec(), snap_sel_to_grid_exec(), and v3d_cursor_snap_calc_incremental().
bool ED_view3d_has_workbench_in_texture_color | ( | const struct Scene * | scene, |
const struct Object * | ob, | ||
const struct View3D * | v3d | ||
) |
Referenced by blender::ed::space_node::has_workbench_in_texture_color().
void ED_view3d_init_mats_rv3d | ( | const struct Object * | ob, |
struct 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 166 of file space_view3d.c.
References ED_view3d_clipping_local(), mul_m4_m4m4(), Object::obmat, 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_knife_cut_exec(), 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(), pose_circle_select(), sculpt_stroke_test_start(), vpaint_stroke_update_step_intern(), weight_paint_sample_enum_itemf(), weight_sample_invoke(), and wpaint_stroke_update_step().
void ED_view3d_init_mats_rv3d_gl | ( | const struct Object * | ob, |
struct RegionView3D * | rv3d | ||
) |
Definition at line 176 of file space_view3d.c.
References ED_view3d_init_mats_rv3d(), GPU_matrix_mul, and Object::obmat.
Definition at line 2307 of file view3d_select.c.
References C, ED_view3d_give_object_under_cursor(), and NULL.
Referenced by view3d_ima_bg_drop_poll().
void ED_view3d_lastview_store | ( | struct RegionView3D * | rv3d | ) |
Use to store the last view, before entering camera view.
Definition at line 440 of file view3d_utils.c.
References copy_qt_qt(), RegionView3D::lpersp, RegionView3D::lview, RegionView3D::lview_axis_roll, RegionView3D::lviewquat, RegionView3D::persp, RV3D_CAMOB, RegionView3D::view, RegionView3D::view_axis_roll, and RegionView3D::viewquat.
Referenced by region_quadview_init_rv3d(), sync_viewport_camera_smoothview(), view3d_camera_to_view_exec(), view3d_setobjectascamera_exec(), and view_camera_exec().
Definition at line 1239 of file view3d_view.c.
References blender::compositor::area(), BKE_layer_collection_local_sync(), C, CTX_data_main(), CTX_data_scene(), CTX_data_view_layer(), DEG_id_tag_update(), View3D::flag, ID_RECALC_BASE_FLAGS, LISTBASE_FOREACH, View3D::local_collections_uuid, Main::screens, SPACE_VIEW3D, V3D_LOCAL_COLLECTIONS, and view3d_local_collections_reset().
Referenced by wm_open_mainfile__open().
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 1215 of file view3d_view.c.
References View3D::flag, free_localcollection_bit(), View3D::local_collections_uuid, reset, V3D_LOCAL_COLLECTIONS, and view3d_local_collections_reset().
bool ED_view3d_lock | ( | struct RegionView3D * | rv3d | ) |
Definition at line 1455 of file view3d_utils.c.
References ED_view3d_quat_from_axis_view(), RegionView3D::view, RegionView3D::view_axis_roll, and RegionView3D::viewquat.
Referenced by ED_view3d_quadview_update(), region_quadview_init_rv3d(), and view3d_viewmatrix_set().
Definition at line 450 of file view3d_utils.c.
References View3D::flag2, NULL, View3D::ob_center, View3D::ob_center_bone, View3D::ob_center_cursor, and V3D_LOCK_CAMERA.
Referenced by view_lock_clear_exec(), and view_lock_to_active_exec().
char ED_view3d_lock_view_from_index | ( | int | index | ) |
Definition at line 1421 of file view3d_utils.c.
References RV3D_VIEW_FRONT, RV3D_VIEW_RIGHT, RV3D_VIEW_TOP, and RV3D_VIEW_USER.
Referenced by ED_view3d_quadview_update(), and region_quadview_exec().
struct RV3DMatrixStore* ED_view3d_mats_rv3d_backup | ( | struct RegionView3D * | rv3d | ) |
Definition at line 2447 of file view3d_draw.c.
References copy_m4_m4(), copy_v4_v4(), MEM_mallocN, RV3DMatrixStore::persinv, RegionView3D::persinv, RV3DMatrixStore::persmat, RegionView3D::persmat, RV3DMatrixStore::pixsize, RegionView3D::pixsize, RV3DMatrixStore::viewcamtexcofac, RegionView3D::viewcamtexcofac, RV3DMatrixStore::viewinv, RegionView3D::viewinv, RV3DMatrixStore::viewmat, RegionView3D::viewmat, RV3DMatrixStore::winmat, and RegionView3D::winmat.
Referenced by ED_view3d_draw_offscreen().
void ED_view3d_mats_rv3d_restore | ( | struct RegionView3D * | rv3d, |
struct RV3DMatrixStore * | rv3dmat | ||
) |
Definition at line 2460 of file view3d_draw.c.
References copy_m4_m4(), copy_v4_v4(), RV3DMatrixStore::persinv, RegionView3D::persinv, RV3DMatrixStore::persmat, RegionView3D::persmat, RV3DMatrixStore::pixsize, RegionView3D::pixsize, RV3DMatrixStore::viewcamtexcofac, RegionView3D::viewcamtexcofac, RV3DMatrixStore::viewinv, RegionView3D::viewinv, RV3DMatrixStore::viewmat, RegionView3D::viewmat, RV3DMatrixStore::winmat, and RegionView3D::winmat.
Referenced by ED_view3d_draw_offscreen().
void ED_view3d_ob_project_mat_get | ( | const struct RegionView3D * | v3d, |
const struct Object * | ob, | ||
float | r_pmat[4][4] | ||
) |
Referenced by blender::ed::sculpt_paint::CombOperationExecutor::comb_projected(), blender::ed::sculpt_paint::CombOperationExecutor::comb_spherical_with_symmetry(), content_planes_from_clip_flag(), createVertSlideVerts(), blender::ed::sculpt_paint::DeleteOperationExecutor::delete_projected(), blender::ed::sculpt_paint::DeleteOperationExecutor::delete_spherical_with_symmetry(), edbm_rip_edge_invoke(), edbm_rip_invoke__edge(), edbm_rip_invoke__vert(), edge_slide_projmat_get(), blender::ed::sculpt_paint::PuffOperationExecutor::find_curve_weights_projected(), blender::ed::sculpt_paint::find_curves_brush_position(), blender::ed::sculpt_paint::PuffOperationExecutor::find_curves_weights_spherical_with_symmetry(), blender::ed::sculpt_paint::SmoothOperationExecutor::find_projected_smooth_factors(), blender::ed::sculpt_paint::SmoothOperationExecutor::find_spherical_smooth_factors_with_symmetry(), blender::ed::sculpt_paint::CurvesEffectOperationExecutor::gather_influences_projected(), knifeproject_poly_from_object(), paint_convert_bb_to_rect(), blender::ed::sculpt_paint::SelectionPaintOperationExecutor::paint_curve_selection_projected(), blender::ed::sculpt_paint::SelectionPaintOperationExecutor::paint_curve_selection_spherical_with_symmetry(), blender::ed::sculpt_paint::SelectionPaintOperationExecutor::paint_point_selection_projected(), blender::ed::sculpt_paint::SelectionPaintOperationExecutor::paint_point_selection_spherical_with_symmetry(), 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(), sculpt_gesture_init_from_lasso(), sculpt_update_cache_invariants(), blender::ed::sculpt_paint::SlideOperationExecutor::slide(), blender::ed::sculpt_paint::SnakeHookOperatorExecutor::spherical_snake_hook_with_symmetry(), transform_mode_vert_slide_reproject_input(), and vwpaint_update_cache_invariants().
void ED_view3d_ob_project_mat_get_from_obmat | ( | const struct RegionView3D * | rv3d, |
const float | obmat[4][4], | ||
float | r_pmat[4][4] | ||
) |
Referenced by proj_paint_state_viewport_init().
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.
mat | A matrix use for the view-point (typically the camera objects matrix). |
ofs | Orbit center (negated), matching RegionView3D.ofs, which is typically passed in. |
fallback_dist | The distance to use if the object is too near or in front of ofs. |
Definition at line 1230 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().
bool ED_view3d_offset_lock_check | ( | const struct View3D * | v3d, |
const struct RegionView3D * | rv3d | ||
) |
Referenced by initFlyInfo(), initWalkInfo(), view3d_lock_poll(), viewdolly_offset_lock_check(), and viewmove_apply().
bool ED_view3d_persp_ensure | ( | const struct Depsgraph * | depsgraph, |
struct View3D * | v3d, | ||
struct ARegion * | region | ||
) |
Action to take when rotating the view, handle auto-perspective and logic for switching out of views.
shared with NDOF.
Referenced by viewops_data_create(), and vieworbit_exec().
void ED_view3d_persp_switch_from_camera | ( | const struct Depsgraph * | depsgraph, |
struct View3D * | v3d, | ||
struct RegionView3D * | rv3d, | ||
char | persp | ||
) |
For viewport operators that exit camera perspective.
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. Referenced by view3d_zoom_border_exec(), and viewdolly_invoke().
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] | ||
) |
Referenced by DRW_draw_cursor(), gizmo_button2d_bounds(), gizmo_ruler_draw(), knifetool_draw_angle(), and wm_gizmo_calculate_scale().
void ED_view3d_polygon_offset | ( | const struct RegionView3D * | rv3d, |
float | dist | ||
) |
Use instead of: GPU_polygon_offset(rv3d->dist, ...)
see bug T37727.
eV3DProjStatus ED_view3d_project_base | ( | const struct ARegion * | region, |
struct Base * | base | ||
) |
Definition at line 78 of file view3d_project.c.
References ED_view3d_project_short_global(), IS_CLIPPED, Base::object, Object::obmat, ret, Base::sx, Base::sy, V3D_PROJ_RET_OK, and V3D_PROJ_TEST_CLIP_DEFAULT.
Referenced by do_lasso_select_objects(), and object_mouse_select_menu().
eV3DProjStatus ED_view3d_project_float_ex | ( | const struct ARegion * | region, |
float | perspmat[4][4], | ||
bool | is_local, | ||
const float | co[3], | ||
float | r_co[2], | ||
eV3DProjTest | flag | ||
) |
eV3DProjStatus ED_view3d_project_float_global | ( | const struct ARegion * | region, |
const float | co[3], | ||
float | r_co[2], | ||
eV3DProjTest | flag | ||
) |
Referenced by annotation_stroke_convertcoords(), applyFaceProject(), ApplySnapTranslation(), calculateCenterCursor(), ED_view3d_cursor3d_update(), gizmo_button2d_bounds(), gizmo_ruler_draw(), gizmo_ruler_invoke(), blender::io::gpencil::GpencilIO::gpencil_3D_point_to_screen_space(), gpencil_brush_calc_midpoint(), gpencil_point_3d_to_xy(), gpencil_point_to_xy_fl(), gpencil_point_xy_to_3d(), gpencil_stroke_convertcoords(), gpencil_stroke_convertcoords_tpoint(), knife_project_v2(), knifetool_draw_visible_angles(), mouse_select_object_center(), object_circle_select(), project_brush_radius(), projectFloatViewEx(), updateSelectedSnapPoint(), and view3d_ruler_pick().
eV3DProjStatus ED_view3d_project_float_object | ( | const struct ARegion * | region, |
const float | co[3], | ||
float | r_co[2], | ||
eV3DProjTest | flag | ||
) |
Object space, use ED_view3d_init_mats_rv3d before calling.
Referenced by ED_curve_editfont_select_pick(), ed_mesh_pick_face_vert__mpoly_find(), ed_mesh_pick_vert__mapFunc(), edbm_dupli_extrude_cursor_invoke(), edbm_knife_cut_exec(), EDBM_project_snap_verts(), gradientVertInit__mapFunc(), lattice_foreachScreenVert(), mball_foreachScreenElem(), mesh_foreachScreenFace__mapFunc(), mesh_foreachScreenVert__mapFunc(), meshobject_foreachScreenVert__mapFunc(), mouse_mesh_loop(), nurbs_foreachScreenVert(), paint_and_tex_color_alpha_intern(), view3d_project_segment_to_screen_with_clip_tag(), view3d_project_segment_to_screen_with_content_clip_planes(), vpaint_proj_dm_map_cosnos_update__map_cb(), and worldspace_to_screenspace().
void ED_view3d_project_float_v2_m4 | ( | const struct ARegion * | region, |
const float | co[3], | ||
float | r_co[2], | ||
const float | mat[4][4] | ||
) |
Referenced by calcEdgeSlide_even(), calcVertSlideMouseActiveVert(), edbm_rip_edge_invoke(), edbm_rip_edge_side_measure(), edbm_rip_edgedist_squared(), blender::ed::sculpt_paint::find_curves_brush_position(), knifeproject_poly_from_object(), paint_convert_bb_to_rect(), blender::ed::sculpt_paint::DensityAddOperationExecutor::sample_projected_with_symmetry(), SCULPT_brush_strength_factor(), sculpt_gesture_is_effected_lasso(), and vert_slide_update_input().
void ED_view3d_project_float_v3_m4 | ( | const struct ARegion * | region, |
const float | co[3], | ||
float | r_co[3], | ||
const float | mat[4][4] | ||
) |
Referenced by edge_slide_pair_project().
eV3DProjStatus ED_view3d_project_int_ex | ( | const struct ARegion * | region, |
float | perspmat[4][4], | ||
bool | is_local, | ||
const float | co[3], | ||
int | r_co[2], | ||
eV3DProjTest | flag | ||
) |
eV3DProjStatus ED_view3d_project_int_global | ( | const struct ARegion * | region, |
const float | co[3], | ||
int | r_co[2], | ||
eV3DProjTest | flag | ||
) |
eV3DProjStatus ED_view3d_project_int_object | ( | const struct ARegion * | region, |
const float | co[3], | ||
int | r_co[2], | ||
eV3DProjTest | flag | ||
) |
eV3DProjStatus ED_view3d_project_short_ex | ( | const struct ARegion * | region, |
float | perspmat[4][4], | ||
bool | is_local, | ||
const float | co[3], | ||
short | r_co[2], | ||
eV3DProjTest | flag | ||
) |
Referenced by DRW_text_cache_draw().
eV3DProjStatus ED_view3d_project_short_global | ( | const struct ARegion * | region, |
const float | co[3], | ||
short | r_co[2], | ||
eV3DProjTest | flag | ||
) |
eV3DProjStatus ED_view3d_project_short_object | ( | const struct ARegion * | region, |
const float | co[3], | ||
short | r_co[2], | ||
eV3DProjTest | flag | ||
) |
void ED_view3d_project_v2 | ( | const struct ARegion * | region, |
const float | world[3], | ||
float | r_region_co[2] | ||
) |
Definition at line 708 of file view3d_project.c.
References GPU_matrix_project_2fv(), ARegion::regiondata, RegionView3D::viewmat, RegionView3D::winmat, ARegion::winx, ARegion::winy, and world.
Referenced by blender::ed::sculpt_paint::min_distance_edit::calculate_points_per_side(), gizmo_preselect_elem_test_select(), blender::ed::sculpt_paint::min_distance_edit::min_distance_edit_draw(), paint_line_strokes_spacing(), paint_space_stroke(), and voxel_size_edit_invoke().
void ED_view3d_project_v3 | ( | const struct 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 700 of file view3d_project.c.
References GPU_matrix_project_3fv(), ARegion::regiondata, RegionView3D::viewmat, RegionView3D::winmat, ARegion::winx, ARegion::winy, and world.
Referenced by cursor_draw_point_screen_space(), key_test_depth(), and object_transform_axis_target_calc_depth_init().
'clip' is used to know if our clip setting has changed.
Definition at line 938 of file view3d_utils.c.
References ARegion::alignment, blender::compositor::area(), ED_area_tag_redraw(), ED_view3d_lock(), ED_view3d_lock_view_from_index(), ARegion::next, NULL, RegionView3D::persp, ARegion::prev, ARegion::regiondata, RegionView3D::rflag, RGN_ALIGN_QSPLIT, RV3D_BOXCLIP, RV3D_BOXVIEW, RV3D_LOCK_FLAGS, RV3D_LOCK_ROTATION, RV3D_ORTHO, RV3D_VIEW_AXIS_ROLL_0, RV3D_VIEW_IS_AXIS, RegionView3D::view, view3d_boxview_sync(), RegionView3D::view_axis_roll, and RegionView3D::viewlock.
Referenced by region_quadview_init_rv3d().
Definition at line 1350 of file view3d_utils.c.
References BLI_assert, copy_qt_qt(), RV3D_VIEW_AXIS_ROLL_270, RV3D_VIEW_FRONT, RV3D_VIEW_IS_AXIS, view, and view3d_quat_axis.
Referenced by ED_view3d_lock(), ED_view3d_quat_to_axis_view_and_reset_quat(), view3d_boxview_sync_axis(), view_axis_exec(), and vieworbit_exec().
bool ED_view3d_quat_to_axis_view | ( | const float | viewquat[4], |
float | epsilon, | ||
char * | r_view, | ||
char * | r_view_axis_rotation | ||
) |
Definition at line 1360 of file view3d_utils.c.
References angle_signed_qtqt(), blender::robust_pred::epsilon, fabsf, M_PI_4, RV3D_VIEW_AXIS_ROLL_0, RV3D_VIEW_AXIS_ROLL_270, RV3D_VIEW_BOTTOM, RV3D_VIEW_FRONT, RV3D_VIEW_USER, view, and view3d_quat_axis.
Referenced by ED_view3d_quat_to_axis_view_and_reset_quat().
bool ED_view3d_quat_to_axis_view_and_reset_quat | ( | float | viewquat[4], |
float | epsilon, | ||
char * | r_view, | ||
char * | r_view_axis_rotation | ||
) |
A version of ED_view3d_quat_to_axis_view that updates viewquat
if it's within epsilon
to an axis-view.
Definition at line 1407 of file view3d_utils.c.
References BLI_assert, ED_view3d_quat_from_axis_view(), ED_view3d_quat_to_axis_view(), blender::robust_pred::epsilon, and RV3D_VIEW_USER.
Referenced by view_roll_angle(), and viewrotate_apply_snap().
float ED_view3d_radius_to_dist | ( | const struct View3D * | v3d, |
const struct ARegion * | region, | ||
const struct Depsgraph * | depsgraph, | ||
char | persp, | ||
bool | use_aspect, | ||
float | radius | ||
) |
Return a new RegionView3D.dist value to fit the radius.
+ pt --> + /^ radius / | / | view + + \ | \ | | +
region | Can be NULL if use_aspect is false. |
persp | Allow the caller to tell what kind of perspective to use (ortho/view/camera) |
use_aspect | Increase the distance to account for non 1:1 view aspect. |
radius | The radius will be fitted exactly, typically pre-scaled by a margin (VIEW3D_MARGIN). |
Referenced by view3d_from_minmax(), and view3d_localview_init().
Definition at line 1145 of file view3d_utils.c.
References DEFAULT_SENSOR_WIDTH.
Referenced by ED_view3d_radius_to_dist().
Definition at line 1140 of file view3d_utils.c.
Referenced by ED_view3d_radius_to_dist().
void ED_view3d_screen_datamask | ( | const struct bContext * | C, |
const struct Scene * | scene, | ||
const struct bScreen * | screen, | ||
struct CustomData_MeshMasks * | r_cddata_masks | ||
) |
Goes over all modes and view3d settings.
Referenced by wm_event_do_depsgraph().
Definition at line 101 of file view3d_select.c.
Referenced by curve_pen_invoke(), curve_pen_modal(), ED_curve_editfont_select_pick(), ED_curve_pick_vert(), edbm_elem_find_nearest(), findnearestLattvert(), get_closest_vertex_to_point_in_nurbs(), gizmo_preselect_edgering_test_select(), gizmo_preselect_elem_test_select(), insert_point_to_segment(), loopcut_mouse_move(), mouse_select_object_center(), pe_deflect_emitter(), pe_nearest_point_and_key(), unified_findnearest(), and view3d_select_exec().
eV3DSelectObjectFilter ED_view3d_select_filter_from_mode | ( | const struct Scene * | scene, |
const struct Object * | obact | ||
) |
Referenced by do_object_box_select(), do_pose_box_select(), and ed_object_select_pick().
void ED_view3d_select_id_validate | ( | struct ViewContext * | vc | ) |
Definition at line 2190 of file view3d_draw.c.
References ViewContext::depsgraph, ViewContext::obact, ViewContext::region, ViewContext::v3d, validate_object_select_id(), and ViewContext::view_layer.
Referenced by ED_mesh_pick_face(), ED_mesh_pick_vert(), and imapaint_pick_face().
Definition at line 223 of file space_view3d.c.
References blender::compositor::area(), ED_view3d_stop_render_preview(), ListBase::first, ARegion::next, OB_RENDER, ARegion::regiondata, ARegion::regiontype, RGN_TYPE_WINDOW, View3D::shading, View3DShading::type, and Main::wm.
Referenced by toggle_matcap_flip(), and toggle_shading_exec().
bool ED_view3d_snap_selected_to_location | ( | struct bContext * | C, |
const float | snap_target_global[3], | ||
int | pivot_point | ||
) |
Definition at line 573 of file view3d_snap.c.
References C, and snap_selected_to_location().
Referenced by object_transform_to_mouse_exec().
void ED_view3d_stop_render_preview | ( | struct wmWindowManager * | wm, |
struct ARegion * | region | ||
) |
Definition at line 200 of file space_view3d.c.
References BPy_BEGIN_ALLOW_THREADS, BPy_END_ALLOW_THREADS, NULL, RE_engine_free(), ARegion::regiondata, RegionView3D::render_engine, WM_draw_region_free(), WM_JOB_TYPE_RENDER_PREVIEW, and WM_jobs_kill_type().
Referenced by ED_render_engine_area_exit(), ED_view3d_shade_update(), and view3d_main_region_exit().
Calculate the view transformation matrix from RegionView3D input. The resulting matrix is equivalent to RegionView3D.viewinv
mat | The view 4x4 transformation matrix to calculate. |
ofs | The view offset, normally from RegionView3D.ofs. |
quat | The view rotation, quaternion normally from RegionView3D.viewquat. |
dist | The view distance from ofs, normally from RegionView3D.dist. |
Definition at line 1492 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().
void ED_view3d_to_object | ( | const struct Depsgraph * | depsgraph, |
struct Object * | ob, | ||
const float | ofs[3], | ||
const float | quat[4], | ||
float | dist | ||
) |
Set the object transformation from RegionView3D members.
depsgraph | The depsgraph to get the evaluated object parent for the transformation calculation. |
ob | The object which has the transformation assigned. |
ofs | The view offset, normally from RegionView3D.ofs. |
quat | The view rotation, quaternion normally from RegionView3D.viewquat. |
dist | The view distance from ofs , normally from RegionView3D.dist. |
Referenced by view3d_camera_to_view_exec().
bool ED_view3d_unproject_v3 | ( | const struct ARegion * | region, |
float | regionx, | ||
float | regiony, | ||
float | regionz, | ||
float | world[3] | ||
) |
Definition at line 716 of file view3d_project.c.
References GPU_matrix_unproject_3fv(), ARegion::regiondata, RegionView3D::viewinv, RegionView3D::winmat, ARegion::winx, ARegion::winy, and world.
Referenced by ED_view3d_autodist(), ED_view3d_autodist_simple(), ED_view3d_clipping_calc(), ED_view3d_depth_unproject_v3(), knife_input_ray_segment(), point_is_visible(), and view3d_zoom_border_exec().
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 | ||
) |
Referenced by ED_view3d_smooth_view_force_finish(), and gpencil_render_offscreen().
void ED_view3d_viewcontext_init | ( | struct bContext * | C, |
struct ViewContext * | vc, | ||
struct Depsgraph * | depsgraph | ||
) |
Definition at line 106 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(), curve_pen_invoke(), curve_pen_modal(), 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_findnearest_metaelem(), ED_mesh_pick_face(), ED_mesh_pick_vert(), ed_object_select_pick(), ED_pose_deselect_all_multi(), ED_sculpt_update_modal_transform(), ed_view3d_give_base_under_cursor_ex(), 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(), blender::ed::sculpt_paint::image::ops::paint::texture_paint_init(), view3d_box_select_exec(), view3d_circle_select_exec(), view3d_circle_select_recalc(), view3d_lasso_select_exec(), view3d_select_exec(), vpaint_init_vpaint(), weight_paint_sample_enum_itemf(), weight_sample_group_exec(), weight_sample_invoke(), and wpaint_stroke_test_start().
void ED_view3d_viewcontext_init_object | ( | struct ViewContext * | vc, |
struct 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 it's object data.
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 124 of file view3d_select.c.
References BKE_editmesh_from_object(), BKE_object_is_in_editmode(), BLI_assert, ViewContext::em, ViewContext::obact, and ViewContext::obedit.
Referenced by 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().
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 | ||
) |
Referenced by ED_view3d_draw_offscreen_imbuf(), gpencil_render_offscreen(), and view3d_winmatrix_set().
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] | ||
) |
Calculate a 3d location from 2d window coordinates.
region | The region (used for the window width and height). |
depth_pt | The reference location used to calculate the Z depth. |
mval | The area relative location (such as event->mval converted to floats). |
r_out | The resulting world-space location. |
Referenced by armature_click_extrude_invoke(), blender::ed::sculpt_paint::CombOperationExecutor::comb_spherical_with_symmetry(), curve_draw_invoke(), blender::ed::sculpt_paint::DeleteOperationExecutor::delete_spherical_with_symmetry(), depthdropper_depth_sample_pt(), 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_spherical(), gizmo_window_project_3d(), gpencil_strokepoint_convertcoords(), initBend(), knife_constrain_axis(), knifetool_raycast_planes(), 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_spherical_with_symmetry(), screenspace_to_worldspace(), sculpt_gesture_line_calculate_plane_points(), sculpt_gesture_trim_geometry_generate(), sculpt_update_brush_delta(), blender::ed::sculpt_paint::SnakeHookOperatorExecutor::spherical_snake_hook_with_symmetry(), stroke_elem_project_fallback(), v3d_cursor_snap_update(), and viewops_data_create().
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] | ||
) |
Referenced by add_vertex_invoke(), ED_view3d_autodist(), ED_view3d_cursor3d_position(), edbm_dupli_extrude_cursor_invoke(), edbm_point_normals_modal(), edbm_polybuild_face_at_cursor_invoke(), edbm_polybuild_split_at_cursor_invoke(), extrude_points_from_selected_vertices(), gizmo_mesh_spin_redo_setup(), view3d_preselect_update_preview_triangle_from_edge(), view3d_preselect_update_preview_triangle_from_vert(), view3d_ruler_item_project(), and viewcenter_pick_invoke().
bool ED_view3d_win_to_3d_on_plane_int | ( | const struct ARegion * | region, |
const float | plane[4], | ||
const int | mval[2], | ||
bool | do_clip, | ||
float | r_out[3] | ||
) |
Referenced by gizmo_mesh_spin_redo_setup().
bool ED_view3d_win_to_3d_on_plane_with_fallback | ( | const struct ARegion * | region, |
const float | plane[4], | ||
const float | mval[2], | ||
bool | do_clip, | ||
const float | plane_fallback[4], | ||
float | r_out[3] | ||
) |
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).
Referenced by view3d_win_to_3d_on_plane_maybe_fallback().
void ED_view3d_win_to_delta | ( | const struct ARegion * | region, |
const float | xy_delta[2], | ||
float | zfac, | ||
float | r_out[3] | ||
) |
Calculate a 3d difference vector from 2d window offset.
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).
region | The region (used for the window width and height). |
xy_delta | 2D difference (in pixels) such as event->mval[0] - other_x . |
zfac | The depth result typically calculated by ED_view3d_calc_zfac (see it's doc-string for details). |
r_out | The resulting world-space delta. |
Referenced by annotation_stroke_convertcoords(), brush_edit_apply(), calc_local_y(), calcVertSlideMouseActiveEdges(), convertViewVec(), drawVertSlide(), gpencil_brush_calc_midpoint(), gpencil_brush_grab_calc_dvec(), gpencil_brush_randomize_apply(), gpencil_point_xy_to_3d(), gpencil_stroke_convertcoords(), gpencil_stroke_convertcoords_tpoint(), initMouseInput(), mesh_bisect_interactive_calc(), move3d_get_translate(), paint_calc_object_space_radius(), view3d_zoom_border_exec(), view_zoom_to_window_xy_3d(), and viewmove_apply().
Calculate a 3d origin from 2d window coordinates.
region | The region (used for the window width and height). |
mval | The area relative 2d location (such as event->mval converted to float). |
r_out | The resulting normalized world-space direction vector. |
void ED_view3d_win_to_ray | ( | const struct 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
.
region | The region (used for the window width and height). |
mval | The area relative 2d location (such as event->mval , converted into float[2]). |
r_ray_start | The world-space point where the ray intersects the window plane. |
r_ray_normal | The normalized world-space direction of towards mval. |
Referenced by gizmo_arrow_modal(), and object_transform_axis_target_calc_depth_init().
bool ED_view3d_win_to_ray_clipped | ( | struct Depsgraph * | depsgraph, |
const struct ARegion * | region, | ||
const struct View3D * | v3d, | ||
const float | mval[2], | ||
float | r_ray_start[3], | ||
float | r_ray_normal[3], | ||
bool | do_clip_planes | ||
) |
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.
region | The region (used for the window width and height). |
v3d | The 3d viewport (used for near clipping value). |
mval | The area relative 2d location (such as event->mval, converted into float[2]). |
r_ray_start | The world-space point where the ray intersects the window plane. |
r_ray_normal | The normalized world-space direction of towards mval. |
do_clip_planes | Optionally clip the start of the ray by the view clipping planes. |
Referenced by ED_gpencil_stroke_reproject(), and EDBM_unified_findnearest_from_raycast().
bool ED_view3d_win_to_ray_clipped_ex | ( | struct Depsgraph * | depsgraph, |
const struct ARegion * | region, | ||
const struct View3D * | v3d, | ||
const float | mval[2], | ||
float | r_ray_co[3], | ||
float | r_ray_normal[3], | ||
float | r_ray_start[3], | ||
bool | do_clip_planes | ||
) |
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.
region | The region (used for the window width and height). |
v3d | The 3d viewport (used for near clipping value). |
mval | The area relative 2d location (such as event->mval , converted into float[2]). |
r_ray_co | The world-space point where the ray intersects the window plane. |
r_ray_normal | The normalized world-space direction of towards mval. |
r_ray_start | The world-space starting point of the ray. |
do_clip_planes | Optionally clip the start of the ray by the view clipping planes. |
Referenced by ED_transform_snap_object_project_all_view3d_ex(), and transform_snap_context_project_view3d_mixed_impl().
bool ED_view3d_win_to_segment_clipped | ( | const struct Depsgraph * | depsgraph, |
const struct ARegion * | region, | ||
const struct View3D * | v3d, | ||
const float | mval[2], | ||
float | r_ray_start[3], | ||
float | r_ray_end[3], | ||
bool | do_clip_planes | ||
) |
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.
region | The region (used for the window width and height). |
v3d | The 3d viewport (used for near and far clipping range). |
mval | The area relative 2d location (such as event->mval, converted into float[2]). |
r_ray_start | The world-space starting point of the segment. |
r_ray_end | The world-space end point of the segment. |
do_clip_planes | Optionally clip the ray by the view clipping planes. |
Referenced by BMBVH_EdgeVisible(), brush_add_count_iter(), knife_find_line_hits(), 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().
Calculate a 3d direction vector from 2d window coordinates. This direction vector starts and the view in the direction of the 2d window coordinates. In orthographic view all window coordinates yield the same vector.
region | The region (used for the window width and height). |
mval | The area relative 2d location (such as event->mval converted to float). |
r_out | The resulting normalized world-space direction vector. |
Referenced by gizmo_find_intersected_3d_intern(), mesh_bisect_interactive_calc(), and viewops_data_create().
bool edge_inside_circle | ( | const float | cent[2], |
float | radius, | ||
const float | screen_co_a[2], | ||
const float | screen_co_b[2] | ||
) |
XXX: should move to BLI_math
Definition at line 3094 of file view3d_select.c.
References dist_squared_to_line_segment_v2().
Referenced by do_circle_select_armature__doSelectBone(), do_circle_select_armature__doSelectBone_clip_content(), do_circle_select_pose__doSelectBone(), gpencil_stroke_inside_circle(), and mesh_circle_doSelectEdge().
ENUM_OPERATORS | ( | eV3DProjTest | , |
V3D_PROJ_TEST_CLIP_CONTENT | |||
) |
void lattice_foreachScreenVert | ( | struct ViewContext * | vc, |
void(*)(void *userData, struct BPoint *bp, const float screen_co[2]) | func, | ||
void * | userData, | ||
eV3DProjTest | clip_flag | ||
) |
Referenced by do_lasso_select_lattice(), do_lattice_box_select(), findnearestLattvert(), and lattice_circle_select().
void mball_foreachScreenElem | ( | struct ViewContext * | vc, |
void(*)(void *userData, struct MetaElem *ml, const float screen_co[2]) | func, | ||
void * | userData, | ||
eV3DProjTest | clip_flag | ||
) |
ED_view3d_init_mats_rv3d must be called first.
Referenced by do_lasso_select_meta(), and mball_circle_select().
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, | ||
eV3DProjTest | clip_flag | ||
) |
Referenced by EDBM_edge_find_nearest_ex().
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, | ||
eV3DProjTest | clip_flag | ||
) |
A version of mesh_foreachScreenEdge that clips the segment when there is a clipping bounding box.
Referenced by do_lasso_select_mesh(), do_mesh_box_select(), and mesh_circle_select().
void mesh_foreachScreenFace | ( | struct ViewContext * | vc, |
void(*)(void *userData, struct BMFace *efa, const float screen_co[2], int index) | func, | ||
void * | userData, | ||
eV3DProjTest | clip_flag | ||
) |
Referenced by do_lasso_select_mesh(), do_mesh_box_select(), EDBM_face_find_nearest_ex(), and mesh_circle_select().
void mesh_foreachScreenVert | ( | struct ViewContext * | vc, |
void(*)(void *userData, struct BMVert *eve, const float screen_co[2], int index) | func, | ||
void * | userData, | ||
eV3DProjTest | clip_flag | ||
) |
Referenced by do_lasso_select_mesh(), do_mesh_box_select(), EDBM_vert_find_nearest_ex(), and mesh_circle_select().
void meshobject_foreachScreenVert | ( | struct ViewContext * | vc, |
void(*)(void *userData, struct MVert *eve, const float screen_co[2], int index) | func, | ||
void * | userData, | ||
eV3DProjTest | clip_flag | ||
) |
Referenced by do_lasso_select_paintvert(), do_paintvert_box_select(), and paint_vertsel_circle_select().
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, | ||
eV3DProjTest | clip_flag | ||
) |
Referenced by do_lasso_select_curve(), do_nurbs_box_select(), ED_curve_pick_vert_ex(), and nurbscurve_circle_select().
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, | ||
eV3DProjTest | clip_flag | ||
) |
ED_view3d_init_mats_rv3d must be called first.
Definition at line 810 of file view3d_iterators.c.
References BKE_pose_channel_find_name(), bPoseChannel::bone, bPose::chanbase, content_planes_from_clip_flag(), Object::data, DEG_get_evaluated_object(), ViewContext::depsgraph, ED_view3d_check_mats_rv3d, ListBase::first, bPoseChannel::name, bPoseChannel::next, ViewContext::obact, PBONE_VISIBLE, Object::pose, bPoseChannel::pose_head, bPoseChannel::pose_tail, ViewContext::region, ViewContext::rv3d, V3D_PROJ_TEST_CLIP_CONTENT, view3d_project_segment_to_screen_with_clip_tag(), view3d_project_segment_to_screen_with_content_clip_planes(), ARegion::winx, ARegion::winy, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by do_lasso_tag_pose(), and pose_circle_select().
int view3d_opengl_select | ( | struct ViewContext * | vc, |
struct GPUSelectResult * | buffer, | ||
unsigned int | buffer_len, | ||
const struct rcti * | input, | ||
eV3DSelectMode | select_mode, | ||
eV3DSelectObjectFilter | select_filter | ||
) |
Optionally cache data for multiple calls to view3d_opengl_select
just avoid GPU_select headers outside this file
Definition at line 465 of file view3d_view.c.
References GPU_select_cache_begin().
Referenced by get_nearest_editbonepoint(), and mixed_bones_object_selectbuffer().
Definition at line 470 of file view3d_view.c.
References GPU_select_cache_end().
Referenced by get_nearest_editbonepoint(), and mixed_bones_object_selectbuffer().
int view3d_opengl_select_ex | ( | struct ViewContext * | vc, |
struct GPUSelectResult * | buffer, | ||
unsigned int | buffer_len, | ||
const struct rcti * | input, | ||
eV3DSelectMode | select_mode, | ||
eV3DSelectObjectFilter | select_filter, | ||
bool | do_material_slot_selection | ||
) |
Referenced by mixed_bones_object_selectbuffer().
int view3d_opengl_select_with_id_filter | ( | struct ViewContext * | vc, |
struct GPUSelectResult * | buffer, | ||
unsigned int | buffer_len, | ||
const struct rcti * | input, | ||
eV3DSelectMode | select_mode, | ||
eV3DSelectObjectFilter | select_filter, | ||
uint | select_id | ||
) |
Referenced by ed_armature_pick_bone_impl(), and get_nearest_editbonepoint().
Use this call when executing an operator, event system doesn't set for each event the OpenGL drawing context.
Referenced by armature_select_linked_pick_invoke(), armature_shortest_path_pick_invoke(), brush_edit_apply(), clip_planes_from_rect(), curve_draw_invoke(), depthdropper_depth_sample_pt(), ED_curve_editnurb_select_pick(), ED_view3d_cursor3d_position(), ed_view3d_give_base_under_cursor_ex(), edbm_point_normals_modal(), edbm_select_linked_pick_invoke(), edbm_select_loop_invoke(), edbm_shortest_path_pick_invoke(), edcu_shortest_path_pick_invoke(), gizmo_find_intersected_3d(), gpencil_point_conversion_init(), loopcut_init(), loopcut_modal(), object_transform_axis_target_modal(), paint_proj_new_stroke(), paint_proj_stroke(), paint_sample_color(), paint_select_linked_pick_invoke(), pose_select_connected_invoke(), sculpt_brush_stroke_init(), select_linked_pick_invoke(), view3d_box_select_exec(), view3d_circle_select_exec(), view3d_lasso_select_exec(), view3d_select_exec(), view3d_zoom_border_exec(), viewcenter_pick_invoke(), viewops_data_create(), weight_paint_sample_enum_itemf(), weight_sample_invoke(), and wpaint_stroke_update_step().