From adc8b899edfad2a254dd8e28b846bb7f2e6353c0 Mon Sep 17 00:00:00 2001 From: mmattmcw Date: Tue, 10 Aug 2021 19:01:45 -0400 Subject: [PATCH] Allow second argument to define frame to start on --- loop.sh | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/loop.sh b/loop.sh index ac4ea07..1dd8455 100644 --- a/loop.sh +++ b/loop.sh @@ -2,26 +2,33 @@ #field guide -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 +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 + 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 +i=0 #files in dir for svg in "${1}"*.svg ; do + let "i=i+1" + if [ "${2}" != "" ] && [ "${i}" != "${2}" ]; then + continue + fi filename=`basename "${svg}"` name=`echo "${filename}" | cut -d'.' -f1` num=`echo "${name}" | awk -F'_' '{print $(NF)}'` @@ -30,6 +37,7 @@ for svg in "${1}"*.svg ; do ax guides/guide_marks.svg number=`mktemp`.svg node ./numbers/ -n "${num}" -o "${number}" + ax "${number}" ax "${svg}" rm -f "${number}" bash position.sh reset