godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.16k stars 97 forks source link

Make it possible to open projects in the editor if their bake data is not present on the filesystem (for version control usage) #11110

Open Calinou opened 1 day ago

Calinou commented 1 day ago

Describe the project you are working on

The Godot editor 🙂

Describe the problem or limitation you are having in your project

Currently, when you try to open a scene in the editor that has missing baked resource data, it won't open with a dependency error.

This is problematic in workflows where you add this baked data to your .gitignore. Such a workflow is often desired when you want to keep the VCS repository size as small as possible, particularly when using Git. Git's decentralized approach means that you have to clone the whole repository's history to be able to perform the full suite of Git operations, and Git LFS is expensive if you use a lot of storage.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Make it possible to open projects in the editor if their bake data is not present on the filesystem (for version control usage).

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

The following baked resource types should be ignored in dependency error dialogs:

`.gitignore` file to ignore baked file types ```gitignore # LightmapGIData (baked in LightmapGI) *.lmbake # NOTE: This may also ignore HDR panoramas if they are in OpenEXR format. # Consider preventing specific folders from being ignored using `!some_folder/*.exr` below `*.exr`. *.exr # VoxelGIData (baked in VoxelGI) *.VoxelGI_data.res # ArrayOccluder3D (baked in OccluderInstance3D) *.occ # GPUParticlesCollisionSDF3D's Texture *.GPUParticlesCollisionSDF3D_data.exr ```

Instead, the scene should open as usual with a warning printed in the editor. The paths to the missing baked resources (and their type) should be printed, along with the node paths requesting those resources if possible.

This should apply to running a project from a terminal as well, so you can test the project right away after opening it once in the editor. A warning should also be printed when the scene that requests missing baked resources is loaded.

The only restriction we may want to have in place is that you can't export a project with missing baked data, so that you can't accidentally export a project without baked lightmaps, for instance. This is particularly important on CI as headless exporting cannot bake data that requires a GPU (such as lightmaps) if this data wasn't committed to version control beforehand.

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

No, as this is built-in editor behavior that can't be overridden.

One way to circumvent this would be to generate dummy data in place of the file paths expected by your project, but it's a lot of work to do and would be best done using system-specific scripts as opposed to an editor plugin. It would also not ensure the user is warned when opening scenes with missing baked data (as the editor would see "valid" baked data, even if incorrect).

Is there a reason why this should be core and not an add-on in the asset library?

This is about improving the VCS ability of Godot projects.

passivestar commented 1 day ago

Also when you bake a lightmap on an imported gltf scene and then modify the scene and re-import godot will throw errors about missing objects. I think they should be ignored silently, perhaps this could be handled as a part of a solution to this proposal since these problems seem to be related