From ba91c37efece58710fae62d65e9e71e9ecbd20c6 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Sun, 25 Jul 2021 12:50:51 +0200 Subject: [PATCH] Add shortcut to toggle the 3D editor's camera preview A Camera node still has to be selected to initially enable camera preview, but another node can then be selected and the preview can be disabled by pressing the shortcut key again. --- editor/plugins/spatial_editor_plugin.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index abee01551b3..bd8e1e189c7 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -3910,6 +3910,7 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed preview_camera = memnew(CheckBox); preview_camera->set_text(TTR("Preview")); + preview_camera->set_shortcut(ED_SHORTCUT("spatial_editor/toggle_camera_preview", TTR("Toggle Camera Preview"), KEY_MASK_CMD | KEY_P)); vbox->add_child(preview_camera); preview_camera->set_h_size_flags(0); preview_camera->hide();