[Bf-blender-cvs] [5d5504d8a4b] master: 3DView: ability to cancel out of viewport roll

Philipp Oeser noreply at git.blender.org
Mon Sep 27 11:57:08 CEST 2021


Commit: 5d5504d8a4b6ba5b56154ac50fea60b9c5576572
Author: Philipp Oeser
Date:   Mon Sep 27 11:54:25 2021 +0200
Branches: master
https://developer.blender.org/rB5d5504d8a4b6ba5b56154ac50fea60b9c5576572

3DView: ability to cancel out of viewport roll

This adds the ability to cancel out of the roll using ESC or RMB
(which is not common for viewops -- but makes sense in the case of roll
I think). This resets the view as well as potential locked cameras to
the original orientations (but does not remove potential autokeys --
which no transform does on cancel btw.)

Maniphest Tasks: T89883

Differential Revision: https://developer.blender.org/D12582

===================================================================

M	source/blender/editors/space_view3d/view3d_edit.c

===================================================================

diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 564cdbf047b..615e29f574f 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -4408,6 +4408,13 @@ static int viewroll_modal(bContext *C, wmOperator *op, const wmEvent *event)
         break;
     }
   }
+  else if (ELEM(event->type, EVT_ESCKEY, RIGHTMOUSE)) {
+    /* Note this does not remove autokeys on locked cameras. */
+    copy_qt_qt(vod->rv3d->viewquat, vod->init.quat);
+    ED_view3d_camera_lock_sync(vod->depsgraph, vod->v3d, vod->rv3d);
+    viewops_data_free(C, op);
+    return OPERATOR_CANCELLED;
+  }
   else if (event->type == vod->init.event_type && event->val == KM_RELEASE) {
     event_code = VIEW_CONFIRM;
   }



More information about the Bf-blender-cvs mailing list