Describe the project you are working on:
Not applicable.
Describe the problem or limitation you are having in your project:
Moving around project folder and renaming it resets everything about project's editor state, as a new editor_data\projects is generated based on path and name. This also makes it impossible to store that folder in VCS, which can be useful for personal projects.
Describe how this feature / enhancement will help you overcome this problem or limitation:
It is a common practice among programming software to store state for each project inside the project folder, in a file, like .editorconfig, or under a subfolder, like .idea, .vs, .git, .hg, etc. This makes project folder a fully contained environment to start working on the project.
Show a mock up screenshots/video or a flow diagram explaining how your proposal will work:
Not applicable.
Describe implementation detail for your proposal (in code), if possible:
There are two ways this can be implemented:
As a default behavior
.godot folder inside the project folder immediately.godot folder inside the project foldereditor_data\projects for a pre-existent folder in old formAs a project setting
editor_data\projects, and create the corresponding folder (I suggest setting the checkbox to TRUE by default)project.godot for setting and then look for the corresponding folderI understand, there might be a problem when opening the same project with different versions of Godot, as currently each Godot folder stores its own settings for each project. If this is important, some sanity checks must be implemented, when working with local editor folder.
If this enhancement will not be used often, can it be worked around with a few lines of script?:
No, it's not a part of user space.
Is there a reason why this should be core and not an add-on in the asset library?:
It's a part of internal editor logic.
Note that you can run Godot in a self-contained mode, but it only works per binary, not per project (this is more useful if you do depend on custom C++ modules to be compiled with your project).
Note that you can run Godot in a self-contained mode, but it only works per binary, not per project (this is more useful if you do depend on custom C++ modules to be compiled with your project).
Huh, I guess I am actually running it in self-contained mode, and I've had no idea. I use Godot via Steam, and it seems this is why self-contained mode exists in the first place.
As I understand, in non-self-contained mode Godot uses AppData or home directory instead of editor_data, but this still separates editor settings from the project folder. I guess, my initial proposal is partially incorrect as I assume that editor_data is the only place that Godot uses to store editor settings for projects, when in fact there are a couple of such places. This is undesirable either way, in my opinion. Though this branching behavior should be considered, if my proposal is implemented.
See also: https://github.com/godotengine/godot/issues/23368
Might be indeed worth making a single ignorable .godot folder and putting everything inside that.
So, it seems that moving an editor_data\projects\<path>_<md5> folder into a <project_root>\.godot\editor is a matter of just a couple of changes in editor\editor_settings.cpp. It is probably reasonable to create a .godot folder in ProjectDialog::ok_pressed method of editor\project_manager.cpp, the same place where project.godot file is created.
I think I can do it, but I need to know the following:
.godot folder in project root the default and only behavior going forward, or is it up to personal preference of developers?Personally, I believe, that it should be the only behavior. The only conflicting thing about this with the current workflow is a need to add .godot folder in VCS' ignore file. Which many already do for their IDEs and even .import folder.
As for existing projects, I think it is possible to migrate data, if one exists, in EditorSettings::create() when we check for folders.
In regards to @aaronfranke's suggestion, if this change is implemented, then the godotengine/godot#23368 can be addressed, but I would separate these two issues into separate PRs.
I've had my editor viewport get messed up as the camera position went into the millions and could not be snapped back. It took a while to find the settings hidden away in obscurely named, project specific folders under AppData. All project specific settings should be self contained inside the project folder.
Please add this, preferably as default behaviour.
// edit: thanks Calinou, it was indeed a vc problem.
@nicolasdiehl The list of singletons is stored in project.godot which is in the project folder. Make sure to commit changes in that file to version control. If it's not synchronized across machines, the issue must be coming from somewhere else.
So, should we do this now, since import and mono folder changes were merged?
Most helpful comment
See also: https://github.com/godotengine/godot/issues/23368
Might be indeed worth making a single ignorable
.godotfolder and putting everything inside that.