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:
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_utils.c')
-rw-r--r--source/blender/editors/space_view3d/view3d_utils.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/source/blender/editors/space_view3d/view3d_utils.c b/source/blender/editors/space_view3d/view3d_utils.c
index 99f8cbc975b..0d88824a784 100644
--- a/source/blender/editors/space_view3d/view3d_utils.c
+++ b/source/blender/editors/space_view3d/view3d_utils.c
@@ -689,6 +689,18 @@ bool ED_view3d_camera_lock_autokey(View3D *v3d,
return false;
}
+bool ED_view3d_camera_lock_undo_test(const View3D *v3d,
+ const RegionView3D *rv3d,
+ struct bContext *C)
+{
+ if (ED_view3d_camera_lock_check(v3d, rv3d)) {
+ if (ED_undo_is_memfile_compatible(C)) {
+ return true;
+ }
+ }
+ return false;
+}
+
/**
* 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.
@@ -699,16 +711,14 @@ bool ED_view3d_camera_lock_autokey(View3D *v3d,
static bool view3d_camera_lock_undo_ex(
const char *str, View3D *v3d, RegionView3D *rv3d, struct bContext *C, bool undo_group)
{
- if (ED_view3d_camera_lock_check(v3d, rv3d)) {
- if (ED_undo_is_memfile_compatible(C)) {
- if (undo_group) {
- ED_undo_grouped_push(C, str);
- }
- else {
- ED_undo_push(C, str);
- }
- return true;
+ if (ED_view3d_camera_lock_undo_test(v3d, rv3d, C)) {
+ if (undo_group) {
+ ED_undo_grouped_push(C, str);
+ }
+ else {
+ ED_undo_push(C, str);
}
+ return true;
}
return false;
}