Skip to content

Add svg import conversion tool #108512

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mlm-games
Copy link

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

Closes godotengine/godot-proposals#12770.

This PR adds a new tool to the Project > Tools menu (currently titled: "Convert SVG Import Files from Texture2D to SVGTexture") . When run, it finds all of the svg files in the project and converts their importer to SVGTexture from Texture2D, causing the oversampling feature work for them.

image

Here is an adapted project where i had imported the editor icons used in the main scene to Texture2D
adapted_test_project.zip

The code in this PR is adapted from the "Upgrade Project Files..." tool (ProjectUpgradeTool in the source code, and the pr format has been adapted from the Add UID upgrade tool PR ).


Had initially thought of doing this for my project which had a lot of svg files that were still imported as CompressedTexture2Ds in 4.5-beta3 (makes sense, if using custom import settings that can't be used currently and do not want them being erased). I didn't have any such import settings so thought of making an tool that helps with the conversion...

@AThousandShips
Copy link
Member

Thanks for opening a pull request!

Feature pull requests should be associated to a feature proposal to justify the need for implementing the feature in Godot core. Please open a proposal on the Godot proposals repository (and link to this pull request in the proposal's body).

@mlm-games
Copy link
Author

Thanks for opening a pull request!

Feature pull requests should be associated to a feature proposal to justify the need for implementing the feature in Godot core. Please open a proposal on the Godot proposals repository (and link to this pull request in the proposal's body).

Oops, added it (sorry, is my first pr here; thought the pr used for reference just closed the issue)

@mlm-games
Copy link
Author

Fixed pre-commit lint

@mlm-games mlm-games closed this Jul 11, 2025
@mlm-games mlm-games force-pushed the svg_import_converter_tool branch from 2cd9046 to d7cc121 Compare July 11, 2025 09:38
@mlm-games mlm-games reopened this Jul 11, 2025
@fire
Copy link
Member

fire commented Jul 12, 2025

This feels like an gdscript addon but it would be cool to standardize importer to importer conversions with this as the first usage. Hmm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add tool to update legacy imports of svgs to the svgtexture format
3 participants