Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-01-13 16:47:33 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-01-13 17:14:03 +0400
commit4c9a3a53bd3154954bc2bcf73684b87a79332a71 (patch)
treeca297c79f831f46117e1638640a187e98ddbd01c /release/datafiles/blender_icons_update.py
parent08981f3a91a687efa8d28d308d6033e5a9e68b1f (diff)
UI Icons: store icons in git as uncompressed pixmaps (D196)
this allows for updating icons without committing a new PNG each time (which is inefficient with git). The data files are converted into a PNG at builds time and used just as they were before.
Diffstat (limited to 'release/datafiles/blender_icons_update.py')
-rwxr-xr-xrelease/datafiles/blender_icons_update.py54
1 files changed, 52 insertions, 2 deletions
diff --git a/release/datafiles/blender_icons_update.py b/release/datafiles/blender_icons_update.py
index 6f8f366544c..b4b772b6a85 100755
--- a/release/datafiles/blender_icons_update.py
+++ b/release/datafiles/blender_icons_update.py
@@ -3,10 +3,60 @@
# This script updates icons from the SVG file
import os
+def run(cmd):
+ print(" ", cmd)
+ os.system(cmd)
+
BASEDIR = os.path.abspath(os.path.dirname(__file__)) + os.sep
cmd = 'inkscape "%sblender_icons.svg" --export-dpi=90 --without-gui --export-png="%sblender_icons16.png"' % (BASEDIR, BASEDIR)
-os.system(cmd)
+run(cmd)
cmd = 'inkscape "%sblender_icons.svg" --export-dpi=180 --without-gui --export-png="%sblender_icons32.png"' % (BASEDIR, BASEDIR)
-os.system(cmd)
+run(cmd)
+
+
+# For testing it can be good to clear all old
+# rm ./blender_icons16/*.dat
+# rm ./blender_icons32/*.dat
+
+datatoc_icon_split_py = os.path.join(BASEDIR, "..", "..", "source", "blender", "datatoc", "datatoc_icon_split.py")
+
+# create .dat pixmaps (which are stored in git)
+cmd = (
+ "blender "
+ "--background -noaudio "
+ "--python " + datatoc_icon_split_py + " -- "
+ "--image=" + BASEDIR + "blender_icons16.png "
+ "--output=" + BASEDIR + "blender_icons16 "
+ "--output_prefix=icon16_ "
+ "--name_style=UI_ICONS "
+ "--parts_x 26 --parts_y 30 "
+ "--minx 3 --maxx 53 --miny 3 --maxy 8 "
+ "--minx_icon 2 --maxx_icon 2 --miny_icon 2 --maxy_icon 2 "
+ "--spacex_icon 1 --spacey_icon 1"
+ )
+run(cmd)
+
+cmd = (
+ "blender "
+ "--background -noaudio "
+ "--python " + datatoc_icon_split_py + " -- "
+ "--image=" + BASEDIR + "blender_icons32.png "
+ "--output=" + BASEDIR + "blender_icons32 "
+ "--output_prefix=icon32_ "
+ "--name_style=UI_ICONS "
+ "--parts_x 26 --parts_y 30 "
+ "--minx 6 --maxx 106 --miny 6 --maxy 16 "
+ "--minx_icon 4 --maxx_icon 4 --miny_icon 4 --maxy_icon 4 "
+ "--spacex_icon 2 --spacey_icon 2"
+
+ )
+run(cmd)
+
+os.remove(BASEDIR + "blender_icons16.png")
+os.remove(BASEDIR + "blender_icons32.png")
+
+# For testing, if we want the PNG of each image
+# ./datatoc_icon_split_to_png.py ./blender_icons16/*.dat
+# ./datatoc_icon_split_to_png.py ./blender_icons32/*.dat