Skip to content

Commit

Permalink
Allow using the 3D editor's View menu while previewing a camera
Browse files Browse the repository at this point in the history
This is already allowed when using cinematic preview, but not
when previewing a Camera3D the usual way.

Many operations from the View menu still work while previewing
a camera, such as switching between debug draw modes and toggling
information panes.
  • Loading branch information
Calinou committed Jul 1, 2021
1 parent 7ee419f commit fab3d13
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions editor/plugins/node_3d_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3254,14 +3254,12 @@ void Node3DEditorViewport::_toggle_camera_preview(bool p_activate) {
if (!preview) {
preview_camera->hide();
}
view_menu->set_disabled(false);
surface->update();

} else {
previewing = preview;
previewing->connect("tree_exiting", callable_mp(this, &Node3DEditorViewport::_preview_exited_scene));
RS::get_singleton()->viewport_attach_camera(viewport->get_viewport_rid(), preview->get_camera()); //replace
view_menu->set_disabled(true);
surface->update();
}
}
Expand Down Expand Up @@ -3508,7 +3506,6 @@ void Node3DEditorViewport::set_state(const Dictionary &p_state) {
previewing = Object::cast_to<Camera3D>(pv);
previewing->connect("tree_exiting", callable_mp(this, &Node3DEditorViewport::_preview_exited_scene));
RS::get_singleton()->viewport_attach_camera(viewport->get_viewport_rid(), previewing->get_camera()); //replace
view_menu->set_disabled(true);
surface->update();
preview_camera->set_pressed(true);
preview_camera->show();
Expand Down

0 comments on commit fab3d13

Please sign in to comment.