bruvzg / gdsdecomp

Godot reverse engineering tools
MIT License
1.47k stars 147 forks source link

support svg file decomp #120

Open mauersu opened 1 year ago

mauersu commented 1 year ago

Resource Type

No response

Describe the problem or limitation you are having

log Did not rewrite import metadata for res://resources/xxx/xxx.svg

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

support svg

nikitalita commented 1 year ago

Unfortunately, it's impossible to recover SVG files used to import textures; they're converted to raster images upon import into the Godot project, and the vector data is not present in the imported texture.

I spent quite a bit of time seeing if there would be a way around this (e.g. hacking a SVG file to just contain a reference to an exported raster image), but Godot's SVG importer is limited and doesn't support any of the hacks that would allow this.

Additionally, automated vectorization of raster images with the available open-source tools is pretty dicey and, in my experience, you will almost always end up with something that doesn't look like the original. If you DO find an open-source tool that provides consistent accuracy, let me know.

GDRE Tools DOES export a PNG of the rasterized SVG texture in the .assets directory when it encounters them. If you are encountering errors because a script can't find the texture resource, a workaround for this would be to copy that back to the original directory and renaming all references to ".svg" to ".png"