echo "${group}"
}
+# Get duplicate from. Ex: "label:dup1-7 planXYZ,geometry..." will return 1
+# Arg1: line
+function get_dup_from()
+{
+ dup=$(echo "${1}" | grep -e "label:dup.*" | ${SED} "s/.*label:dup\([0-9]\+\)-.*,geometry.*/\1/g")
+ echo "${dup}"
+}
+
+# Get duplicate to. Ex: "label:dup1-7 planXYZ,geometry..." will return 7
+# Arg1: line
+function get_dup_to()
+{
+ dup=$(echo "${1}" | grep -e "label:dup.*" | ${SED} "s/.*label:dup[0-9]\+-\([0-9]\+\).*,geometry.*/\1/g")
+ echo "${dup}"
+}
+
print_usage()
{
echo "${PROG_NAME} -- Générateur de séquence d'images PNG à partir d'un fichier Photoshop (PSD)."
nf=$(get_frame_id "${l}")
ng=$(get_group_id "${l}")
+ dup_from=$(get_dup_from "${l}")
+ dup_to=$(get_dup_to "${l}")
+
+ # Also indicate a new frame, but to be copied from..to:
+ if [ x"${dup_from}" != x"" ]; then
+ nf=${dup_from}
+ fi
+
# Only change group if ng is set...
if [ x"${ng}" != x"" ]; then
if which ffmpeg 1> /dev/null 2>&1; then
${dest}/${group}-f${nf}.png
fi
+ if [ x"${dup_from}" != x"" ]; then
+ log_dbg " dup from: ${dup_from}"
+ log_dbg " dup to: ${dup_to}"
+
+ dup_start=$((${dup_from} + 1))
+ for w in $(seq ${dup_start} ${dup_to}); do
+ log_dbg "New frame ID: ${w} (duplicate)"
+
+ # Use symlink???
+ cp ${dest}/${group}-f${nf}.png ${dest}/${group}-f${w}.png
+ done
+ fi
+
files=""
oldnf="${nf}"
fi