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