summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2021-07-25 12:48:47 +0200
committerHugo Locurcio <hugo.locurcio@hugo.pro>2021-07-25 12:53:38 +0200
commit75dc0d18692ea2fc645ed4cb26fd63c4f799acf2 (patch)
tree60b607a8e189c0e534710433d466cad685c4dd0e
parent2a8a59eac0f1bbec83d4d04cac9f428487a0d738 (diff)
Add shortcut to toggle the 3D editor's camera preview
A Camera3D 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.
-rw-r--r--editor/plugins/node_3d_editor_plugin.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp
index b69d57188c..c66b97b423 100644
--- a/editor/plugins/node_3d_editor_plugin.cpp
+++ b/editor/plugins/node_3d_editor_plugin.cpp
@@ -4290,6 +4290,7 @@ Node3DEditorViewport::Node3DEditorViewport(Node3DEditor *p_spatial_editor, Edito
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();