BuildSizeReport ​
Inherits: RefCounted
What the project weighs and where it could weigh less: size by kind of file and by folder, the largest files, files that are there twice, textures that are bigger than they need to be, sounds that could be smaller (stereo where the sound is positional, uncompressed where it is short, WAV where it is long), and the files nothing uses (see UsedAssets). It reads the files, the .import files and, when the project was imported, the size of the imported copies; it changes nothing. scan gives a Dictionary, to_markdown writes it as text.
Methods ​
Dictionary | scan( options: Dictionary = {} ) static |
Array[String] | always_include_setting() static |
String | kind_of( extension: String ) static |
String | import_value( import_text: String, key: String ) static |
Vector2i | png_size( path: String ) static |
Dictionary | wav_info( path: String ) static |
String | format_bytes( bytes: int ) static |
String | to_markdown( report: Dictionary ) static |
Constants ​
DictionaryKINDS ={intDEFAULT_TEXTURE_LIMIT =2048- A texture with a side longer than this is listed as oversizefloatLONG_SOUND_SECONDS =8.0- A sound this long (seconds) or longer should be Ogg Vorbis, not WAVArray[String]MONO_FOLDERS =["entity_voices", "voicelines", "voices", "motion", "impact", "/cast/", "/cas...- The folders of the audio library whose sounds are placed in the world or are short interface sounds: mono is enough (the engine mixes a positional sound down to mono anyway)floatKEEP_MONO =0.5- How much of a WAV is left (of its size) with each change; rough numbers from the Godot manual (QOA about 5 times smaller, Vorbis about 10 times)floatKEEP_QOA =0.2floatKEEP_VORBIS =0.1intSMALL_FILE =1024intLARGEST_COUNT =30intLIST_LIMIT =200
Method descriptions ​
Dictionary scan( options: Dictionary = {} ) ​
Scans the project. Options (all optional): folders (the folders to count, default assets and src), roots (the folders that are always loaded), judge (the folders whose unused files are listed, default assets), always_include, texture_limit, unused (false = skip the used-assets walk)
Array[String] always_include_setting() ​
The always include list of the project (a project setting)
String kind_of( extension: String ) ​
No description yet.
String import_value( import_text: String, key: String ) ​
The value of a key in the text of an .import file ("" when it is not there)
Vector2i png_size( path: String ) ​
The size of a PNG from its header (no need to decode it)
Dictionary wav_info( path: String ) ​
The channels, the sample rate and the length of a WAV file, from its header ({} when it is not a readable WAV)
String format_bytes( bytes: int ) ​
No description yet.
String to_markdown( report: Dictionary ) ​
The report as Markdown text (the lists are cut at 200 rows)