echo "${token}"
}
+# Arg1: line
+function get_group_id()
+{
+ group=$(echo "${1}" | grep -e "label:groupe.*" | ${SED} "s/.*label:groupe-\(.*\),geometry.*/\1/g")
+ echo "${group}"
+}
+
print_usage()
{
echo "${PROG_NAME} -- Générateur de séquence d'images PNG à partir d'un fichier Photoshop (PSD)."
nf=""
oldnf=""
files=""
+ group=""
while read l; do
scene=$(get_scene_id "${l}")
label=$(get_label "${l}")
p=$(get_pos "${l}")
nf=$(get_frame_id "${l}")
+ ng=$(get_group_id "${l}")
+
+ # Only change group if ng is set...
+ if [ x"${ng}" != x"" ]; then
+ if which ffmpeg 1> /dev/null 2>&1; then
+ if [ -f ${dest}/${group}-f1.png ]; then
+ # Conversion vidéo:
+ ffmpeg ${FFMPEG_OPTS} -r ${fps} -start_number 1 -i ${dest}/${group}-f%d.png ${dest}/${group}.mp4
+ fi
+ fi
+
+ group="${ng}"
+ log_dbg "New group: ${ng}"
+
+ nf=""
+ oldnf=""
+ files=""
+
+ # Skip image from group ID...
+ continue
+ fi
log_dbg "Layer ${scene}"
log_dbg " nom: ${label}"
fi
log_dbg "New frame ID: ${nf}"
- convert -colorspace sRGB -page +0+0 ${dest}/background.png ${files} -background none -layers merge ${dest}/f${nf}.png
+ convert -colorspace sRGB -page +0+0 ${dest}/background.png ${files} -background none -layers merge ${dest}/${group}-f${nf}.png
files=""
oldnf="${nf}"
fi
done <${layers}
fi
-
-if which ffmpeg 1> /dev/null 2>&1; then
- # Conversion vidéo:
- ffmpeg ${FFMPEG_OPTS} -r ${fps} -start_number 1 -i ${dest}/f%d.png ${dest}/sequence.mp4
-fi