Skip to content

Commit

Permalink
Improved the built script and updated the JPG, PNG and PDF to the las…
Browse files Browse the repository at this point in the history
…t version
  • Loading branch information
xuv committed Jun 5, 2015
1 parent 9b923c2 commit dd7acb5
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 6 deletions.
44 changes: 38 additions & 6 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,36 @@
#!/bin/bsh
#!/bin/bash

# Build script for the uHbench
# ============================
#
# This script is a helper tool to get the rendered files built in one go.
# There is a pretty good chance this will not work on your system, but you can try ;)
#
# First, have all the right tools installed:
# - BLender with Freestyle and Freestyle-SVG-exporter activated in your user.prefs
# - Inkscape
# - ImageMagick
# - XMLStarlet
#
# Then run it with: sh build.sh
# And watch the console for errors.
# Complaints, suggestions or bitcoins, send them to julien [at] xuv.be

# SETTINGS

# This coresponds to the names used for the scenes in the .blend file. Oviously, odn't use space in your names.
# SETTINGS
# --------
FILENAME=uhbench
# This corresponds to the names used for the scenes in the .blend file. Oviously, don't use space in your names.
STEPS=(step0 step1 step2 step3 step4 step5 step6 step7 step8)
BUILD_DIR=build


# BLENDER rendering
# -----------------
for s in ${STEPS[@]}
do
# Launch Blender render for selected scene
blender -b uhbench.blend -S ${s} --render-output //${BUILD_DIR}/${s}_ -f 1
blender -b ${FILENAME}.blend -S ${s} --render-output //${BUILD_DIR}/${s}_ -f 1

# Remove extra "fills" in the SVG
# This line should be removed once Freestyle-SVG-exporter handles toggling "Contour Fills" per lineset
Expand All @@ -20,8 +41,19 @@ done
echo "Cleaning up..."
rm ${BUILD_DIR}/*.png

# IMAGE rendering
# ---------------

# Generate a gif ;)
echo "Creating animated GIF..."
convert -delay 100 -loop 0 ${BUILD_DIR}/step*.svg uHbench-loop.gif
convert -delay 100 -loop 0 ${BUILD_DIR}/step*.svg ${FILENAME}.gif

# Rendering the png, jpg and pdf
echo "Rendering to PNG"
inkscape -f ${FILENAME}.svg -e ${FILENAME}.png
echo "Rendering to JPG"
inkscape -f ${FILENAME}.svg --export-dpi 300 -e ${FILENAME}.jpg
echo "Rendering to PDF"
inkscape -f ${FILENAME}.svg --export-text-to-path -A ${FILENAME}.pdf

echo "Done"
echo "Done."
Binary file modified uhbench.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified uhbench.pdf
Binary file not shown.
Binary file modified uhbench.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit dd7acb5

Please sign in to comment.