1- #! /bin/bsh
1+ #! /bin/bash
2+
3+ # Build script for the uHbench
4+ # ============================
5+ #
6+ # This script is a helper tool to get the rendered files built in one go.
7+ # There is a pretty good chance this will not work on your system, but you can try ;)
8+ #
9+ # First, have all the right tools installed:
10+ # - BLender with Freestyle and Freestyle-SVG-exporter activated in your user.prefs
11+ # - Inkscape
12+ # - ImageMagick
13+ # - XMLStarlet
14+ #
15+ # Then run it with: sh build.sh
16+ # And watch the console for errors.
17+ # Complaints, suggestions or bitcoins, send them to julien [at] xuv.be
218
3- # SETTINGS
419
5- # This coresponds to the names used for the scenes in the .blend file. Oviously, odn't use space in your names.
20+ # SETTINGS
21+ # --------
22+ FILENAME=uhbench
23+ # This corresponds to the names used for the scenes in the .blend file. Oviously, don't use space in your names.
624STEPS=(step0 step1 step2 step3 step4 step5 step6 step7 step8)
725BUILD_DIR=build
826
27+
28+ # BLENDER rendering
29+ # -----------------
930for s in ${STEPS[@]}
1031do
1132 # Launch Blender render for selected scene
12- blender -b uhbench .blend -S ${s} --render-output //${BUILD_DIR} /${s} _ -f 1
33+ blender -b ${FILENAME} .blend -S ${s} --render-output //${BUILD_DIR} /${s} _ -f 1
1334
1435 # Remove extra "fills" in the SVG
1536 # This line should be removed once Freestyle-SVG-exporter handles toggling "Contour Fills" per lineset
2041echo " Cleaning up..."
2142rm ${BUILD_DIR} /* .png
2243
44+ # IMAGE rendering
45+ # ---------------
46+
2347# Generate a gif ;)
2448echo " Creating animated GIF..."
25- convert -delay 100 -loop 0 ${BUILD_DIR} /step* .svg uHbench-loop.gif
49+ convert -delay 100 -loop 0 ${BUILD_DIR} /step* .svg ${FILENAME} .gif
50+
51+ # Rendering the png, jpg and pdf
52+ echo " Rendering to PNG"
53+ inkscape -f ${FILENAME} .svg -e ${FILENAME} .png
54+ echo " Rendering to JPG"
55+ inkscape -f ${FILENAME} .svg --export-dpi 300 -e ${FILENAME} .jpg
56+ echo " Rendering to PDF"
57+ inkscape -f ${FILENAME} .svg --export-text-to-path -A ${FILENAME} .pdf
2658
27- echo " Done"
59+ echo " Done. "
0 commit comments