Can you get a file's import settings in GDScript?

Godot Version

4.3

Question

Is there a way to get an imported file’s import settings (specifically I need SVG Scale) from GDScript?

I managed to figure out a way, this function does exactly what I want.

func get_import_scale(file: String):
	var ImportSettings: ConfigFile = ConfigFile.new()
	ImportSettings.load(file+".import")
	return ImportSettings.get_value("params","svg/scale")

The import settings are stored in a .import file next to the main file, and these are just config files using the configfile format, so the configfile class has the functions needed to read it and fetch the desired values.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.