Selaa lähdekoodia

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.
Hugo Locurcio 4 vuotta sitten
vanhempi
commit
75dc0d1869
1 muutettua tiedostoa jossa 1 lisäystä ja 0 poistoa
  1. 1 0
      editor/plugins/node_3d_editor_plugin.cpp

+ 1 - 0
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();