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:
authorPhilipp Oeser <info@graphics-engineer.com>2021-09-27 12:54:25 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2021-09-27 12:54:25 +0300
commit5d5504d8a4b6ba5b56154ac50fea60b9c5576572 (patch)
tree47e852587d0b5ef7529d3f5b5173270a60091b19
parent69893ef27c9188916648adb84d5867f2d39c780e (diff)
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
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c7
1 files changed, 7 insertions, 0 deletions
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;
}