Skip to content

Commit

Permalink
Merge pull request #84570 from clayjohn/editor-headless-scan
Browse files Browse the repository at this point in the history
Scan the filesystem in the first frame when using headless mode
  • Loading branch information
YuriSizov committed Nov 7, 2023
2 parents a956f2f + 95fbb2e commit 3e7f638
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions editor/editor_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4633,6 +4633,14 @@ void EditorNode::_editor_file_dialog_unregister(EditorFileDialog *p_dialog) {
Vector<EditorNodeInitCallback> EditorNode::_init_callbacks;

void EditorNode::_begin_first_scan() {
// In headless mode, scan right away.
// This allows users to continue using `godot --headless --editor --quit` to prepare a project.
if (!DisplayServer::get_singleton()->window_can_draw()) {
OS::get_singleton()->benchmark_begin_measure("editor_scan_and_import");
EditorFileSystem::get_singleton()->scan();
return;
}

if (!waiting_for_first_scan) {
return;
}
Expand Down

0 comments on commit 3e7f638

Please sign in to comment.