|
Blender V5.0
|
#include <algorithm>#include <cfloat>#include <cmath>#include <cstdio>#include <cstring>#include "DNA_camera_types.h"#include "DNA_curve_types.h"#include "DNA_object_types.h"#include "DNA_scene_types.h"#include "DNA_world_types.h"#include "RNA_path.hh"#include "MEM_guardedalloc.h"#include "BLI_array_utils.h"#include "BLI_bitmap_draw_2d.h"#include "BLI_listbase.h"#include "BLI_math_color.h"#include "BLI_math_geom.h"#include "BLI_math_matrix.h"#include "BLI_math_rotation.h"#include "BLI_math_vector.h"#include "BLI_rect.h"#include "BLI_utildefines.h"#include "BLI_vector.hh"#include "BKE_camera.h"#include "BKE_context.hh"#include "BKE_library.hh"#include "BKE_object.hh"#include "BKE_scene.hh"#include "BKE_screen.hh"#include "DEG_depsgraph.hh"#include "DEG_depsgraph_query.hh"#include "GPU_matrix.hh"#include "WM_api.hh"#include "WM_types.hh"#include "ED_keyframing.hh"#include "ED_screen.hh"#include "ED_undo.hh"#include "ED_view3d.hh"#include "ANIM_keyframing.hh"#include "ANIM_keyingsets.hh"#include "UI_resources.hh"#include "view3d_intern.hh"Go to the source code of this file.
Classes | |
| struct | PointsInPlanesMinMax_UserData |
| struct | View3D_AutoDistLast |
| struct | ReadData |
Functions | |
View Data Access Utilities | |
| void | ED_view3d_background_color_get (const Scene *scene, const View3D *v3d, float r_color[3]) |
| void | ED_view3d_text_colors_get (const Scene *scene, const View3D *v3d, float r_text_color[4], float r_shadow_color[4]) |
| bool | ED_view3d_has_workbench_in_texture_color (const Scene *scene, const Object *ob, const View3D *v3d) |
| Camera * | ED_view3d_camera_data_get (View3D *v3d, RegionView3D *rv3d) |
| float | ED_view3d_dist_soft_min_get (const View3D *v3d, const bool use_persp_range) |
| blender::Bounds< float > | ED_view3d_dist_soft_range_get (const View3D *v3d, const bool use_persp_range) |
| bool | ED_view3d_clip_range_get (const Depsgraph *depsgraph, const View3D *v3d, const RegionView3D *rv3d, const bool use_ortho_factor, float *r_clip_start, float *r_clip_end) |
| bool | ED_view3d_viewplane_get (const Depsgraph *depsgraph, const View3D *v3d, const RegionView3D *rv3d, int winx, int winy, rctf *r_viewplane, float *r_clip_start, float *r_clip_end, float *r_pixsize) |
View State/Context Utilities | |
| void | view3d_operator_needs_gpu (const bContext *C) |
| void | view3d_region_operator_needs_gpu (ARegion *region) |
| void | ED_view3d_polygon_offset (const RegionView3D *rv3d, const float dist) |
| bool | ED_view3d_context_activate (bContext *C) |
View Clipping Utilities | |
| void | ED_view3d_clipping_calc_from_boundbox (float clip[4][4], const BoundBox *bb, const bool is_flip) |
| void | ED_view3d_clipping_calc (BoundBox *bb, float planes[4][4], const ARegion *region, const Object *ob, const rcti *rect) |
View Clipping Clamp Min/Max | |
| static void | points_in_planes_minmax_fn (const float co[3], int, int, int, void *user_data_p) |
| bool | ED_view3d_clipping_clamp_minmax (const RegionView3D *rv3d, float min[3], float max[3]) |
View Bound-Box Utilities | |
| static bool | view3d_boundbox_clip_m4 (const BoundBox *bb, const float persmatob[4][4]) |
| bool | ED_view3d_boundbox_clip_ex (const RegionView3D *rv3d, const BoundBox *bb, float obmat[4][4]) |
| bool | ED_view3d_boundbox_clip (RegionView3D *rv3d, const BoundBox *bb) |
View Perspective & Mode Switching | |
Misc view utility functions. | |
| bool | ED_view3d_offset_lock_check (const View3D *v3d, const RegionView3D *rv3d) |
| void | ED_view3d_lastview_store (RegionView3D *rv3d) |
| void | ED_view3d_lock_clear (View3D *v3d) |
| void | ED_view3d_persp_switch_from_camera (const Depsgraph *depsgraph, View3D *v3d, RegionView3D *rv3d, const char persp) |
| bool | ED_view3d_persp_ensure (const Depsgraph *depsgraph, View3D *v3d, ARegion *region) |
Camera View Utilities | |
Utilities for manipulating the camera-view. | |
| bool | ED_view3d_camera_view_zoom_scale (RegionView3D *rv3d, const float scale) |
| bool | ED_view3d_camera_view_pan (ARegion *region, const float event_ofs[2]) |
Camera Lock API | |
Lock the camera to the 3D Viewport, allowing view manipulation to transform the camera. | |
| bool | ED_view3d_camera_lock_check (const View3D *v3d, const RegionView3D *rv3d) |
| void | ED_view3d_camera_lock_init_ex (const Depsgraph *depsgraph, View3D *v3d, RegionView3D *rv3d, const bool calc_dist) |
| void | ED_view3d_camera_lock_init (const Depsgraph *depsgraph, View3D *v3d, RegionView3D *rv3d) |
| bool | ED_view3d_camera_lock_sync (const Depsgraph *depsgraph, View3D *v3d, RegionView3D *rv3d) |
| bool | ED_view3d_camera_autokey (const Scene *scene, ID *id_key, bContext *C, const bool do_rotate, const bool do_translate) |
| bool | ED_view3d_camera_lock_autokey (View3D *v3d, RegionView3D *rv3d, bContext *C, const bool do_rotate, const bool do_translate) |
| bool | ED_view3d_camera_lock_undo_test (const View3D *v3d, const RegionView3D *rv3d, bContext *C) |
| static bool | view3d_camera_lock_undo_ex (const char *str, const View3D *v3d, const RegionView3D *rv3d, bContext *C, const bool undo_group) |
| bool | ED_view3d_camera_lock_undo_push (const char *str, const View3D *v3d, const RegionView3D *rv3d, bContext *C) |
| bool | ED_view3d_camera_lock_undo_grouped_push (const char *str, const View3D *v3d, const RegionView3D *rv3d, bContext *C) |
Box View Support | |
Use with quad-split so each view is clipped by the bounds of each view axis. | |
| static void | view3d_boxview_clip (ScrArea *area) |
| static void | view3d_boxview_sync_axis (RegionView3D *rv3d_dst, RegionView3D *rv3d_src) |
| void | view3d_boxview_sync (ScrArea *area, ARegion *region) |
| void | view3d_boxview_copy (ScrArea *area, ARegion *region) |
| void | ED_view3d_quadview_update (ScrArea *area, ARegion *region, bool do_clip) |
View Auto-Depth Utilities | |
| static float | view_autodist_depth_margin (ARegion *region, const int mval[2], int margin) |
| bool | ED_view3d_autodist (ARegion *region, View3D *v3d, const int mval[2], float mouse_worldloc[3], const float fallback_depth_pt[3]) |
| bool | ED_view3d_autodist_simple (ARegion *region, const int mval[2], float mouse_worldloc[3], int margin, const float *force_depth) |
| static bool | depth_segment_cb (int x, int y, void *user_data) |
| bool | ED_view3d_depth_read_cached_seg (const ViewDepths *vd, const int mval_sta[2], const int mval_end[2], int margin, float *r_depth) |
View Radius/Distance Utilities | |
Use to calculate a distance to a point based on its radius. | |
| float | ED_view3d_radius_to_dist_persp (const float angle, const float radius) |
| float | ED_view3d_radius_to_dist_ortho (const float lens, const float radius) |
| float | ED_view3d_radius_to_dist (const View3D *v3d, const ARegion *region, const Depsgraph *depsgraph, const char persp, const bool use_aspect, const float radius) |
View Distance Utilities | |
| float | ED_view3d_offset_distance (const float mat[4][4], const float ofs[3], const float fallback_dist) |
| void | ED_view3d_distance_set (RegionView3D *rv3d, const float dist) |
| bool | ED_view3d_distance_set_from_location (RegionView3D *rv3d, const float dist_co[3], const float dist_min) |
View Transform Utilities | |
| void | ED_view3d_from_m4 (const float mat[4][4], float ofs[3], float quat[4], const float *dist) |
| void | ED_view3d_to_m4 (float mat[4][4], const float ofs[3], const float quat[4], const float dist) |
| void | ED_view3d_from_object (const Object *ob, float ofs[3], float quat[4], const float *dist, float *lens) |
| void | ED_view3d_to_object (const Depsgraph *depsgraph, Object *ob, const float ofs[3], const float quat[4], const float dist) |
| static bool | view3d_camera_to_view_selected_impl (Main *bmain, Depsgraph *depsgraph, const Scene *scene, Object *camera_ob, float *r_clip_start, float *r_clip_end) |
| bool | ED_view3d_camera_to_view_selected (Main *bmain, Depsgraph *depsgraph, const Scene *scene, Object *camera_ob) |
| bool | ED_view3d_camera_to_view_selected_with_set_clipping (Main *bmain, Depsgraph *depsgraph, const Scene *scene, Object *camera_ob) |
Depth Buffer Utilities | |
| static bool | depth_read_test_fn (const void *value, void *userdata) |
| bool | ED_view3d_depth_read_cached (const ViewDepths *vd, const int mval[2], int margin, float *r_depth) |
| bool | ED_view3d_depth_read_cached_normal (const ARegion *region, const ViewDepths *depths, const int mval[2], float r_normal[3]) |
| bool | ED_view3d_depth_unproject_v3 (const ARegion *region, const int mval[2], const double depth, float r_location_world[3]) |
View Auto-Depth Last State Access | |
Calling consecutive trackpad gestures reuses the previous offset to prevent each trackpad event using a different offset, see: #103263. | |
| static const char * | view3d_autodepth_last_id = "view3d_autodist_last" |
| bool | ED_view3d_autodist_last_check (wmWindow *win, const wmEvent *event) |
| void | ED_view3d_autodist_last_clear (wmWindow *win) |
| void | ED_view3d_autodist_last_set (wmWindow *win, const wmEvent *event, const float ofs[3], const bool has_depth) |
| bool | ED_view3d_autodist_last_get (wmWindow *win, float r_ofs[3]) |
View Axis Utilities | |
| static float | view3d_quat_axis [6][4][4] |
| bool | ED_view3d_quat_from_axis_view (const char view, const char view_axis_roll, float r_quat[4]) |
| bool | ED_view3d_quat_to_axis_view (const float quat[4], const float epsilon, char *r_view, char *r_view_axis_roll) |
| bool | ED_view3d_quat_to_axis_view_and_reset_quat (float quat[4], const float epsilon, char *r_view, char *r_view_axis_roll) |
| char | ED_view3d_lock_view_from_index (int index) |
| char | ED_view3d_axis_view_opposite (char view) |
| bool | ED_view3d_lock (RegionView3D *rv3d) |
3D View checks and manipulation (no operators).
Definition in file view3d_utils.cc.
|
static |
Definition at line 1760 of file view3d_utils.cc.
References data.
Referenced by ED_view3d_depth_read_cached().
|
static |
Definition at line 1229 of file view3d_utils.cc.
References data, ED_view3d_depth_read_cached(), x, and y.
Referenced by ED_view3d_depth_read_cached_seg().
| bool ED_view3d_autodist | ( | ARegion * | region, |
| View3D * | v3d, | ||
| const int | mval[2], | ||
| float | mouse_worldloc[3], | ||
| const float | fallback_depth_pt[3] ) |
Get the world-space 3D location from a screen-space 2D point. It may be useful to call ED_view3d_depth_override before.
| 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. |
Definition at line 1172 of file view3d_utils.cc.
References ARRAY_SIZE, ED_view3d_unproject_v3(), ED_view3d_win_to_3d_int(), float, FLT_MAX, i, U, and view_autodist_depth_margin().
Referenced by depthdropper_depth_sample_pt(), ED_view3d_cursor3d_position(), navigate_pivot_get(), paint_proj_stroke(), and viewcenter_pick_invoke().
Check if the last auto-dist can be used.
Definition at line 1092 of file view3d_utils.cc.
References wmEvent::flag, view3d_autodepth_last_id, WM_event_consecutive_data_get(), and WM_EVENT_IS_CONSECUTIVE.
Referenced by navigate_pivot_get().
| void ED_view3d_autodist_last_clear | ( | wmWindow * | win | ) |
Clear and free auto-dist data.
Definition at line 1104 of file view3d_utils.cc.
References WM_event_consecutive_data_free().
Referenced by ED_view3d_autodist_last_set(), and navigate_pivot_get().
Definition at line 1127 of file view3d_utils.cc.
References BLI_assert, copy_v3_v3(), View3D_AutoDistLast::has_depth, View3D_AutoDistLast::ofs, view3d_autodepth_last_id, WM_event_consecutive_data_get(), and zero_v3().
Referenced by navigate_pivot_get().
| void ED_view3d_autodist_last_set | ( | wmWindow * | win, |
| const wmEvent * | event, | ||
| const float | ofs[3], | ||
| const bool | has_depth ) |
Definition at line 1109 of file view3d_utils.cc.
References copy_v3_v3(), ED_view3d_autodist_last_clear(), View3D_AutoDistLast::has_depth, MEM_callocN(), View3D_AutoDistLast::ofs, view3d_autodepth_last_id, WM_event_consecutive_data_set(), and WM_event_consecutive_gesture_test().
Referenced by navigate_pivot_get().
| bool ED_view3d_autodist_simple | ( | 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 1205 of file view3d_utils.cc.
References ED_view3d_unproject_v3(), float, FLT_MAX, and view_autodist_depth_margin().
Referenced by annotation_stroke_convertcoords(), and blender::ed::object::object_transfer_mode_reposition_view_pivot().
| char ED_view3d_axis_view_opposite | ( | char | view | ) |
Definition at line 1576 of file view3d_utils.cc.
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().
Definition at line 70 of file view3d_utils.cc.
References View3DShading::background_color, View3DShading::background_type, copy_v3_v3(), World::horr, View3D::shading, TH_BACK, UI_GetThemeColor3fv(), V3D_SHADING_BACKGROUND_VIEWPORT, V3D_SHADING_BACKGROUND_WORLD, and Scene::world.
Referenced by blender::draw::gpencil::Instance::draw(), ED_view3d_text_colors_get(), and gizmo_axis_draw().
| bool ED_view3d_boundbox_clip | ( | RegionView3D * | rv3d, |
| const BoundBox * | bb ) |
Definition at line 475 of file view3d_utils.cc.
References RegionView3D::persmatob, and view3d_boundbox_clip_m4().
| bool ED_view3d_boundbox_clip_ex | ( | const RegionView3D * | rv3d, |
| const BoundBox * | bb, | ||
| float | obmat[4][4] ) |
Definition at line 460 of file view3d_utils.cc.
References mul_m4_m4m4(), RegionView3D::persmat, and view3d_boundbox_clip_m4().
| bool ED_view3d_camera_autokey | ( | const Scene * | scene, |
| ID * | id_key, | ||
| bContext * | C, | ||
| const bool | do_rotate, | ||
| const bool | do_translate ) |
Definition at line 689 of file view3d_utils.cc.
References Vector< T, InlineBufferCapacity, Allocator >::append(), blender::animrig::autokeyframe_cfra_can_key(), blender::animrig::autokeyframe_object(), BLI_assert, C, GS, ID_OB, NA_ADDED, ID::name, NC_ANIMATION, ND_KEYFRAME, ROT_MODE_AXISANGLE, ROT_MODE_EUL, ROT_MODE_QUAT, Object::rotmode, and WM_main_add_notifier().
Referenced by ED_view3d_camera_lock_autokey(), and ED_view3d_cameracontrol_update().
| Camera * ED_view3d_camera_data_get | ( | View3D * | v3d, |
| RegionView3D * | rv3d ) |
Definition at line 142 of file view3d_utils.cc.
References View3D::camera, Object::data, 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 | ( | View3D * | v3d, |
| RegionView3D * | rv3d, | ||
| bContext * | C, | ||
| bool | do_rotate, | ||
| bool | do_translate ) |
Call after modifying a locked view.
Definition at line 733 of file view3d_utils.cc.
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, and Object::transflag.
Referenced by view3d_smoothview_apply_and_finish_ex(), view3d_smoothview_apply_with_interp(), view_zoom_apply_step(), viewdolly_modal(), viewmove_invoke_impl(), viewmove_modal_impl(), viewroll_modal(), viewrotate_invoke_impl(), viewrotate_modal_impl(), viewzoom_invoke_impl(), and viewzoom_modal_impl().
| bool ED_view3d_camera_lock_check | ( | const View3D * | v3d, |
| const RegionView3D * | rv3d ) |
Definition at line 603 of file view3d_utils.cc.
References View3D::camera, View3D::flag2, ID_IS_EDITABLE, RegionView3D::persp, RV3D_CAMOB, and V3D_LOCK_CAMERA.
Referenced by ED_view3d_camera_lock_autokey(), ED_view3d_camera_lock_init_ex(), ED_view3d_camera_lock_sync(), ED_view3d_camera_lock_undo_test(), ED_view3d_persp_ensure(), ED_view3d_persp_switch_from_camera(), ViewOpsData::state_restore(), view3d_calc_minmax_selected(), view3d_calc_minmax_visible(), view3d_from_minmax(), view3d_from_minmax_multi(), view3d_zoom_border_exec(), view_zoom_apply_step(), viewmove_apply(), vieworbit_exec(), viewroll_exec(), and viewzoom_apply().
| void ED_view3d_camera_lock_init | ( | const Depsgraph * | depsgraph, |
| View3D * | v3d, | ||
| RegionView3D * | rv3d ) |
Definition at line 625 of file view3d_utils.cc.
References depsgraph, and ED_view3d_camera_lock_init_ex().
Referenced by ED_view3d_smooth_view_ex(), and view3d_zoom_border_exec().
| void ED_view3d_camera_lock_init_ex | ( | const Depsgraph * | depsgraph, |
| View3D * | v3d, | ||
| RegionView3D * | rv3d, | ||
| bool | calc_dist ) |
Copy the camera to the view before starting a view transformation.
Apply the camera object transformation to the 3D Viewport. (needed so we can use regular 3D Viewport manipulation operators, that sync back to the camera).
Definition at line 609 of file view3d_utils.cc.
References View3D::camera, DEG_get_evaluated(), depsgraph, RegionView3D::dist, ED_view3d_camera_lock_check(), ED_view3d_from_object(), ED_view3d_offset_distance(), RegionView3D::ofs, VIEW3D_DIST_FALLBACK, and RegionView3D::viewquat.
Referenced by ED_view3d_camera_lock_init(), and ViewOpsData::init_navigation().
| bool ED_view3d_camera_lock_sync | ( | const Depsgraph * | depsgraph, |
| View3D * | v3d, | ||
| RegionView3D * | rv3d ) |
Copy the view to the camera, return true if.
Apply the 3D Viewport transformation back to the camera object.
Definition at line 630 of file view3d_utils.cc.
References BKE_object_apply_mat4(), BKE_object_tfm_protected_backup(), BKE_object_tfm_protected_restore(), View3D::camera, DEG_get_evaluated(), DEG_id_tag_update(), depsgraph, RegionView3D::dist, ED_view3d_camera_lock_check(), ED_view3d_to_m4(), ED_view3d_to_object(), Object::id, ID_RECALC_TRANSFORM, invert_m4_m4(), mul_m4_m4m4(), NC_OBJECT, ND_TRANSFORM, normalize_m4_m4(), OB_LOCK_SCALEX, OB_LOCK_SCALEY, OB_LOCK_SCALEZ, OB_TRANSFORM_ADJUST_ROOT_PARENT_FOR_VIEW_LOCK, RegionView3D::ofs, Object::parent, Object::protectflag, Object::transflag, RegionView3D::viewquat, and WM_main_add_notifier().
Referenced by ED_view3d_smooth_view_ex(), ViewOpsData::state_restore(), view3d_smoothview_apply_and_finish_ex(), view3d_smoothview_apply_with_interp(), view_zoom_apply_step(), viewdolly_apply(), viewdolly_exec(), viewmove_apply(), viewroll_apply(), viewrotate_apply(), and viewzoom_apply_3d().
| bool ED_view3d_camera_lock_undo_grouped_push | ( | const char * | str, |
| const View3D * | v3d, | ||
| const RegionView3D * | rv3d, | ||
| bContext * | C ) |
A version of ED_view3d_camera_lock_undo_push that performs a grouped undo push.
Definition at line 802 of file view3d_utils.cc.
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, |
| const View3D * | v3d, | ||
| const RegionView3D * | rv3d, | ||
| 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 794 of file view3d_utils.cc.
References C, str, and view3d_camera_lock_undo_ex().
Referenced by ED_view3d_smooth_view_undo_end(), fly_modal(), view3d_navigate_modal_fn(), viewdolly_modal(), and walk_modal().
| bool ED_view3d_camera_lock_undo_test | ( | const View3D * | v3d, |
| const RegionView3D * | rv3d, | ||
| bContext * | C ) |
Check if creating an undo step should be performed if the viewport moves.
Definition at line 758 of file view3d_utils.cc.
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 | ( | Main * | bmain, |
| Depsgraph * | depsgraph, | ||
| const Scene * | scene, | ||
| Object * | camera_ob ) |
Definition at line 1715 of file view3d_utils.cc.
References depsgraph, and view3d_camera_to_view_selected_impl().
Referenced by view3d_camera_to_view_selected_exec().
| bool ED_view3d_camera_to_view_selected_with_set_clipping | ( | Main * | bmain, |
| Depsgraph * | depsgraph, | ||
| const Scene * | scene, | ||
| Object * | camera_ob ) |
Definition at line 1723 of file view3d_utils.cc.
References Object::data, DEG_get_evaluated(), depsgraph, and view3d_camera_to_view_selected_impl().
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 583 of file view3d_utils.cc.
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 | ( | RegionView3D * | rv3d, |
| const float | scale ) |
Utility to scale zoom level when in camera-view RegionView3D.camzoom and apply limits.
Definition at line 570 of file view3d_utils.cc.
References BKE_screen_view3d_zoom_from_fac(), BKE_screen_view3d_zoom_to_fac(), RegionView3D::camzoom, CLAMP, RV3D_CAMZOOM_MAX, RV3D_CAMZOOM_MAX_FACTOR, RV3D_CAMZOOM_MIN, and RV3D_CAMZOOM_MIN_FACTOR.
| bool ED_view3d_clip_range_get | ( | const Depsgraph * | depsgraph, |
| const View3D * | v3d, | ||
| const RegionView3D * | rv3d, | ||
| bool | use_ortho_factor, | ||
| float * | r_clip_start, | ||
| float * | r_clip_end ) |
Definition at line 165 of file view3d_utils.cc.
References BKE_camera_params_from_view3d(), BKE_camera_params_init(), depsgraph, and params.
Referenced by knife_recalc_ortho(), proj_paint_state_viewport_init(), texture_paint_image_from_view_exec(), and view3d_win_to_ray_segment().
| void ED_view3d_clipping_calc | ( | BoundBox * | bb, |
| float | planes[4][4], | ||
| const ARegion * | region, | ||
| const Object * | ob, | ||
| const rcti * | rect ) |
Definition at line 319 of file view3d_utils.cc.
References ED_view3d_clipping_calc_from_boundbox(), ED_view3d_unproject_v3(), ELEM, invert_m4_m4(), is_negative_m4(), mul_m4_v3(), BoundBox::vec, rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by DRW_text_edit_mesh_measure_stats(), blender::ed::sculpt_paint::gesture::init_from_box(), blender::ed::sculpt_paint::gesture::init_from_lasso(), and view3d_clipping_exec().
| void ED_view3d_clipping_calc_from_boundbox | ( | float | clip[4][4], |
| const BoundBox * | bb, | ||
| const bool | is_flip ) |
Definition at line 305 of file view3d_utils.cc.
References dot_v3v3(), negate_v3(), normal_tri_v3(), UNLIKELY, and BoundBox::vec.
Referenced by calc_local_clipping(), and ED_view3d_clipping_calc().
| bool ED_view3d_clipping_clamp_minmax | ( | const RegionView3D * | rv3d, |
| float | min[3], | ||
| float | max[3] ) |
Clamp min/max by the viewport clipping.
Definition at line 372 of file view3d_utils.cc.
References RegionView3D::clip, copy_v3_v3(), i, INIT_MINMAX, isect_planes_v3_fn(), max, PointsInPlanesMinMax_UserData::max, min, PointsInPlanesMinMax_UserData::min, negate_v4_v4(), points_in_planes_minmax_fn(), RV3D_BOXCLIP, RV3D_LOCK_FLAGS, and zero_v3().
Referenced by view3d_calc_minmax_selected(), and view3d_calc_minmax_visible().
| bool ED_view3d_context_activate | ( | bContext * | C | ) |
Definition at line 273 of file view3d_utils.cc.
References 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(), SPACE_VIEW3D, and ScrArea::spacetype.
Referenced by screen_opengl_render_init().
| bool ED_view3d_depth_read_cached | ( | const ViewDepths * | vd, |
| const int | mval[2], | ||
| int | margin, | ||
| float * | r_depth ) |
Definition at line 1773 of file view3d_utils.cc.
References BLI_array_iter_spiral_square, BLI_assert, data, ViewDepths::depth_range, depth_read_test_fn(), ViewDepths::depths, ViewDepths::h, max_ii(), min_ii(), ViewDepths::w, x, and y.
Referenced by annotation_stroke_eraser_is_occluded(), annotation_stroke_newfrombuffer(), depth_segment_cb(), ED_view3d_depth_read_cached_normal(), blender::ed::greasepencil::DrawingPlacement::get_depth(), blender::ed::object::object_transform_axis_target_modal(), blender::ed::curves::stroke_elem_project(), and stroke_elem_project().
| bool ED_view3d_depth_read_cached_normal | ( | const ARegion * | region, |
| const ViewDepths * | depths, | ||
| const int | mval[2], | ||
| float | r_normal[3] ) |
Definition at line 1818 of file view3d_utils.cc.
References add_v3_v3(), cross, cross_v3_v3v3(), ViewDepths::depth_range, ED_view3d_depth_read_cached(), ED_view3d_depth_unproject_v3(), i, normalize_v3(), sub_v3_v3v3(), x, and y.
Referenced by blender::ed::curves::curve_draw_event_add_first(), curve_draw_event_add_first(), blender::ed::object::object_transform_axis_target_modal(), blender::ed::curves::stroke_elem_project(), 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 * | r_depth ) |
Definition at line 1249 of file view3d_utils.cc.
References BLI_bitmap_draw_2d_line_v2v2i(), copy_v2_v2_int(), data, and depth_segment_cb().
Referenced by annotation_stroke_newfrombuffer().
| bool ED_view3d_depth_unproject_v3 | ( | const ARegion * | region, |
| const int | mval[2], | ||
| const double | depth, | ||
| float | r_location_world[3] ) |
Definition at line 1872 of file view3d_utils.cc.
References ED_view3d_unproject_v3(), and float.
Referenced by annotation_stroke_eraser_is_occluded(), ED_view3d_depth_read_cached_normal(), blender::ed::object::object_transform_axis_target_modal(), blender::ed::greasepencil::DrawingPlacement::project_depth(), blender::ed::curves::stroke_elem_project(), and stroke_elem_project().
A version of ED_view3d_dist_soft_range_get that only returns the minimum.
For perspective-views where setting dist near or below the near clip-plane is likely to cause the viewport content to be clipped out of the view.
Definition at line 152 of file view3d_utils.cc.
References View3D::clip_start, and View3D::grid.
Referenced by ED_view3d_dist_soft_range_get(), view3d_from_minmax(), and view3d_localview_init().
| blender::Bounds< float > ED_view3d_dist_soft_range_get | ( | const View3D * | v3d, |
| bool | use_persp_range ) |
Calculate a "soft" working range for RegionView3D::dist.
This is an approximate range to avoid extreme values being set where nothing is visible.
The range is calculated based on values the user may change so the range should be used as guidance for operators to follow.
| use_persp_range | Use an alternative range for perspective views. It's not a requirement that perspective views use this, however in practice it's often preferable for perspective views to calculate the minimum based on near-clipping, unlike orthographic views. |
Definition at line 157 of file view3d_utils.cc.
References View3D::clip_end, and ED_view3d_dist_soft_min_get().
Referenced by view3d_zoom_border_exec(), view_zoom_apply_step(), and viewzoom_apply_3d().
| void ED_view3d_distance_set | ( | RegionView3D * | rv3d, |
| float | dist ) |
Set the dist without moving the view (compensate with RegionView3D.ofs)
Definition at line 1393 of file view3d_utils.cc.
References BLI_assert, copy_v3_fl3(), RegionView3D::dist, invert_qt_qt_normalized(), mul_mat3_m4_v3(), mul_qt_v3(), RegionView3D::ofs, sub_v3_v3(), RegionView3D::viewinv, and RegionView3D::viewquat.
Referenced by ED_view3d_cameracontrol_acquire(), and ED_view3d_cameracontrol_release().
| bool ED_view3d_distance_set_from_location | ( | RegionView3D * | rv3d, |
| const float | dist_co[3], | ||
| float | dist_min ) |
Change the distance & offset to match the depth of dist_co along the view axis.
| dist_co | A world-space location to use for the new depth. |
| dist_min | Resulting distances below this will be ignored. |
Definition at line 1413 of file view3d_utils.cc.
References RegionView3D::dist, dot_v3v3(), invert_qt_qt_normalized(), madd_v3_v3fl(), mul_qt_v3(), negate_v3_v3(), RegionView3D::ofs, sub_v3_v3v3(), and RegionView3D::viewquat.
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 1607 of file view3d_utils.cc.
References BLI_assert, copy_m3_m4(), invert_qt_normalized(), madd_v3_v3fl(), mat3_normalized_to_quat(), negate_v3_v3(), and normalize_m3().
Referenced by ED_view3d_from_object(), and object_apply_mat4_with_protect().
| void ED_view3d_from_object | ( | const Object * | ob, |
| float | ofs[3], | ||
| float | quat[4], | ||
| const float * | dist, | ||
| float * | lens ) |
Set the RegionView3D members from an objects transformation and optionally lens.
| 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. |
Definition at line 1643 of file view3d_utils.cc.
References BKE_camera_params_from_object(), BKE_camera_params_init(), ED_view3d_from_m4(), and params.
Referenced by axis_set_view(), ED_view3d_camera_lock_init_ex(), ED_view3d_persp_switch_from_camera(), and ED_view3d_smooth_view_ex().
| bool ED_view3d_has_workbench_in_texture_color | ( | const Scene * | scene, |
| const Object * | ob, | ||
| const View3D * | v3d ) |
Definition at line 122 of file view3d_utils.cc.
References BKE_scene_uses_blender_workbench(), View3DShading::color_type, Scene::display, Object::mode, OB_MODE_TEXTURE_PAINT, OB_RENDER, OB_SOLID, SceneDisplay::shading, View3D::shading, View3DShading::type, and V3D_SHADING_TEXTURE_COLOR.
Referenced by blender::ed::space_node::has_workbench_in_texture_color().
| void ED_view3d_lastview_store | ( | RegionView3D * | rv3d | ) |
Use to store the last view, before entering camera view.
Definition at line 496 of file view3d_utils.cc.
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().
| bool ED_view3d_lock | ( | RegionView3D * | rv3d | ) |
Definition at line 1596 of file view3d_utils.cc.
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().
| void ED_view3d_lock_clear | ( | View3D * | v3d | ) |
Definition at line 506 of file view3d_utils.cc.
References View3D::flag2, 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 1562 of file view3d_utils.cc.
References RV3D_VIEW_FRONT, RV3D_VIEW_RIGHT, RV3D_VIEW_TOP, and RV3D_VIEW_USER.
Referenced by ED_view3d_quadview_update(), and region_quadview_exec().
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 1372 of file view3d_utils.cc.
References add_v3_v3(), dot_v3v3(), mul_m4_v4(), normalize_v3(), and pos.
Referenced by ED_view3d_camera_lock_init_ex(), ED_view3d_persp_switch_from_camera(), and ED_view3d_smooth_view_ex().
| bool ED_view3d_offset_lock_check | ( | const View3D * | v3d, |
| const RegionView3D * | rv3d ) |
Definition at line 491 of file view3d_utils.cc.
References View3D::ob_center, View3D::ob_center_cursor, RegionView3D::persp, and RV3D_CAMOB.
Referenced by initFlyInfo(), initWalkInfo(), ViewOpsData::state_restore(), view3d_lock_poll(), viewdolly_offset_lock_check(), and viewmove_apply().
Action to take when rotating the view, handle auto-perspective and logic for switching out of views.
shared with NDOF.
Definition at line 535 of file view3d_utils.cc.
References BLI_assert, depsgraph, ED_view3d_camera_lock_check(), ED_view3d_persp_switch_from_camera(), RegionView3D::lpersp, RegionView3D::lview, RegionView3D::persp, ARegion::regiondata, RV3D_CAMOB, RV3D_LOCK_ANY_TRANSFORM, RV3D_LOCK_FLAGS, RV3D_PERSP, RV3D_VIEW_IS_AXIS, U, USER_AUTOPERSP, and RegionView3D::view.
Referenced by ViewOpsData::init_navigation().
| void ED_view3d_persp_switch_from_camera | ( | const Depsgraph * | depsgraph, |
| View3D * | v3d, | ||
| RegionView3D * | rv3d, | ||
| char | persp ) |
For viewport operators that exit camera perspective.
Definition at line 515 of file view3d_utils.cc.
References BLI_assert, View3D::camera, DEG_get_evaluated(), depsgraph, RegionView3D::dist, ED_view3d_camera_lock_check(), ED_view3d_from_object(), ED_view3d_offset_distance(), NC_SPACE, ND_SPACE_VIEW3D, RegionView3D::ofs, RegionView3D::persp, RV3D_CAMOB, VIEW3D_DIST_FALLBACK, RegionView3D::viewquat, and WM_main_add_notifier().
Referenced by ED_view3d_persp_ensure(), view3d_zoom_border_exec(), and viewdolly_invoke().
| void ED_view3d_polygon_offset | ( | const RegionView3D * | rv3d, |
| float | dist ) |
Use instead of: GPU_polygon_offset(rv3d->dist, ...) see bug #37727.
Definition at line 253 of file view3d_utils.cc.
References RegionView3D::dist, fabsf, GPU_polygon_offset(), RegionView3D::is_persp, max_ff(), RegionView3D::persp, RegionView3D::rflag, RV3D_CAMOB, RV3D_ZOFFSET_DISABLED, and RegionView3D::winmat.
'clip' is used to know if our clip setting has changed.
Definition at line 1012 of file view3d_utils.cc.
References ARegion::alignment, ED_area_tag_redraw(), ED_view3d_lock(), ED_view3d_lock_view_from_index(), ListBase::last, LISTBASE_FOREACH, RegionView3D::persp, ARegion::prev, ScrArea::regionbase, 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().
| bool ED_view3d_quat_from_axis_view | ( | const char | view, |
| const char | view_axis_roll, | ||
| float | r_quat[4] ) |
Definition at line 1488 of file view3d_utils.cc.
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 | quat[4], |
| const float | epsilon, | ||
| char * | r_view, | ||
| char * | r_view_axis_roll ) |
Definition at line 1498 of file view3d_utils.cc.
References angle_signed_qtqt(), fabsf, FLT_MAX, 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 | quat[4], |
| float | epsilon, | ||
| char * | r_view, | ||
| char * | r_view_axis_roll ) |
A version of ED_view3d_quat_to_axis_view that updates quat if it's within epsilon to an axis-view.
Definition at line 1548 of file view3d_utils.cc.
References BLI_assert, ED_view3d_quat_from_axis_view(), ED_view3d_quat_to_axis_view(), and RV3D_VIEW_USER.
Referenced by view_roll_angle(), and viewrotate_apply_snap().
| float ED_view3d_radius_to_dist | ( | const View3D * | v3d, |
| const ARegion * | region, | ||
| const Depsgraph * | depsgraph, | ||
| char | persp, | ||
| bool | use_aspect, | ||
| float | radius ) |
Return a new RegionView3D.dist value to fit the radius.
+
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). |
Definition at line 1292 of file view3d_utils.cc.
References angle(), atanf, BKE_camera_params_from_object(), BKE_camera_params_init(), BKE_camera_sensor_size(), BLI_assert, View3D::camera, CAMERA_PARAM_ZOOM_INIT_CAMOB, CAMERA_PARAM_ZOOM_INIT_PERSP, View3D::clip_end, View3D::clip_start, DEFAULT_SENSOR_WIDTH, DEG_get_evaluated(), depsgraph, ED_view3d_radius_to_dist_ortho(), ED_view3d_radius_to_dist_persp(), ELEM, focallength_to_fov(), View3D::lens, params, ARegion::regiondata, RV3D_CAMOB, RV3D_ORTHO, RV3D_PERSP, tanf, RegionView3D::viewcamtexcofac, ARegion::winx, and ARegion::winy.
Referenced by view3d_from_minmax(), and view3d_localview_init().
Definition at line 1287 of file view3d_utils.cc.
References DEFAULT_SENSOR_WIDTH.
Referenced by ED_view3d_radius_to_dist().
Definition at line 1282 of file view3d_utils.cc.
Referenced by ED_view3d_radius_to_dist().
| void ED_view3d_text_colors_get | ( | const Scene * | scene, |
| const View3D * | v3d, | ||
| float | r_text_color[4], | ||
| float | r_shadow_color[4] ) |
Definition at line 86 of file view3d_utils.cc.
References clamp_v3(), copy_v3_fl(), distance(), ED_view3d_background_color_get(), len_v3v3(), mul_v3_fl(), srgb_to_grayscale(), TH_TEXT_HI, and UI_GetThemeColor3fv().
Referenced by blender::ed::transform::drawAutoKeyWarning(), blender::ed::transform::transform_draw_cursor_draw(), and view3d_draw_region_info().
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 1633 of file view3d_utils.cc.
References mul_mat3_m4_v3(), quat_to_mat4(), and sub_v3_v3v3().
Referenced by ED_view3d_camera_lock_sync(), ED_view3d_cameracontrol_acquire(), ED_view3d_cameracontrol_update(), and ED_view3d_to_object().
| void ED_view3d_to_object | ( | const Depsgraph * | depsgraph, |
| Object * | ob, | ||
| const float | ofs[3], | ||
| const float | quat[4], | ||
| float | dist ) |
Set the object transformation from RegionView3D members.
| 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. |
Definition at line 1657 of file view3d_utils.cc.
References BKE_object_apply_mat4_ex(), DEG_get_evaluated(), depsgraph, ED_view3d_to_m4(), Object::parent, and Object::parentinv.
Referenced by ED_view3d_camera_lock_sync(), and view3d_camera_to_view_exec().
| bool ED_view3d_viewplane_get | ( | const Depsgraph * | depsgraph, |
| const View3D * | v3d, | ||
| const RegionView3D * | rv3d, | ||
| int | winx, | ||
| int | winy, | ||
| rctf * | r_viewplane, | ||
| float * | r_clip_start, | ||
| float * | r_clip_end, | ||
| float * | r_pixsize ) |
Definition at line 193 of file view3d_utils.cc.
References BKE_camera_params_compute_viewplane(), BKE_camera_params_from_view3d(), BKE_camera_params_init(), depsgraph, and params.
Referenced by blender::ed::greasepencil::image_render::compute_view_matrices(), ED_view3d_draw_offscreen_imbuf(), and view3d_winmatrix_set().
|
static |
Definition at line 364 of file view3d_utils.cc.
References PointsInPlanesMinMax_UserData::max, PointsInPlanesMinMax_UserData::min, and minmax_v3v3_v3().
Referenced by ED_view3d_clipping_clamp_minmax().
Definition at line 419 of file view3d_utils.cc.
References copy_v3_v3(), flag, max, min, mul_m4_v4(), and BoundBox::vec.
Referenced by ED_view3d_boundbox_clip(), and ED_view3d_boundbox_clip_ex().
|
static |
Definition at line 818 of file view3d_utils.cc.
References RegionView3D::clip, RegionView3D::clipbb, copy_v2_v2(), RegionView3D::dist, dot_v3v3(), ELEM, LISTBASE_FOREACH, MEM_callocN(), MEM_dupallocN(), MEM_freeN(), normal_tri_v3(), RegionView3D::ofs, ScrArea::regionbase, RegionView3D::rflag, RGN_TYPE_WINDOW, RV3D_BOXCLIP, RV3D_CLIPPING, RV3D_LOCK_FLAGS, RV3D_VIEW_BACK, RV3D_VIEW_BOTTOM, RV3D_VIEW_FRONT, RV3D_VIEW_TOP, BoundBox::vec, and RegionView3D::view.
Referenced by view3d_boxview_copy(), and view3d_boxview_sync().
For home, center etc.
Definition at line 988 of file view3d_utils.cc.
References copy_v3_v3(), RegionView3D::dist, ED_region_tag_redraw(), LISTBASE_FOREACH, RegionView3D::ofs, ScrArea::regionbase, ARegion::regiondata, ARegion::regiontype, RGN_TYPE_WINDOW, RV3D_BOXCLIP, RV3D_LOCK_FLAGS, and view3d_boxview_clip().
Referenced by ED_view3d_smooth_view_ex(), and view3d_smoothview_apply_from_timer().
Sync center/zoom view of region to others, for view transforms.
Definition at line 964 of file view3d_utils.cc.
References RegionView3D::dist, ED_region_tag_redraw(), LISTBASE_FOREACH, ScrArea::regionbase, ARegion::regiondata, ARegion::regiontype, RGN_TYPE_WINDOW, RV3D_BOXCLIP, RV3D_LOCK_FLAGS, RV3D_LOCK_ROTATION, view3d_boxview_clip(), and view3d_boxview_sync_axis().
Referenced by ED_view3d_quadview_update(), ViewOpsData::state_restore(), view3d_zoom_border_exec(), view_zoom_apply_step(), viewdolly_apply(), viewdolly_exec(), viewmove_apply(), viewroll_apply(), and viewzoom_apply_3d().
|
static |
Find which axis values are shared between both views and copy to rv3d_dst taking axis flipping into account.
Definition at line 918 of file view3d_utils.cc.
References ED_view3d_quat_from_axis_view(), fabsf, i, invert_qt_normalized(), mul_qt_v3(), RegionView3D::ofs, UNLIKELY, RegionView3D::view, and RegionView3D::view_axis_roll.
Referenced by view3d_boxview_sync().
|
static |
Create a MEMFILE undo-step for locked camera movement when transforming the view. Edit and texture paint mode don't use MEMFILE undo so undo push is skipped for them. NDOF and trackpad navigation would create an undo step on every gesture and we may end up with unnecessary undo steps so undo push for them is not supported for now. Operators that use smooth view for navigation are supported via an optional parameter field, see: V3D_SmoothParams.undo_str.
Definition at line 776 of file view3d_utils.cc.
References C, ED_undo_grouped_push(), ED_undo_push(), ED_view3d_camera_lock_undo_test(), and str.
Referenced by ED_view3d_camera_lock_undo_grouped_push(), and ED_view3d_camera_lock_undo_push().
|
static |
Definition at line 1670 of file view3d_utils.cc.
References BKE_camera_view_frame_fit_to_scene(), BKE_object_apply_mat4(), BKE_object_tfm_protected_backup(), BKE_object_tfm_protected_restore(), CAM_ORTHO, copy_m4_m4(), copy_v3_v3(), Object::data, DEG_get_evaluated(), DEG_id_tag_update_ex(), depsgraph, Object::id, ID_RECALC_PARAMETERS, ID_RECALC_TRANSFORM, OB_CAMERA, OB_LOCK_ROT4D, OB_LOCK_SCALE, and Object::type.
Referenced by ED_view3d_camera_to_view_selected(), and ED_view3d_camera_to_view_selected_with_set_clipping().
| void view3d_operator_needs_gpu | ( | const bContext * | C | ) |
Use this call when executing an operator, event system doesn't set for each event the OpenGL drawing context.
Definition at line 231 of file view3d_utils.cc.
References C, CTX_wm_region(), and view3d_region_operator_needs_gpu().
Referenced by armature_select_linked_pick_invoke(), armature_shortest_path_pick_invoke(), brush_edit_apply(), brush_stroke_init(), curve_draw_invoke(), blender::ed::curves::curves_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(), loopcut_init(), loopcut_modal(), blender::ed::object::object_transform_axis_target_modal(), paint_proj_new_stroke(), paint_proj_stroke(), paint_select_linked_pick_invoke(), paintface_select_loop_invoke(), paintvert_select_linked_pick_invoke(), pose_select_connected_invoke(), 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(), weight_sample_group_invoke(), weight_sample_invoke(), and wpaint_stroke_update_step().
| void view3d_region_operator_needs_gpu | ( | ARegion * | region | ) |
Definition at line 238 of file view3d_utils.cc.
References GPU_matrix_projection_set, GPU_matrix_set, printf, ARegion::regiondata, ARegion::regiontype, RGN_TYPE_WINDOW, RegionView3D::viewmat, RegionView3D::winmat, ARegion::winrct, and wmViewport().
Referenced by annotation_paint_strokeend(), annotation_stroke_addpoint(), annotation_stroke_doeraser(), and view3d_operator_needs_gpu().
Definition at line 1151 of file view3d_utils.cc.
References BLI_rcti_init_pt_radius(), ViewDepths::depths, MEM_SAFE_FREE, view3d_depth_near(), view3d_depths_rect_create(), rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
Referenced by ED_view3d_autodist(), and ED_view3d_autodist_simple().
|
static |
Definition at line 1082 of file view3d_utils.cc.
Referenced by ED_view3d_autodist_last_check(), ED_view3d_autodist_last_get(), and ED_view3d_autodist_last_set().
|
static |
Lookup by axis-view, axis-roll.
Definition at line 1445 of file view3d_utils.cc.
Referenced by ED_view3d_quat_from_axis_view(), and ED_view3d_quat_to_axis_view().