From 177be9bd37e3dfa4d591eea3bb8ab14a17d06007 Mon Sep 17 00:00:00 2001 From: kobewi Date: Sat, 8 Apr 2023 00:01:29 +0200 Subject: Initialize editor values on first launch (cherry picked from commit b0eadcfbce3182373501ab24e62544032c4aec82) --- editor/plugins/canvas_item_editor_plugin.cpp | 1 + editor/plugins/node_3d_editor_plugin.cpp | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index e969f9ab30..4814b9ae3b 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -5407,6 +5407,7 @@ CanvasItemEditor::CanvasItemEditor() { singleton = this; set_process_shortcut_input(true); + clear(); // Make sure values are initialized. // Update the menus' checkboxes. callable_mp(this, &CanvasItemEditor::set_state).bind(get_state()).call_deferred(); diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index 27c97ff9f4..e443548550 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -7866,7 +7866,10 @@ void Node3DEditor::clear() { viewports[i]->reset(); } - RenderingServer::get_singleton()->instance_set_visible(origin_instance, true); + if (origin_instance.is_valid()) { + RenderingServer::get_singleton()->instance_set_visible(origin_instance, true); + } + view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_ORIGIN), true); for (int i = 0; i < 3; ++i) { if (grid_enable[i]) { @@ -8654,6 +8657,7 @@ void fragment() { _load_default_preview_settings(); _preview_settings_changed(); } + clear(); // Make sure values are initialized. } Node3DEditor::~Node3DEditor() { memdelete(preview_node); -- cgit v1.2.3