diff options
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_navigate.h')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_navigate.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/source/blender/editors/space_view3d/view3d_navigate.h b/source/blender/editors/space_view3d/view3d_navigate.h index fc7bc11295a..721476ace57 100644 --- a/source/blender/editors/space_view3d/view3d_navigate.h +++ b/source/blender/editors/space_view3d/view3d_navigate.h @@ -231,6 +231,14 @@ typedef struct V3D_SmoothParams { /** Alternate rotation center, when set `ofs` must be NULL. */ const float *dyn_ofs; + + /** When non-NULL, perform undo pushes when transforming the camera. */ + const char *undo_str; + /** + * When true use grouped undo pushes, use for incremental viewport manipulation + * which are likely to be activated by holding a key or from the mouse-wheel. + */ + bool undo_grouped; } V3D_SmoothParams; /** @@ -252,6 +260,22 @@ void ED_view3d_smooth_view(struct bContext *C, const V3D_SmoothParams *sview); /** + * Call before multiple smooth-view operations begin to properly handle undo. + * + * \note Only use explicit undo calls when multiple calls to smooth-view are necessary + * or when calling #ED_view3d_smooth_view_ex. + * Otherwise pass in #V3D_SmoothParams.undo_str so an undo step is pushed as needed. + */ +void ED_view3d_smooth_view_undo_begin(struct bContext *C, struct ScrArea *area); +/** + * Run after multiple smooth-view operations have run to push undo as needed. + */ +void ED_view3d_smooth_view_undo_end(struct bContext *C, + struct ScrArea *area, + const char *undo_str, + bool undo_grouped); + +/** * Apply the smooth-view immediately, use when we need to start a new view operation. * (so we don't end up half-applying a view operation when pressing keys quickly). */ |