Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPratik Borhade <PratikPB2123>2022-08-05 08:53:04 +0300
committerCampbell Barton <campbell@blender.org>2022-08-06 05:57:06 +0300
commitbefe38fe1dfbbdac9ed9ef61853800426e5966c5 (patch)
treef76bb31b2ac108a33e4200262909f0e9d0ae4202 /source/blender/editors/include
parent74f983738ab47ccc393885d31ccdb0dcdf898bef (diff)
Fix T92099: No undo when moving viewport with camera locked to view
Supports undo step generation while navigating in locked camera view. NDOF & track-pad navigation are not included for now. Actions that uses smooth view can be supported but are outside the scope of this change, includes undo push for: - VIEW3D_OT_view_pan - VIEW3D_OT_dolly - VIEW3D_OT_fly - VIEW3D_OT_move - VIEW3D_OT_rotate - VIEW3D_OT_walk - VIEW3D_OT_zoom Reviewed by: campbellbarton Ref D15345
Diffstat (limited to 'source/blender/editors/include')
-rw-r--r--source/blender/editors/include/ED_view3d.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h
index 0298983ed26..931bb7be8bf 100644
--- a/source/blender/editors/include/ED_view3d.h
+++ b/source/blender/editors/include/ED_view3d.h
@@ -1196,6 +1196,28 @@ bool ED_view3d_camera_lock_autokey(struct View3D *v3d,
void ED_view3d_lock_clear(struct View3D *v3d);
+/**
+ * Create an undo step when the camera is locked to the view.
+ * \param str: The name of the undo step (typically #wmOperatorType.name should be used).
+ *
+ * \return true when the call to push an undo step was made.
+ */
+bool ED_view3d_camera_lock_undo_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.
+ *
+ * \note use for actions that are likely to be repeated such as mouse wheel to zoom,
+ * where adding a separate undo step each time isn't desirable.
+ */
+bool ED_view3d_camera_lock_undo_grouped_push(const char *str,
+ View3D *v3d,
+ struct RegionView3D *rv3d,
+ struct bContext *C);
+
#define VIEW3D_MARGIN 1.4f
#define VIEW3D_DIST_FALLBACK 1.0f