-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
Improve handling of archives when installing assets #81358
Improve handling of archives when installing assets #81358
Conversation
84ee26b
to
86f5573
Compare
Would it be possible to modify what info the editor retries from the asset library to verify if the repo host is custom or not? I think that could potentially be a cleaner approach as then we would know for certain how it should be handled in either case. EDIT: This would not resolve issues with manual imports still, but it would help the checkbox be more accurate in assumptions for direct downloads. |
A custom host doesn't mean the asset doesn't follow this structure. And a custom host can still be used to point to a GitHub archive. Giving users control is, IMO, the best option. |
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.
@lyuma this was a big problem for our extensions and offers alternative for our problem of requiring the root to be project root and not directory addons root |
I'm not sure this PR would solve your issue. But after this little refactor I'm quite confident I can implement the "export to this folder" feature, so archives can be exported to places other than the root. |
Tested regarding #81311, and it works now. |
86f5573
to
639aba4
Compare
All concerns should be addressed, I think. |
Thanks! |
Fixes #81311. Closes #75712.
So #75712 has been a problem for quite some time now. As discussed, there are two key points:
And #81311 is a new finding, as far as I know. It seems some ZIP archives can skip the directory structure information and just contain record of files without intermediate folders. We fail at handling those gracefully.
So I set to fix these problems, and along the way I tweaks smaller details here and there. Here's a list of changes:
TTRN
for that last message).Most of it should be self explanatory. Regarding the checkbox, it tries to be smart. First of all, it's disabled if there is no single root folder in the asset archive. It only becomes available if your asset has a folder structure similar to what GitHub creates. This may backfire when your ZIP file contains, for example, only the
addons
folder — but if that becomes an issue we should be able to easily add an exception.I've decided to preserve the current dual logic, where assets installed through the AssetLib have their root folder skipped, while archives installed manually don't behave this way. However, this is no longer a hardcoded behavior. Instead, the checkbox is either checked by default or not, but can still be changed by the user.
Here's everything in action (note that the image loading error is related to the broken asset and is not a part of this PR):
godot.windows.editor.dev.x86_64_2023-09-05_23-53-18.mp4