-
-
Notifications
You must be signed in to change notification settings - Fork 21.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add --import
command-line flag
#90431
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very straightforward. That's in line with the kind of implementation I've often suggested over the years.
I thought it would require a bit more changes on the EditorFileSystem side but reusing first_scan
seems like a good option. The EFS code around it seems a bit convoluted in some parts, so I wonder if this will fully cover all use cases when doing e.g. multithreaded imported of some resource types. But testing should confirm that.
It would probably be a good idea to also allow this |
Tested successfully on Linux with a few demos, all without
|
I've been testing with godotengine/tps-demo and gdquest-demos/godot-4-3d-third-person-controller on Windows myself, although I had to add some sleeping to Alternatively you can on Windows also run it headless through WSL to reproduce the issue without any sleeping. |
I like the design of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving the feature.
Thanks! 🎉 |
For future reference, here's a script to test all demo projects one by one (run this at the repository clone root): GODOT_BINARY=path/to/godot.binary
git clean -dfxi
for demo in **/*.godot; do (echo $(dirname $demo) && cd $(dirname $demo) && "$GODOT_BINARY" --import && "$GODOT_BINARY" --quit-after 100); done I've tested all demos on Linux and they all work as expected with |
Add `--import` command-line flag
Cherry-picked for 4.2.2. |
Here are the |
Closes godotengine/godot-proposals#1362.
Supersedes #68461.
This adds a new command-line option called
--import
, the purpose if which is to launch the editor (headless or not) solely to import any non-imported resources and then quit, meaning it implies--editor
and--quit
.This also changes
--export-release
,--export-debug
and--export-pack
to imply--import
.This should hopefully remove the need for hacks such as
timeout 25s godot --editor
orgodot --editor --quit-after 1000
.This is fairly similar to #68461 in that it uses
EditorFileSystem::first_scan
as the condition variable by which to wait for, which seems to more or less guarantee that the scan thread has had time to finish and that any imports have gotten queued up and processed.This PR differs from #68461 in that it does not imply
--headless
. As talked about in that PR there may still potentially be issues with exporting from headless (although I haven't seen any showstoppers in my limited testing), so I figured it's best to leave that choice up to the user. Any such issues should in my opinion be considered separate anyway, and not block this seemingly straight-forward and useful addition.(I'll create a corresponding godotengine/godot-docs PR shortly.)