godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.05k stars 65 forks source link

Automatically reimport Bitmap FontFiles after their textures are updated #9651

Open VideoGirlAi opened 2 weeks ago

VideoGirlAi commented 2 weeks ago

Describe the project you are working on

A dialogue-heavy game where I have several bitmap fonts, of which I am tweaking all the time in my image editor (which means reimporting into Godot).

Describe the problem or limitation you are having in your project

After editing an AngelCode bitmap FontFile's texture (for example, font.png), the texture is automatically re-imported into Godot 4 as expected. Yet, the actual FontFile .fnt resource doesn't update to correspond with this texture listed in the .fnt file (via file="font.png").

The only current solution is to manually open the Import tab for the .fnt file and click "Reimport" after every edit to its texture.

This is a regression from Godot 3; in Godot 3, a BitmapFont would automatically update, corresponding with its texture file.

Neither closing/reopening the scene nor restarting the editor fixes this. The only fix is a manual Reimport.

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

Like in Godot 3, having a bitmap font automatically update along with its texture would be great.

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

Perhaps a FontFile imported with the importer "font_data_bmfont" could be linked to its AngelCode "file" texture file, and whenever this "file" texture is reimported, so to is the FontFile reimported. This is only one idea though.

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

Not as far as I know.

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

For the convenience of the user, and fixing a regression from Godot 3. I have several bitmap fonts, and having to manually reimport them in Godot 4 on every edit, whereas I didn't have to in Godot 3, is undesirable.

EDIT: I'm not used to Github, so I'm unsure if this should have been in the "issues" page instead (in fact, it's where I thought I was when I posted this instead of "proposals"). I apologize.