-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Allow extracting asset library assets into subfolders #554
Comments
Wouldn't this break all resources within the extracted addon, especially considering the way references are currently saved as absolute |
@bojidar-bg The idea is for assets to reference There is still a discussion on whether to always use |
To be able to do this, we need to: Make the API send an asset slug and a normalized version of the asset author's usernameThis is so the editor knows where the asset should be installed. Users will have to define a slug If For existing assets, we can generate the slug automatically by lowercasing the asset name and replacing spaces and other special characters with dashes. On top of that, the asset slug system will make it possible for third parties to create command line applications to install assets.
|
Should be easy. I think this might be the starting point. Is someone working on this? If not, then I could send a PR. |
As far as I know, no. Go ahead 🙂 |
@aaronfranke, could you take a look at godotengine/godot#43734? |
I don't like the idea of being able to install addons everywhere. There is a reason the In my projects I put installed addons into To get to your initial problem:
This can be solved by having an |
Unfortunately, doing so would break many existing assets which don't follow this convention. |
It would be an easy change: In the download menu only things inside |
I've thought about doing that, but I'm still worried about breaking user expectations and having to deal with issue reports because dozens of assets will be "broken" out of the box until their author updates them. |
@Calinou It can be done in Godot 4.0 and break compatibility. Asset creators will have to update their assets anyway. |
For 4.0, we'll probably remove the recommendation for add-ons to be stored in the Keeping the current repository structure and checking only the |
Will forcing addons to install into res://addons prevent them from adding script_templates? (Example asset: |
If I follow correctly, this new pattern means an easier time for users installing from the AssetLib from within Godot. Like before, they cannot change the destination directory so scene references work, but now they shouldn't have conflicts for top-level files. However, for manual installs it's still possible to make path name mistakes? If an addon is |
@idbrii if you are asking about my proposed solution then no to both. Addons will have an optional metadata telling Godot where to extract it to on an opt-in basis as to not break compatibility with 3.x. This way, old addons will still work and new addons won't need the "skeleton" paths. |
I was thinking about Calinou's 4.x plan. If 4.x doesn't allow addons to install outside of the addons folder, then are there other changes necessary (like searching for script_templates inside addons)? |
Wouldn't it be the easiest to have a flat folder structure in the plugin's git repo? So basically no |
Whatever folder structure ends up preferred, it's nigh impossible to enforce it. |
It's currently mandatory, but this proposal aims to make this kind of packaging redundant for add-ons (all files would be in the repository's top-level and automatically scoped to |
This could easily be implemented without breaking compat tbh |
Indeed, we can detect the repository structure when installing an asset based on the existence of certain files/folders. |
@atirut-w That would be welcome, but it's not a high priority, so it will depend on if a contributor shows up to do it. |
Why move it to the 5.0 milestone then? |
What about examples? I'm using Yet Another Behavior Tree which has quite useful examples in a separate folder at the root. It'd be nice to still be able to download them. I see a few ways: a. examples are considered outside the add-on and can optionally be imported at the root. Since examples folder would be besides the addons folder, it is immediately visible in the import hierarchy, you can toggle them depending on whether you need them or not. I think that b. would be the most simple, and as it gets standardized, users will learn to uncheck examples for a lightweight import, or just download them, test them and remove them from disk once they are done. |
OK, this gives us flexibility for Asset Library installs, but how do we tackle install as git submodules? (I come from godotengine/godot#18131 which suggested to work with pure root repo to solve this, but the idea was apparently not retained because it required devs to change their repo structure) I've tried it again on 4.1, and when a project.godot file is present and you install the repo as submodule, the whole folder is ignored. @aaronfranke you said you were installing https://github.com/aaronfranke/GodotExtraMath as submodule, how does this work despite the project.godot file? Are C# projects different from GDScript ones? For now, for submodules, I must either: It seems that only #1205 is still tackling this issue: it suggests full support of sub-projects, which means project.godot files wouldn't be an issue anymore and we'd be able to scan such add-on folders installed as git submodule (although in practice a given project will only care about what happens inside its own addons subfolder). Still not the ideal addons/[addon-name] unified structure as we'd have Asset Library installs under addons/[addon-name] vs git submodule installs under [git-submodule-repo]/addons/[addon-name] but acceptable (it's not a bad idea to distinguish add-ons we know we can edit vs read-only anyway). I suppose I'll just follow #1205 from here, but I wanted to stress this because the custom addon repo/submodule talk kinda got lost in the process. |
@hsandt I changed the structure of that repo to fit in better with Godot's asset library. |
For the benefit of anyone else that arrives here trying to do this with a submodule for a C# addon: you may get errors if the git submodule is within your godot project directory, even if there is a <ItemGroup>
<Content Remove="external\**" />
<Compile Remove="external\**" />
<EmbeddedResource Remove="external\**" />
<None Remove="external\**" />
</ItemGroup> I'm a C# newb, but I assume the C# project is simply building everything in the project directory with a |
Addons aren't ready for them, if I had symlinks maybe it would work. See this: godotengine/godot-proposals#554
Hey guys, bumping this thread because it seems to be the most relevant one for the issue. As a summary:
Workarounds:
Fix Suggestion:
If anyone is aware of a workaround that would allow me to have multiple addons in the same project please let me know. Right now, I have several addons that depend on each other. I would like to have them in the same project but the README.md and LICENSE would conflict, as well as the git repos for each addon fighting over the root project directory. For now I will look for a way to unpublish the addons and if anyone wants them, they can get them from github and manually extract into /addons. |
Describe the project you are working on:
GitHub repo: https://github.com/aaronfranke/GodotExtraMath
AssetLib page: https://godotengine.org/asset-library/asset/408
Describe the problem or limitation you are having in your project:
In my own private projects, I have this repository added as a Git submodule. This allows me to easily update the library in my projects.
The problem or limitation I am facing is that the same directory structure does not work well when published on the asset library. When an asset is downloaded from the asset library from within the Godot editor, it always places everything in the project's root directory.
Describe the feature / enhancement and how it helps to overcome the problem or limitation:
The proposal is to allow specifying a subfolder that the asset should be extracted into. This could either be specified by the user or by the asset creator, though it would probably make more sense to have the asset creator specify the location in case scripts depend on a specific file path.
This means that it would be possible for asset library assets to either be installed through the asset library, or to be installed by adding a Git submodule, without changing the directory structure (something that currently works on the asset library, added as a submodule in the addons folder, would currently have a path like
res://addons/my_plugin/addons/my_plugin/plugin.cfg
).Bonus upside: If all the files were extracted into subfolders, then we wouldn't have to worry about README and LICENSE files from different assets all competing to be in the project's root directory (since in a GitHub repository, these files are normally placed in the root directory).
Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
For whatever files are extracted, put them in a subfolder based on a specified
plugin_path
:Where
plugin_path
would be something like"addons/my_plugin"
.Or maybe we could force assets to go into the
addons/
folder:Where
plugin_name
would be"my_plugin"
.If this enhancement will not be used often, can it be worked around with a few lines of script?:
It's not a matter of scripting, it's a matter of convenience and choice, and also a matter of not polluting the root directory with README/etc files.
Is there a reason why this should be core and not an add-on in the asset library?:
Uh... well, these are already add-ons in the asset library 😛
Bugsquad edit (keywords for easier searching): install, installing
The text was updated successfully, but these errors were encountered: