Skip to content

Add project settings for default importers#108928

Open
mlm-games wants to merge 1 commit intogodotengine:masterfrom
mlm-games:svg-importer-option
Open

Add project settings for default importers#108928
mlm-games wants to merge 1 commit intogodotengine:masterfrom
mlm-games:svg-importer-option

Conversation

@mlm-games
Copy link
Copy Markdown

@mlm-games mlm-games commented Jul 24, 2025

Closes godotengine/godot-proposals#12770.
Closes #108512

Doesn't import older files by default to maintain .import settings, could use the tools -> upgrade project files for that

image

Toggling it on and adding a svg file would import it as a SVGTexture else as a CompressedTexture2D

Production edit: Closes godotengine/godot-proposals#2500

@mlm-games mlm-games marked this pull request as ready for review July 24, 2025 11:10
@mlm-games mlm-games requested a review from a team July 24, 2025 11:10
@mlm-games mlm-games requested review from a team as code owners July 24, 2025 11:10
@KoBeWi KoBeWi added this to the 4.x milestone Jul 24, 2025
@mlm-games
Copy link
Copy Markdown
Author

mlm-games commented Jul 24, 2025

Only the mono linux editor says documentation is incomplete? Is it just a pipline problem because others don't seem cancelled..

@Ivorforce
Copy link
Copy Markdown
Member

Ivorforce commented Jul 24, 2025

Only the mono linux editor says documentation is incomplete? Is it just a pipline problem because others don't seem cancelled..

Some runners only test the build process, some do unit tests, and some do additional stuff like documentation checks. I think only the Linux Editor w/ Mono target checks the documentation.

Edit: My guess is, your GLOBAL_DEF is called in the wrong location. The docs seem to complain that your added setting does not exist, so it's not registered at the time it's checking.

@mlm-games mlm-games force-pushed the svg-importer-option branch from 080e14e to 048b4b0 Compare July 24, 2025 12:12
@mlm-games
Copy link
Copy Markdown
Author

Edit: My guess is, your GLOBAL_DEF is called in the wrong location. The docs seem to complain that your added setting does not exist, so it's not registered at the time it's checking.

Thanks for the ref, moved it to ProjectSettings (and removed some unneeded flags i used looking at others there, hadn't put it there initially because the filesystem/import settings were not present initially)

@mlm-games mlm-games force-pushed the svg-importer-option branch from 048b4b0 to 8e5ee5c Compare July 24, 2025 12:29
@mlm-games
Copy link
Copy Markdown
Author

Moved the setting doc lower according to linter

@Calinou
Copy link
Copy Markdown
Member

Calinou commented Jul 24, 2025

Note that there's a more generalized proposal requesting this for any format, not just SVG:

There's a salvageable PR implementing it:

@mlm-games
Copy link
Copy Markdown
Author

mlm-games commented Jul 25, 2025

Note that there's a more generalized proposal requesting this for any format, not just SVG:

* [Allow defining what importer to use for a given file extension godot-proposals#2500](https://github.com/godotengine/godot-proposals/issues/2500)

There's a salvageable PR implementing it:

* [Allow defining default importers per file extension #72848](https://github.com/godotengine/godot/pull/72848)

Have tried experimenting with it and can't seem to find a good ui position. It does work (changing a setting, for eg. svg, and adding a svg file causes it to be imported as svgtexture, haven't tested it for other file formats though)

image

@mlm-games mlm-games force-pushed the svg-importer-option branch from 8e5ee5c to bb736f9 Compare July 25, 2025 05:44
@mlm-games mlm-games requested a review from a team as a code owner July 25, 2025 05:44
@mlm-games
Copy link
Copy Markdown
Author

mlm-games commented Jul 25, 2025

FPushed the changes (changed the names of some due to it being confusing while handling importer-settings (named as settings initially) and default-importer-settings)

@mlm-games mlm-games force-pushed the svg-importer-option branch 2 times, most recently from b65f1d2 to a8d5645 Compare July 25, 2025 08:34
@KoBeWi

This comment was marked as resolved.

@mlm-games mlm-games force-pushed the svg-importer-option branch from a8d5645 to 1f12678 Compare July 29, 2025 01:14
@mlm-games
Copy link
Copy Markdown
Author

image

Made the changes (don't mind the tab names)

@KoBeWi
Copy link
Copy Markdown
Member

KoBeWi commented Jul 29, 2025

"Importer Defaults" tab should be first like before IMO.
Also "Default Importers" could be called "Extension Importers" or "Extension Defaults".

Comment thread core/io/resource_importer.cpp Outdated
Comment thread core/io/resource_importer.cpp Outdated
Comment thread editor/import/import_defaults_editor.cpp Outdated
Comment thread editor/import/import_defaults_editor.h Outdated
Comment thread editor/import/import_defaults_editor.h Outdated
Comment thread editor/import/import_defaults_editor.cpp Outdated
Comment thread editor/import/import_defaults_editor.cpp Outdated
Comment thread editor/import/import_defaults_editor.cpp Outdated
Comment thread editor/import/import_defaults_editor.h Outdated
Comment thread editor/import/import_defaults_editor.cpp
Comment thread editor/import/import_defaults_editor.cpp Outdated
Comment thread editor/import/import_defaults_editor.cpp Outdated
@mlm-games mlm-games force-pushed the svg-importer-option branch from ba9b48e to 28db963 Compare July 29, 2025 11:24
Comment thread editor/import/import_defaults_editor.cpp Outdated
Comment thread editor/import/import_defaults_editor.cpp Outdated
Comment thread editor/import/import_defaults_editor.cpp Outdated
@AThousandShips
Copy link
Copy Markdown
Member

Please use the batch commit function for suggestions in the future, to avoid noisy updates and a lot of extra runs of CI (you are a first time contributor right now so it doesn't clutter the runner, but later it would)

@mlm-games
Copy link
Copy Markdown
Author

Please use the batch commit function for suggestions in the future, to avoid noisy updates and a lot of extra runs of CI (you are a first time contributor right now so it doesn't clutter the runner, but later it would)

Um not sure where the function is, but will try to just make the changes locally in the editor and push all directly instead (from next time)

@AThousandShips
Copy link
Copy Markdown
Member

It's the button that says "add suggestion to batch"

@mlm-games
Copy link
Copy Markdown
Author

mlm-games commented Jul 29, 2025

It's the button that says "add suggestion to batch"

Oh... probably didn't notice it 😅

@mlm-games mlm-games force-pushed the svg-importer-option branch from a69fae1 to c37c50c Compare July 29, 2025 12:01
@mlm-games
Copy link
Copy Markdown
Author

mlm-games commented Jul 29, 2025

Made all the changes (hopefully), and renamed the tab to "Extension Defaults".

@mlm-games mlm-games force-pushed the svg-importer-option branch from c37c50c to a0f9416 Compare July 29, 2025 13:15
@mlm-games
Copy link
Copy Markdown
Author

Added the missing ones

Comment thread editor/import/import_defaults_editor.cpp
@KoBeWi KoBeWi modified the milestones: 4.x, 4.6 Jul 29, 2025
@KoBeWi KoBeWi changed the title Add a project setting to import files as SVGTexture by default Add project settings for default importers Jul 29, 2025
@mlm-games mlm-games force-pushed the svg-importer-option branch from a0f9416 to 0357556 Compare July 29, 2025 13:39
@mlm-games mlm-games force-pushed the svg-importer-option branch from 0357556 to 8b20531 Compare July 29, 2025 14:38
@fire fire moved this to Ready for review in Asset Pipeline Issue Triage Jul 29, 2025
@Repiteo Repiteo requested a review from akien-mga November 13, 2025 23:22
@Repiteo Repiteo modified the milestones: 4.6, 4.x Jan 25, 2026
@Repiteo Repiteo requested a review from a team as a code owner February 17, 2026 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Ready for review

Development

Successfully merging this pull request may close these issues.

Add a tool to upgrade existing imports of SVG resources to DPITexture Allow defining what importer to use for a given file extension

7 participants