Skip to content

Commit

Permalink
Load assets before enabling editor plugins
Browse files Browse the repository at this point in the history
Moves the code for enabling plugins from NOTIFICATION_READY to after the first scan has been completed.

(cherry picked from commit 1963c63)
  • Loading branch information
TechnoPorg authored and akien-mga committed Sep 21, 2021
1 parent a259112 commit 55f9ae3
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions editor/editor_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -485,19 +485,6 @@ void EditorNode::_notification(int p_what) {
} break;

case NOTIFICATION_READY: {
{
_initializing_addons = true;
Vector<String> addons;
if (ProjectSettings::get_singleton()->has_setting("editor_plugins/enabled")) {
addons = ProjectSettings::get_singleton()->get("editor_plugins/enabled");
}

for (int i = 0; i < addons.size(); i++) {
set_addon_plugin_enabled(addons[i], true);
}
_initializing_addons = false;
}

VisualServer::get_singleton()->viewport_set_hide_scenario(get_scene_root()->get_viewport_rid(), true);
VisualServer::get_singleton()->viewport_set_hide_canvas(get_scene_root()->get_viewport_rid(), true);
VisualServer::get_singleton()->viewport_set_disable_environment(get_viewport()->get_viewport_rid(), true);
Expand Down Expand Up @@ -849,6 +836,18 @@ void EditorNode::_sources_changed(bool p_exist) {
load_scene(defer_load_scene);
defer_load_scene = "";
}

// Only enable addons once resources have been imported
_initializing_addons = true;
Vector<String> addons;
if (ProjectSettings::get_singleton()->has_setting("editor_plugins/enabled")) {
addons = ProjectSettings::get_singleton()->get("editor_plugins/enabled");
}

for (int i = 0; i < addons.size(); i++) {
set_addon_plugin_enabled(addons[i], true);
}
_initializing_addons = false;
}
}

Expand Down

0 comments on commit 55f9ae3

Please sign in to comment.