@@ -28,6 +28,93 @@ set -e
2828
2929THIS_DIR=$( cd -- " $( dirname -- " ${BASH_SOURCE[0]} " ) " & > /dev/null && pwd )
3030
31- # TODO: Write this script to match the Windows .bat equal.
31+ INKSCAPE_EXE=" inkscape"
32+
33+ OUTPUT_DIR=" ${THIS_DIR} "
3234
3335cd ${THIS_DIR}
36+
37+ # Export node PNG icons at 20 x 20 resolution, for use in the Outliner.
38+ #
39+ # 20 x 20 is the resolution expected by Maya's Outliner.
40+ OUT_RESOLUTION=20
41+ for i in edit/node/* .svg; do
42+ name=$( basename " ${i} " .svg)
43+ echo " -------------------------------------------------------------"
44+ echo " Input file: ${i} "
45+ echo " Output file: ${OUTPUT_DIR} /out_${name} .png"
46+
47+ ${INKSCAPE_EXE} \
48+ --without-gui \
49+ --export-area-page \
50+ --export-width=${OUT_RESOLUTION} \
51+ --export-height=${OUT_RESOLUTION} \
52+ --file=" ${i} " \
53+ --export-png=" ${OUTPUT_DIR} /out_${name} .png"
54+ done
55+
56+ # Export node plain SVG icons.
57+ OUT_RESOLUTION=20
58+ for i in edit/node/* .svg; do
59+ name=$( basename " ${i} " .svg)
60+ echo " -------------------------------------------------------------"
61+ echo " Input file: ${i} "
62+ echo " Output file: ${OUTPUT_DIR} /${name} .svg"
63+
64+ ${INKSCAPE_EXE} \
65+ --without-gui \
66+ --export-area-page \
67+ --file=" ${i} " \
68+ --export-plain-svg=" ${OUTPUT_DIR} /${name} .svg"
69+ done
70+
71+ # Export shelf PNG icons at 32 x 32 resolution.
72+ OUT_RESOLUTION=32
73+ for i in edit/shelf/* .svg; do
74+ name=$( basename " ${i} " .svg)
75+ echo " -------------------------------------------------------------"
76+ echo " Input file: ${i} "
77+ echo " Output file: ${OUTPUT_DIR} /${name} _${OUT_RESOLUTION} x${OUT_RESOLUTION} .png"
78+
79+ ${INKSCAPE_EXE} \
80+ --without-gui \
81+ --export-area-page \
82+ --export-width=${OUT_RESOLUTION} \
83+ --export-height=${OUT_RESOLUTION} \
84+ --file=" ${i} " \
85+ --export-png=" ${OUTPUT_DIR} /${name} .png"
86+ done
87+
88+ # Export shelf PNG icons at 48 x 48 resolution (150% scale).
89+ OUT_RESOLUTION=48
90+ for i in edit/shelf/* .svg; do
91+ name=$( basename " ${i} " .svg)
92+ echo " -------------------------------------------------------------"
93+ echo " Input file: ${i} "
94+ echo " Output file: ${OUTPUT_DIR} /${name} _150.png"
95+
96+ ${INKSCAPE_EXE} \
97+ --without-gui \
98+ --export-area-page \
99+ --export-width=${OUT_RESOLUTION} \
100+ --export-height=${OUT_RESOLUTION} \
101+ --file=" ${i} " \
102+ --export-png=" ${OUTPUT_DIR} /${name} _150.png"
103+ done
104+
105+ # Export shelf PNG icons at 64 x 64 resolution (200% scale).
106+ OUT_RESOLUTION=64
107+ for i in edit/shelf/* .svg; do
108+ name=$( basename " ${i} " .svg)
109+ echo " -------------------------------------------------------------"
110+ echo " Input file: ${i} "
111+ echo " Output file: ${OUTPUT_DIR} /${name} _200.png"
112+
113+ ${INKSCAPE_EXE} \
114+ --without-gui \
115+ --export-area-page \
116+ --export-width=${OUT_RESOLUTION} \
117+ --export-height=${OUT_RESOLUTION} \
118+ --file=" ${i} " \
119+ --export-png=" ${OUTPUT_DIR} /${name} _200.png"
120+ done
0 commit comments