2022-02-07 09:45:08 +11:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#
|
|
|
|
# how to run this mess in a batch style
|
|
|
|
#
|
|
|
|
|
|
|
|
|
2022-02-19 05:30:10 +11:00
|
|
|
INCFILE="WS/bloubs.inc"
|
2022-02-07 09:45:08 +11:00
|
|
|
TMPPNG="/dev/shm/bloubs7.png"
|
2022-02-19 05:30:10 +11:00
|
|
|
POVOPT="+Q9 +a -v -d -W1024 -H768 -WT2"
|
2022-02-07 09:45:08 +11:00
|
|
|
DDIR="frames"
|
2022-02-07 11:50:49 +11:00
|
|
|
LOGERR="log.error"
|
2022-02-07 09:45:08 +11:00
|
|
|
|
2022-02-17 01:59:42 +11:00
|
|
|
# --- put the work file in ramdisk
|
2022-02-10 05:51:42 +11:00
|
|
|
BLBS_IN="/dev/shm/in.blbs"
|
|
|
|
BLBS_OUT="/dev/shm/out.blbs"
|
|
|
|
|
2022-02-19 05:30:10 +11:00
|
|
|
NBIMG=1800
|
2022-02-09 04:56:51 +11:00
|
|
|
|
2022-02-07 09:45:08 +11:00
|
|
|
make all
|
|
|
|
err=$?
|
|
|
|
if [ $err -ne 0 ] ; then
|
2022-02-10 05:51:42 +11:00
|
|
|
echo 'make error code is = ' $err
|
2022-02-07 09:45:08 +11:00
|
|
|
exit 1
|
|
|
|
fi
|
2022-02-07 12:09:54 +11:00
|
|
|
|
2022-02-19 05:30:10 +11:00
|
|
|
printf "\n#declare NbImg = %d;\n" $NBIMG > WS/nbimg.inc
|
2022-02-09 04:56:51 +11:00
|
|
|
|
2022-02-07 09:45:08 +11:00
|
|
|
#
|
|
|
|
# first, we have to make a seminal buch of bloubs
|
2022-02-17 01:59:42 +11:00
|
|
|
# --> this function need to be parametrizable
|
2022-02-07 09:45:08 +11:00
|
|
|
#
|
2022-02-19 05:30:10 +11:00
|
|
|
./genbloubs ${BLBS_IN} 15
|
2022-02-07 09:45:08 +11:00
|
|
|
|
2022-02-09 04:56:51 +11:00
|
|
|
for idx in $(seq 0 $NBIMG)
|
2022-02-07 09:45:08 +11:00
|
|
|
do
|
|
|
|
|
|
|
|
echo "======== run passe $idx ========="
|
|
|
|
|
2022-02-10 05:51:42 +11:00
|
|
|
./exportbloubs ${BLBS_IN} | awk -f toinc.awk > $INCFILE
|
2022-02-07 09:45:08 +11:00
|
|
|
|
2022-02-07 11:50:49 +11:00
|
|
|
povray -Iscene.pov -K${idx} -O${TMPPNG} ${POVOPT} 2> $LOGERR
|
2022-02-08 12:53:49 +11:00
|
|
|
if [ 0 -ne $? ] ; then
|
|
|
|
tail -15 $LOGERR
|
|
|
|
sleep 30
|
|
|
|
else
|
|
|
|
grep "Trace Time" $LOGERR
|
|
|
|
fi
|
|
|
|
|
|
|
|
td=$(date +'%F %R:%S')
|
2022-02-11 20:23:13 +11:00
|
|
|
hi=$(printf "#%05d" $idx)
|
2022-02-19 05:30:10 +11:00
|
|
|
count=$(head -1 "WS/log.nb_bloubs")
|
|
|
|
|
2022-02-07 09:45:08 +11:00
|
|
|
PNG=$(printf "%s/%05d.png" ${DDIR} $idx)
|
|
|
|
|
|
|
|
convert ${TMPPNG} \
|
2022-02-11 20:23:13 +11:00
|
|
|
-font Courier-Bold \
|
2022-02-19 05:30:10 +11:00
|
|
|
-pointsize 16 \
|
2022-02-17 01:59:42 +11:00
|
|
|
-fill Orange \
|
2022-02-07 09:45:08 +11:00
|
|
|
-gravity south-east \
|
2022-02-10 05:51:42 +11:00
|
|
|
-annotate +15+10 "$td" \
|
|
|
|
-gravity south-west \
|
|
|
|
-annotate +15+10 "$hi" \
|
2022-02-19 05:30:10 +11:00
|
|
|
-fill Yellow \
|
|
|
|
-pointsize 32 \
|
|
|
|
-gravity north-east \
|
|
|
|
-annotate +15+10 "$count" \
|
2022-02-07 09:45:08 +11:00
|
|
|
$PNG
|
|
|
|
|
2022-02-07 11:50:49 +11:00
|
|
|
echo $PNG '[done]'
|
2022-02-07 09:45:08 +11:00
|
|
|
|
2022-02-10 05:51:42 +11:00
|
|
|
./movebloubs ${BLBS_IN} ${BLBS_OUT}
|
|
|
|
mv ${BLBS_OUT} ${BLBS_IN}
|
2022-02-07 11:50:49 +11:00
|
|
|
echo
|
2022-02-07 09:45:08 +11:00
|
|
|
|
2022-02-19 05:30:10 +11:00
|
|
|
sleep 15
|
2022-02-17 01:59:42 +11:00
|
|
|
|
2022-02-07 09:45:08 +11:00
|
|
|
done
|
|
|
|
|
2022-02-07 11:50:49 +11:00
|
|
|
rm $LOGERR
|
2022-02-07 09:45:08 +11:00
|
|
|
|
2022-02-09 10:42:32 +11:00
|
|
|
# XXX convert -delay 10 -resize 50% -colors 192 \
|
|
|
|
# XXX $DDIR/????[0]*.png foo.gif
|
2022-02-08 12:53:49 +11:00
|
|
|
|
2022-02-17 01:59:42 +11:00
|
|
|
nice ./encode.sh
|
2022-02-07 09:45:08 +11:00
|
|
|
|
|
|
|
|