diff options
Diffstat (limited to 'animate.sh')
-rwxr-xr-x | animate.sh | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/animate.sh b/animate.sh new file mode 100755 index 0000000..8d8afda --- /dev/null +++ b/animate.sh | |||
@@ -0,0 +1,35 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | SOURCEBASE=$1 | ||
4 | MAX=$2 | ||
5 | DELAY=$3 | ||
6 | SOURCESVG=`printf "%s.svg" $SOURCEBASE` | ||
7 | TARGETSVG=`printf "export/%s.png" $SOURCEBASE` | ||
8 | |||
9 | |||
10 | mkdir -p export_tmp | ||
11 | rm -f export_tmp/* | ||
12 | |||
13 | |||
14 | counter=1 | ||
15 | while [ $counter -le $MAX ] | ||
16 | do | ||
17 | source=`printf "%s%s.svg" $SOURCEBASE $counter` | ||
18 | file=`printf "export_tmp/%s.png" $counter` | ||
19 | inkscape -z -e $file $source | ||
20 | ((counter++)) | ||
21 | done | ||
22 | |||
23 | |||
24 | declare -a args | ||
25 | |||
26 | counter=1 | ||
27 | while [ $counter -le $MAX ] | ||
28 | do | ||
29 | file=`printf "export_tmp/%s.png" $counter` | ||
30 | args+=($file $DELAY) | ||
31 | ((counter++)) | ||
32 | done | ||
33 | |||
34 | apngasm -o $TARGETSVG ${args[@]} | ||
35 | rm -f export_tmp/* | ||