Blender V5.3
view3d_navigate_smoothview.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include "DNA_camera_types.h"
10
11#include "MEM_guardedalloc.h"
12
13#include "BLI_listbase.hh"
15#include "BLI_math_vector_c.hh"
16
17#include "BKE_context.hh"
18
20
21#include "WM_api.hh"
22
23#include "ED_screen.hh"
24
25#include "view3d_intern.hh"
26#include "view3d_navigate.hh" /* Own include. */
27
28namespace blender {
29
31 bContext *C, View3D *v3d, RegionView3D *rv3d, const bool use_autokey, const float factor);
32
33/* -------------------------------------------------------------------- */
47
49{
50 const View3D *v3d = area->spacedata.first_as<View3D>();
51 Object *camera = v3d->camera;
52 if (!camera) {
53 return;
54 }
55
56 /* Tag the camera object so it's known smooth-view is applied to the view-ports camera
57 * (needed to detect when a locked camera is being manipulated).
58 * NOTE: It doesn't matter if the actual object being manipulated is the camera or not. */
59 camera->id.tag &= ~ID_TAG_DOIT;
60
61 for (const ARegion &region : area->regionbase) {
62 if (region.regiontype != RGN_TYPE_WINDOW) {
63 continue;
64 }
65 const RegionView3D *rv3d = static_cast<const RegionView3D *>(region.regiondata);
66 if (ED_view3d_camera_lock_undo_test(v3d, rv3d, C)) {
67 camera->id.tag |= ID_TAG_DOIT;
68 break;
69 }
70 }
71}
72
74 const ScrArea *area,
75 const char *undo_str,
76 const bool undo_grouped)
77{
78 View3D *v3d = area->spacedata.first_as<View3D>();
79 Object *camera = v3d->camera;
80 if (!camera) {
81 return;
82 }
83 if (camera->id.tag & ID_TAG_DOIT) {
84 /* Smooth view didn't touch the camera. */
85 camera->id.tag &= ~ID_TAG_DOIT;
86 return;
87 }
88
89 if ((U.uiflag & USER_GLOBALUNDO) == 0) {
90 return;
91 }
92
93 /* NOTE(@ideasman42): It is not possible that a single viewport references different cameras
94 * so even in the case there is a quad-view with multiple camera views set, these will all
95 * reference the same camera. In this case it doesn't matter which region is used.
96 * If in the future multiple cameras are supported, this logic can be extended. */
97 const ARegion *region_camera = nullptr;
98
99 /* An undo push should be performed. */
100 bool is_interactive = false;
101 for (const ARegion &region : area->regionbase) {
102 if (region.regiontype != RGN_TYPE_WINDOW) {
103 continue;
104 }
105 const RegionView3D *rv3d = static_cast<const RegionView3D *>(region.regiondata);
106 if (ED_view3d_camera_lock_undo_test(v3d, rv3d, C)) {
107 region_camera = &region;
108 if (rv3d->sms) {
109 is_interactive = true;
110 }
111 }
112 }
113
114 if (region_camera == nullptr) {
115 return;
116 }
117
118 RegionView3D *rv3d = static_cast<RegionView3D *>(region_camera->regiondata);
119
120 /* Fast forward, undo push, then rewind. */
121 if (is_interactive) {
122 view3d_smoothview_apply_with_interp(C, v3d, rv3d, false, 1.0f);
123 }
124
125 if (undo_grouped) {
126 ED_view3d_camera_lock_undo_grouped_push(undo_str, v3d, rv3d, C);
127 }
128 else {
129 ED_view3d_camera_lock_undo_push(undo_str, v3d, rv3d, C);
130 }
131
132 if (is_interactive) {
133 view3d_smoothview_apply_with_interp(C, v3d, rv3d, false, 0.0f);
134 }
135}
136
138
139/* -------------------------------------------------------------------- */
148
150 float dist;
151 float lens;
152 float quat[4];
153 float ofs[3];
154};
155
186
188 const View3D *v3d,
189 const RegionView3D *rv3d)
190{
191 copy_v3_v3(sms_state->ofs, rv3d->ofs);
192 copy_qt_qt(sms_state->quat, rv3d->viewquat);
193 sms_state->dist = rv3d->dist;
194 sms_state->lens = v3d->lens;
195}
196
198 View3D *v3d,
199 RegionView3D *rv3d)
200{
201 copy_v3_v3(rv3d->ofs, sms_state->ofs);
202 copy_qt_qt(rv3d->viewquat, sms_state->quat);
203 rv3d->dist = sms_state->dist;
204 v3d->lens = sms_state->lens;
205}
206
208 /* Avoid passing in the context. */
209 const Depsgraph *depsgraph,
211 wmWindow *win,
212 ScrArea *area,
213 View3D *v3d,
214 ARegion *region,
215 const int smooth_viewtx,
216 const V3D_SmoothParams *sview)
217{
218 /* Will start a timer if appropriate. */
219
220 /* In this case use #ED_view3d_smooth_view_undo_begin & end functions
221 * instead of passing in undo. */
222 BLI_assert_msg(sview->undo_str == nullptr,
223 "Only the 'ED_view3d_smooth_view' version of this function handles undo!");
224
225 RegionView3D *rv3d = static_cast<RegionView3D *>(region->regiondata);
226 SmoothView3DStore sms = {{0}};
227
228 /* Initialize `sms`. */
229 view3d_smooth_view_state_backup(&sms.dst, v3d, rv3d);
230 view3d_smooth_view_state_backup(&sms.src, v3d, rv3d);
231 /* If smooth-view runs multiple times. */
232 if (rv3d->sms == nullptr) {
233 view3d_smooth_view_state_backup(&sms.org, v3d, rv3d);
234 }
235 else {
236 sms.org = rv3d->sms->org;
237 }
238 sms.org_view = rv3d->view;
240
241 // sms.to_camera = false; /* Initialized to zero anyway. */
242
243 /* NOTE: Regarding camera locking: This is a little confusing but works OK.
244 * We may be changing the view 'as if' there is no active camera, but in fact
245 * there is an active camera which is locked to the view.
246 *
247 * In the case where smooth view is moving _to_ a camera we don't want that
248 * camera to be moved or changed, so only when the camera is not being set should
249 * we allow camera option locking to initialize the view settings from the camera. */
250 if (sview->camera == nullptr && sview->camera_old == nullptr) {
251 ED_view3d_camera_lock_init(depsgraph, v3d, rv3d);
252 }
253
254 /* Store the options we want to end with. */
255 if (sview->ofs) {
256 copy_v3_v3(sms.dst.ofs, sview->ofs);
257 }
258 if (sview->quat) {
259 copy_qt_qt(sms.dst.quat, sview->quat);
260 }
261 if (sview->dist) {
262 sms.dst.dist = *sview->dist;
263 }
264 if (sview->lens) {
265 sms.dst.lens = *sview->lens;
266 }
267
268 if (sview->dyn_ofs) {
269 BLI_assert(sview->ofs == nullptr);
270 BLI_assert(sview->quat != nullptr);
271
272 copy_v3_v3(sms.dyn_ofs, sview->dyn_ofs);
273 sms.use_dyn_ofs = true;
274
275 /* Calculate the final destination offset. */
276 view3d_orbit_apply_dyn_ofs(sms.dst.ofs, sms.src.ofs, sms.src.quat, sms.dst.quat, sms.dyn_ofs);
277 }
278
279 if (sview->camera) {
280 Object *ob_camera_eval = DEG_get_evaluated(depsgraph, sview->camera);
281 if (sview->ofs != nullptr) {
283 ob_camera_eval->object_to_world().ptr(), sview->ofs, VIEW3D_DIST_FALLBACK);
284 }
286 ob_camera_eval, sms.dst.ofs, sms.dst.quat, &sms.dst.dist, rv3d->camroll, &sms.dst.lens);
287 /* Restore view3d values in end. */
288 sms.to_camera = true;
289 }
290
291 if ((sview->camera_old == sview->camera) && /* Camera. */
292 (sms.dst.dist == rv3d->dist) && /* Distance. */
293 (sms.dst.lens == v3d->lens) && /* Lens. */
294 equals_v3v3(sms.dst.ofs, rv3d->ofs) && /* Offset. */
295 equals_v4v4(sms.dst.quat, rv3d->viewquat) /* Rotation. */
296 )
297 {
298 /* Early return if nothing changed. */
299 return;
300 }
301
302 /* Skip smooth viewing for external render engine draw. */
303 if (smooth_viewtx && !(v3d->shading.type == OB_RENDER && rv3d->view_render)) {
304
305 /* Original values. */
306 if (sview->camera_old) {
307 Object *ob_camera_old_eval = DEG_get_evaluated(depsgraph, sview->camera_old);
308 if (sview->ofs != nullptr) {
309 /* This assignment will temporarily set the #RegionView3D::dist to zero.
310 * While this isn't typically allowed, it's not a bug to set this temporarily,
311 * doing so shouldn't crash or cause an invalid display, see !143946. */
313 ob_camera_old_eval->object_to_world().ptr(), sview->ofs, 0.0f);
314 }
315 ED_view3d_from_object(ob_camera_old_eval,
316 sms.src.ofs,
317 sms.src.quat,
318 &sms.src.dist,
319 rv3d->camroll,
320 &sms.src.lens);
321 }
322 /* Grid draw as floor. */
323 if ((RV3D_LOCK_FLAGS(rv3d) & RV3D_LOCK_ROTATION) == 0) {
324 /* Use existing if exists, means multiple calls to smooth view
325 * won't lose the original 'view' setting. */
326 rv3d->view = RV3D_VIEW_USER;
327 }
328
329 sms.time_allowed = double(smooth_viewtx / 1000.0);
330
331 /* If this is view rotation only we can decrease the time allowed by the angle between
332 * quaternions this means small rotations won't lag. */
333 if (sview->quat && !sview->ofs && !sview->dist) {
334 /* Scale the time allowed by the rotation (180 degrees == 1.0). */
336 M_PI;
337 }
338
339 /* Ensure it shows correct. */
340 if (sms.to_camera) {
341 /* Use orthographic if we move from an orthographic view to an orthographic camera. */
342 Object *ob_camera_eval = DEG_get_evaluated(depsgraph, sview->camera);
343 rv3d->persp = ((rv3d->is_persp == false) && (ob_camera_eval->type == OB_CAMERA) &&
344 (id_cast<Camera *>(ob_camera_eval->data)->type == CAM_ORTHO)) ?
345 RV3D_ORTHO :
347 }
348
349 rv3d->rflag |= RV3D_NAVIGATING;
350
351 /* Not essential but in some cases the caller will tag the area for redraw, and in that
352 * case we can get a flicker of the 'org' user view but we want to see 'src'. */
353 view3d_smooth_view_state_restore(&sms.src, v3d, rv3d);
354
355 /* Keep track of running timer! */
356 if (rv3d->sms == nullptr) {
357 rv3d->sms = MEM_new_uninitialized<SmoothView3DStore>("smoothview v3d");
358 }
359 *rv3d->sms = sms;
360 if (rv3d->smooth_timer) {
362 }
363 /* #TIMER1 is hard-coded in key-map. */
364 rv3d->smooth_timer = WM_event_timer_add(wm, win, TIMER1, 1.0 / 100.0);
365 }
366 else {
367 /* Animation is disabled, apply immediately. */
368 if (sms.to_camera == false) {
369 copy_v3_v3(rv3d->ofs, sms.dst.ofs);
370 copy_qt_qt(rv3d->viewquat, sms.dst.quat);
371 rv3d->dist = sms.dst.dist;
372 v3d->lens = sms.dst.lens;
373
374 ED_view3d_camera_lock_sync(depsgraph, v3d, rv3d);
375 }
376
377 if (RV3D_LOCK_FLAGS(rv3d) & RV3D_BOXVIEW) {
378 view3d_boxview_copy(area, region);
379 }
380
381 ED_region_tag_redraw(region);
382
384 }
385
386 if (sms.to_camera == false) {
387 /* See comments in #ED_view3d_smooth_view_undo_begin for why this is needed. */
388 if (v3d->camera) {
389 v3d->camera->id.tag &= ~ID_TAG_DOIT;
390 }
391 }
392}
393
395 View3D *v3d,
396 ARegion *region,
397 const int smooth_viewtx,
398 const V3D_SmoothParams *sview)
399{
400 const Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
402 wmWindow *win = CTX_wm_window(C);
403 ScrArea *area = CTX_wm_area(C);
404
405 /* #ED_view3d_smooth_view_ex asserts this is not set as it doesn't support undo. */
406 V3D_SmoothParams sview_no_undo = *sview;
407 sview_no_undo.undo_str = nullptr;
408 sview_no_undo.undo_grouped = false;
409
410 const bool do_undo = (sview->undo_str != nullptr);
411 if (do_undo) {
413 }
414
415 ED_view3d_smooth_view_ex(depsgraph, wm, win, area, v3d, region, smooth_viewtx, &sview_no_undo);
416
417 if (do_undo) {
419 }
420}
421
426 bContext *C, View3D *v3d, RegionView3D *rv3d, const bool use_autokey, const float factor)
427{
428 SmoothView3DStore *sms = rv3d->sms;
429
430 interp_qt_qtqt(rv3d->viewquat, sms->src.quat, sms->dst.quat, factor);
431
432 if (sms->use_dyn_ofs) {
434 rv3d->ofs, sms->src.ofs, sms->src.quat, rv3d->viewquat, sms->dyn_ofs);
435 }
436 else {
437 interp_v3_v3v3(rv3d->ofs, sms->src.ofs, sms->dst.ofs, factor);
438 }
439
440 rv3d->dist = interpf(sms->dst.dist, sms->src.dist, factor);
441 v3d->lens = interpf(sms->dst.lens, sms->src.lens, factor);
442
443 const Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
444 if (ED_view3d_camera_lock_sync(depsgraph, v3d, rv3d)) {
445 if (use_autokey) {
446 ED_view3d_camera_lock_autokey(v3d, rv3d, C, true, true);
447 }
448 }
449}
450
455 wmWindow *win,
456 View3D *v3d,
457 RegionView3D *rv3d,
458 bContext *C_for_camera_lock)
459{
460 SmoothView3DStore *sms = rv3d->sms;
461
462 /* If we went to camera, store the original. */
463 if (sms->to_camera) {
464 rv3d->persp = RV3D_CAMOB;
465 view3d_smooth_view_state_restore(&sms->org, v3d, rv3d);
466 }
467 else {
468 view3d_smooth_view_state_restore(&sms->dst, v3d, rv3d);
469
470 if (C_for_camera_lock) {
471 const Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C_for_camera_lock);
472 if (ED_view3d_camera_lock_sync(depsgraph, v3d, rv3d)) {
473 ED_view3d_camera_lock_autokey(v3d, rv3d, C_for_camera_lock, true, true);
474 }
475 }
476 }
477
478 if ((RV3D_LOCK_FLAGS(rv3d) & RV3D_LOCK_ROTATION) == 0) {
479 rv3d->view = sms->org_view;
481 }
482
483 MEM_delete(rv3d->sms);
484 rv3d->sms = nullptr;
485
487 rv3d->smooth_timer = nullptr;
488 rv3d->rflag &= ~RV3D_NAVIGATING;
489
490 /* Event handling won't know if a UI item has been moved under the pointer. */
492
493 /* NOTE: this doesn't work right because the `v3d->lens` is used in orthographic mode,
494 * when switching camera in quad-view the other orthographic views would zoom & reset.
495 *
496 * For now only redraw all regions when smooth-view finishes. */
498}
499
506
508{
510 RegionView3D *rv3d = static_cast<RegionView3D *>(region->regiondata);
511 SmoothView3DStore *sms = rv3d->sms;
512 float factor;
513
514 if (sms->time_allowed != 0.0) {
515 factor = float(rv3d->smooth_timer->time_duration / sms->time_allowed);
516 }
517 else {
518 factor = 1.0f;
519 }
520 if (factor >= 1.0f) {
522 }
523 else {
524 /* Ease in/out smoothing. */
525 factor = (3.0f * factor * factor - 2.0f * factor * factor * factor);
526 const bool use_autokey = ED_screen_animation_playing(wm);
527 view3d_smoothview_apply_with_interp(C, v3d, rv3d, use_autokey, factor);
528 }
529
530 if (RV3D_LOCK_FLAGS(rv3d) & RV3D_BOXVIEW) {
532 }
533
534 ED_region_tag_redraw(region);
535}
536
538 wmOperator * /*op*/,
539 const wmEvent *event)
540{
541 View3D *v3d = CTX_wm_view3d(C);
542 ARegion *region = CTX_wm_region(C);
543 RegionView3D *rv3d = static_cast<RegionView3D *>(region->regiondata);
544
545 /* Escape if not our timer. */
546 if (rv3d->smooth_timer == nullptr || rv3d->smooth_timer != event->customdata) {
548 }
549
551
552 return OPERATOR_FINISHED;
553}
554
555static void view3d_smooth_view_force_finish_ex(const Depsgraph *depsgraph,
557 wmWindow *win,
558 const Scene *scene,
559 View3D *v3d,
560 ARegion *region,
561 bContext *C_for_camera_lock)
562{
563 RegionView3D *rv3d = static_cast<RegionView3D *>(region->regiondata);
564 BLI_assert(rv3d && rv3d->sms);
565
566 view3d_smoothview_apply_and_finish_ex(wm, win, v3d, rv3d, C_for_camera_lock);
567
568 if (depsgraph) {
569 /* Force update of view matrix so tools that run immediately after
570 * can use them without redrawing first. */
571 ED_view3d_update_viewmat(depsgraph, scene, v3d, region, nullptr, nullptr, nullptr, false);
572 }
573}
574
576{
577 RegionView3D *rv3d = static_cast<RegionView3D *>(region->regiondata);
578 if (rv3d && rv3d->sms) {
579
580 Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
581 Scene *scene = CTX_data_scene(C);
583 wmWindow *win = CTX_wm_window(C);
584
585 view3d_smooth_view_force_finish_ex(depsgraph, wm, win, scene, v3d, region, C);
586 }
587}
588
591 wmWindow *win,
592 const Scene *scene,
593 View3D *v3d,
594 ARegion *region)
595{
596
597 /* NOTE(@ideasman42): Ideally we would *always* apply the camera lock.
598 * Failing to do so results in incorrect behavior when a user performs
599 * a camera-locked view-port manipulation & immediately enters local-view
600 * before the operation is completed.
601 * In this case the camera isn't key-framed when it should be.
602 *
603 * A generic solution that supports forcing modal operators to finish their
604 * work may be best, but needs to be investigated.
605 *
606 * It's worth noting this *is* a corner case, while not ideal,
607 * rarely happens unless a motivated users is trying to cause it to fail.
608 * Even when it does occur, it simply misses completing & auto-keying the action. */
609
610 RegionView3D *rv3d = static_cast<RegionView3D *>(region->regiondata);
611 if (rv3d && rv3d->sms) {
612 view3d_smooth_view_force_finish_ex(depsgraph, wm, win, scene, v3d, region, nullptr);
613 }
614}
615
617{
618 /* Identifiers. */
619 ot->name = "Smooth View";
620 ot->idname = "VIEW3D_OT_smoothview";
621
622 /* API callbacks. */
625
626 /* Flags. */
627 ot->flag = OPTYPE_INTERNAL;
628}
629
631{
632 MEM_SAFE_DELETE(rv3d->sms);
633}
634
636
637} // namespace blender
#define M_PI
#define RV3D_LOCK_FLAGS(rv3d)
#define VIEW3D_DIST_FALLBACK
Read Blender memory allocation and freeing.
#define C
Definition RandGen.cpp:29
#define ND_SPACE_VIEW3D
Definition WM_types.hh:571
#define NC_SPACE
Definition WM_types.hh:405
#define BLI_assert_msg(a, msg)
void camera(KernelGlobals &kg, const ShadingData &sd, float3 &outview, float &outdepth, float &outdist)
BMesh Iterators.
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)
UserDef U
Definition blender.cc:58
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)
Definition area.cc:681
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)
@ ID_TAG_DOIT
Definition DNA_ID.h:1029
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)
@ OPTYPE_INTERNAL
Definition WM_types.hh:210
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)
#define fabsf
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
eRegion_Type regiontype
eRegionView3D_Flag rflag
eRegionView3D_ViewAxisRoll view_axis_roll
struct ViewRender * view_render
struct wmTimer * smooth_timer
eRegionView3D_Persp persp
struct SmoothView3DStore * sms
eRegionView3D_View view
ListBaseT< ARegion > regionbase
ListBaseT< SpaceLink > spacedata
eRegionView3D_ViewAxisRoll org_view_axis_roll
struct Object * camera
View3DShading shading
bool(*) poll(bContext *C) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1165
wmOperatorStatus(*) invoke(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1141