Skip to content
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

Store per-project editor feature profile name in project.godot and automatically set corresponding profile as current #827

Open
arkology opened this issue May 12, 2020 · 6 comments

Comments

@arkology
Copy link

arkology commented May 12, 2020

Describe the project you are working on:
Multiple projects at the same time (2d/3d/plugin).

Describe the problem or limitation you are having in your project:
Currently it's annoying to switch the current feature profile when opening another project.
For example, I disable all 3d stuff when work with 2d only. And when I switch to another project with 3d stuff, I have to reset current profile. When I return to 2d project, I set 2d profile back. It's not very convenient and spends a little time.

Describe the feature / enhancement and how it helps to overcome the problem or limitation:
Per-project editor feature profile selection.

Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
Store current feature profile name in project settings in Editor->Run category as Project Feature Profile property.
Use the following algorithm for editor feature profile selection:
EditorProfile

For Manage Editor Feature Profiles instead of "Make Current" add "Make global default" and "Make Project default" buttons. "Make global default" will modify _default_feature_profile from editor_features file and set as project current profile is no "project default" selected.
"Make Project default" will have warning (?) with recommendations about usage with Git (for Git it will be better to store feature profile in project directory) and profile naming (if profile is stored in project directory and editor_feature_profiles/ folder already has profile with same name, user will need to manually delete this global feature profile if its necessary).
Also in profiles list instead of (current) flag (?) will be (global default) and (project default) flags - both are optional.

If this enhancement will not be used often, can it be worked around with a few lines of script?:

If this enhancement will not be used often

As often as custom editor feature profiles

can it be worked around with a few lines of script

It is possible to implement as plugin, but right no there are no global plugins. Having this as per-project plugin will be almost useless.

Is there a reason why this should be core and not an add-on in the asset library?:
Having this as per-project plugin will be almost useless because of usability reasons but still possible.

@Calinou Calinou changed the title Store current editor feature profile in project.godot and automatically set it Store current editor feature profile in project.godot and automatically set it Sep 19, 2021
@Frontrider
Copy link

It would make editor profiles viable for users who'd jump between 2D and 3D. I do not think it's reasonable to expose it to gdscript, unless we change it to a project setting instead of an editor setting, which could be a way to go.

@Calinou
Copy link
Member

Calinou commented Dec 30, 2022

A proof of concept could work as follows:

  • Add a Use as Project Default button to the editor feature profiles dialog, which creates a editor.profile file in the project root (next to project.godot). This is based on the currently selected profile.
  • When starting the editor, if no feature profile is set, editor.profile is used as the editor feature profile.
  • Add an editor setting Use Project Feature Profile (enabled by default). This can be disabled if you don't want to load project overrides when no feature profile is selected.

It could also be worth discussing whether projects could ship a top-level editor_feature_profiles/ folder with feature profiles that can be automatically listed in the feature profiles dialog. This would be similar to the functionality you can get with a top-level script_templates/ folder.

Editor feature profile code: https://github.com/godotengine/godot/blob/master/editor/editor_feature_profile.cpp

@Frontrider
Copy link

Seems good to me. Even better than using the project.godot file as now it is isolated.

@YuriSizov
Copy link
Contributor

Would editor.profile store a copy of the profile configuration? Does that mean it will no longer be shared and has to be edited on per project basis? I would prefer to have a shared profile that is used by default by some projects. So the choice of a profile is stored in the project, but the profile itself is stored with editor settings.

@Calinou
Copy link
Member

Calinou commented Dec 30, 2022

So the choice of a profile is stored in the project, but the profile itself is stored with editor settings.

Projects should be able to ship their own profiles somehow, even if the user hasn't installed them in advance. It's important to be able to git clone a project repository and be able to start working immediately.

I guess this could be accomplished by storing a suggested profile name in project.godot, while allowing projects to provide any number of feature profiles they wish using a editor_feature_profiles/ folder.

@arkology
Copy link
Author

@Calinou thanks for your proof-of-concept suggestion. I thought more about the specific details of a possible implementation and re-described them in the first post.

@arkology arkology changed the title Store current editor feature profile in project.godot and automatically set it Store current editor feature profile name in project.godot and automatically set corresponding profile as current Feb 17, 2023
@arkology arkology changed the title Store current editor feature profile name in project.godot and automatically set corresponding profile as current Store per-project editor feature profile name in project.godot and automatically set corresponding profile as current Feb 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants