animation/draw.sh

57 lines
1.1 KiB
Bash
Raw Normal View History

2021-08-07 16:14:59 +00:00
#!/bin/bash
2021-09-09 00:53:03 +00:00
if [[ "${1}" == "" ]]; then
echo "Please provide a directory as the first argument"
exit 1
fi
2021-08-07 16:14:59 +00:00
if [ "${2}" == "" ]; then
name=`basename "${1}"`
bash position.sh set
ax guides/guide_all.svg
number=`mktemp`.svg
node ./numbers/ -n "${name}" -o "${number}"
ax "${number}"
rm -f "${number}"
bash position.sh reset
echo "Are you ready to continue? (yes/no)"
read input
if [ "$input" != "n" ] && [ "$input" != "no" ]
then
echo "Starting with first frame..."
else
exit 1
fi
fi
2021-08-07 16:14:59 +00:00
i=0
2021-08-07 16:14:59 +00:00
#files in dir
for svg in "${1}"*.svg ; do
if [ "${2}" != "" ] && [ "${i}" != "${2}" ]; then
let "i=i+1"
continue
fi
2021-08-07 16:14:59 +00:00
filename=`basename "${svg}"`
name=`echo "${filename}" | cut -d'.' -f1`
num=`echo "${name}" | awk -F'_' '{print $(NF)}'`
echo "Drawing $svg file..."
2021-08-10 22:07:06 +00:00
bash position.sh set
ax guides/guide_marks.svg
2021-08-07 16:14:59 +00:00
number=`mktemp`.svg
node ./numbers/ -n "${num}" -o "${number}"
ax "${number}"
2021-08-10 22:55:13 +00:00
ax "${svg}"
2021-08-07 16:14:59 +00:00
rm -f "${number}"
2021-08-10 22:07:06 +00:00
bash position.sh reset
2021-08-07 16:14:59 +00:00
echo "Are you ready to continue? (yes/no)"
read input
if [ "$input" != "n" ] && [ "$input" != "no" ]
then
echo "Continuing with next frame..."
else
break
fi
done