Small "optimize.py" fix, and add instructions for icon optimization in "README.md"

This commit is contained in:
Michael Alexsander Silva Dias
2018-10-17 14:04:43 -03:00
parent 738e64a6d7
commit a101ffb3a8
2 changed files with 11 additions and 5 deletions

View File

@@ -20,6 +20,14 @@
- **`wallpapers`**: Official or fan-made wallpapers.
- **`websites`:** Everything related to Godot's Web presence or communities.
## Icon optimization
Editor icons must be first optimized before being added to the engine, to do so:
- Add them to the "/engine/icons/svg" folder.
- Run the "optimize.py" script (you must have `scour` installed).
The optimized icons will be generated in the "/engine/icons/optimized" folder.
## License
Unless otherwise specified, files contained in this repository are licensed

View File

@@ -1,6 +1,5 @@
# this is a very quick-n-dirty script to optimize SVGS and generate
# This is a very quick-n-dirty script to optimize SVGS and generate
# darker variations for white themes.
#
import os
from os import listdir, mkdir
@@ -95,7 +94,6 @@ scour_options = " ".join([
"--indent=none",
"--strip-xml-prolog",
"--remove-descriptive-elements",
"--enable-comment-stripping"
])
@@ -142,7 +140,7 @@ old_files = set(hashes.keys())
new_files = set(new_hashes.keys())
files_to_remove = old_files - new_files
for rfile in files_to_remove:
print("removing deprecated file: %s" % rfile)
print("Removing deprecated file: %s" % rfile)
# remove the actual files
if isfile('%s/%s.svg' % (out_path, rfile)):
os.remove('%s/%s.svg' % (out_path, rfile))
@@ -151,5 +149,5 @@ for rfile in files_to_remove:
with open("hashes", "w") as f:
for (k,v) in new_hashes.items():
for (k, v) in new_hashes.items():
f.write("%s %s\n" % (k, v))