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.
  • Loading branch information
TechnoPorg committed Sep 2, 2021
1 parent 9d38ebd commit 1963c63
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 @@ -595,19 +595,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;
}

RenderingServer::get_singleton()->viewport_set_disable_2d(get_scene_root()->get_viewport_rid(), true);
RenderingServer::get_singleton()->viewport_set_disable_environment(get_viewport()->get_viewport_rid(), true);

Expand Down Expand Up @@ -970,6 +957,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 1963c63

Please sign in to comment.