76 const bool undo_grouped)
97 const ARegion *region_camera =
nullptr;
100 bool is_interactive =
false;
107 region_camera = ®ion;
109 is_interactive =
true;
114 if (region_camera ==
nullptr) {
121 if (is_interactive) {
132 if (is_interactive) {
209 const Depsgraph *depsgraph,
215 const int smooth_viewtx,
223 "Only the 'ED_view3d_smooth_view' version of this function handles undo!");
232 if (rv3d->
sms ==
nullptr) {
281 if (sview->
ofs !=
nullptr) {
308 if (sview->
ofs !=
nullptr) {
313 ob_camera_old_eval->object_to_world().ptr(), sview->
ofs, 0.0f);
344 (id_cast<Camera *>(ob_camera_eval->
data)->type ==
CAM_ORTHO)) ?
356 if (rv3d->
sms ==
nullptr) {
397 const int smooth_viewtx,
410 const bool do_undo = (sview->
undo_str !=
nullptr);
470 if (C_for_camera_lock) {
483 MEM_delete(rv3d->
sms);
520 if (factor >= 1.0f) {
525 factor = (3.0f * factor * factor - 2.0f * factor * factor * factor);
578 if (rv3d && rv3d->
sms) {
611 if (rv3d && rv3d->
sms) {
619 ot->
name =
"Smooth View";
620 ot->
idname =
"VIEW3D_OT_smoothview";
632 MEM_SAFE_DELETE(rv3d->
sms);
#define RV3D_LOCK_FLAGS(rv3d)
#define VIEW3D_DIST_FALLBACK
Read Blender memory allocation and freeing.
#define BLI_assert_msg(a, msg)
void camera(KernelGlobals &kg, const ShadingData &sd, float3 &outview, float &outdepth, float &outdist)
void WM_main_add_notifier(uint type, void *reference)
void * MEM_new_uninitialized(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
bool ED_view3d_camera_lock_autokey(View3D *v3d, RegionView3D *rv3d, bContext *C, bool do_rotate, bool do_translate)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
ScrArea * CTX_wm_area(const bContext *C)
void VIEW3D_OT_smoothview(wmOperatorType *ot)
float angle_signed_normalized_qtqt(const float q1[4], const float q2[4])
MINLINE void copy_v3_v3(float r[3], const float a[3])
bool ED_view3d_camera_lock_undo_grouped_push(const char *str, const View3D *v3d, const RegionView3D *rv3d, bContext *C)
bool ED_view3d_camera_lock_sync(const Depsgraph *depsgraph, View3D *v3d, RegionView3D *rv3d)
void ED_view3d_update_viewmat(const Depsgraph *depsgraph, const Scene *scene, View3D *v3d, ARegion *region, const float viewmat[4][4], const float winmat[4][4], const rcti *rect, bool offscreen)
bool ED_view3d_camera_lock_undo_push(const char *str, const View3D *v3d, const RegionView3D *rv3d, bContext *C)
void ED_view3d_smooth_view_undo_end(bContext *C, const ScrArea *area, const char *undo_str, bool undo_grouped)
wmWindow * CTX_wm_window(const bContext *C)
static void view3d_smooth_view_state_backup(SmoothView3DState *sms_state, const View3D *v3d, const RegionView3D *rv3d)
void ED_region_tag_redraw(ARegion *region)
eRegionView3D_ViewAxisRoll
MINLINE bool equals_v3v3(const float v1[3], const float v2[3]) ATTR_WARN_UNUSED_RESULT
MINLINE bool equals_v4v4(const float v1[4], const float v2[4]) ATTR_WARN_UNUSED_RESULT
bool ED_view3d_camera_lock_undo_test(const View3D *v3d, const RegionView3D *rv3d, bContext *C)
void copy_qt_qt(float q[4], const float a[4])
void interp_qt_qtqt(float q[4], const float a[4], const float b[4], float t)
T * DEG_get_evaluated(const Depsgraph *depsgraph, T *id)
wmWindowManager * CTX_wm_manager(const bContext *C)
Depsgraph * CTX_data_ensure_evaluated_depsgraph(const bContext *C, bool rna_write_check=false)
void ED_view3d_smooth_view_force_finish_no_camera_lock(const Depsgraph *depsgraph, wmWindowManager *wm, wmWindow *win, const Scene *scene, View3D *v3d, ARegion *region)
void ED_view3d_camera_lock_init(const Depsgraph *depsgraph, View3D *v3d, RegionView3D *rv3d)
void view3d_smooth_free(RegionView3D *rv3d)
bool ED_operator_view3d_active(bContext *C)
void interp_v3_v3v3(float r[3], const float a[3], const float b[3], float t)
void ED_view3d_smooth_view_ex(const Depsgraph *depsgraph, wmWindowManager *wm, wmWindow *win, ScrArea *area, View3D *v3d, ARegion *region, int smooth_viewtx, const V3D_SmoothParams *sview)
void view3d_boxview_copy(ScrArea *area, ARegion *region)
void ED_view3d_smooth_view_undo_begin(bContext *C, const ScrArea *area)
static void view3d_smooth_view_state_restore(const SmoothView3DState *sms_state, View3D *v3d, RegionView3D *rv3d)
static void view3d_smoothview_apply_with_interp(bContext *C, View3D *v3d, RegionView3D *rv3d, const bool use_autokey, const float factor)
static wmOperatorStatus view3d_smoothview_invoke(bContext *C, wmOperator *, const wmEvent *event)
void ED_view3d_smooth_view_force_finish(bContext *C, View3D *v3d, ARegion *region)
void view3d_orbit_apply_dyn_ofs(float r_ofs[3], const float ofs_old[3], const float viewquat_old[4], const float viewquat_new[4], const float dyn_ofs[3])
MINLINE float interpf(float target, float origin, float t)
static void view3d_smooth_view_force_finish_ex(const Depsgraph *depsgraph, wmWindowManager *wm, wmWindow *win, const Scene *scene, View3D *v3d, ARegion *region, bContext *C_for_camera_lock)
Scene * CTX_data_scene(const bContext *C)
void WM_event_timer_remove(wmWindowManager *wm, wmWindow *, wmTimer *timer)
static void view3d_smoothview_apply_and_finish_ex(wmWindowManager *wm, wmWindow *win, View3D *v3d, RegionView3D *rv3d, bContext *C_for_camera_lock)
wmTimer * WM_event_timer_add(wmWindowManager *wm, wmWindow *win, const wmEventType event_type, const double time_step)
void WM_event_add_mousemove(wmWindow *win)
void ED_view3d_from_object(const Object *ob, float ofs[3], float quat[4], const float *dist, float roll, float *r_lens)
static void view3d_smoothview_apply_from_timer(bContext *C, View3D *v3d, ARegion *region)
ARegion * CTX_wm_region(const bContext *C)
void ED_view3d_smooth_view(bContext *C, View3D *v3d, ARegion *region, int smooth_viewtx, const V3D_SmoothParams *sview)
static void view3d_smoothview_apply_and_finish(bContext *C, View3D *v3d, RegionView3D *rv3d)
View3D * CTX_wm_view3d(const bContext *C)
bScreen * ED_screen_animation_playing(const wmWindowManager *wm)
float ED_view3d_offset_distance(const float mat[4][4], const float ofs[3], float fallback_dist)
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
eRegionView3D_ViewAxisRoll view_axis_roll
struct ViewRender * view_render
struct wmTimer * smooth_timer
eRegionView3D_Persp persp
struct SmoothView3DStore * sms
ListBaseT< ARegion > regionbase
ListBaseT< SpaceLink > spacedata
eRegionView3D_ViewAxisRoll org_view_axis_roll
eRegionView3D_View org_view
bool(*) poll(bContext *C) ATTR_WARN_UNUSED_RESULT
wmOperatorStatus(*) invoke(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT