projects
/
fgen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
13302ad
)
Simplify some functions to accept label instead of line
author
Hugo Villeneuve
<hugo@hugovil.com>
Sat, 7 Oct 2023 15:48:02 +0000
(11:48 -0400)
committer
Hugo Villeneuve
<hugo@hugovil.com>
Sat, 7 Oct 2023 15:57:56 +0000
(11:57 -0400)
fgen.sh
patch
|
blob
|
history
diff --git
a/fgen.sh
b/fgen.sh
index
385e211
..
86e9b55
100755
(executable)
--- a/
fgen.sh
+++ b/
fgen.sh
@@
-57,11
+57,12
@@
function get_label()
echo "${token}"
}
echo "${token}"
}
-# Arg1: l
ine
+# Arg1: l
abel
function get_frame_id()
{
function get_frame_id()
{
- frame=$(echo "${1}" | grep -e "label:[0-9]\+" | ${SED} "s/.*label:\([0-9]\+\).*,geometry.*/\1/g")
- echo "${frame}"
+ local token
+ token=$(echo "${1}" | grep -e "^[0-9]\+" | ${SED} "s/^\([0-9]\+\).*/\1/g")
+ echo "${token}"
}
# Arg1: line
}
# Arg1: line
@@
-72,11
+73,12
@@
function get_scene_id()
echo "${token}"
}
echo "${token}"
}
-# Arg1: l
ine
+# Arg1: l
abel
function get_group_id()
{
function get_group_id()
{
- group=$(echo "${1}" | grep -e "label:groupe.*" | ${SED} "s/.*label:groupe-\(.*\),geometry.*/\1/g")
- echo "${group}"
+ local token
+ token=$(echo "${1}" | grep -e "^groupe" | ${SED} "s/^groupe-\(.*\)/\1/g")
+ echo "${token}"
}
# Arg1: group name
}
# Arg1: group name
@@
-87,20
+89,22
@@
function get_group_ref()
echo "${token}"
}
echo "${token}"
}
-# Get duplicate from. Ex: "
label:
dup1-7 planXYZ,geometry..." will return 1
-# Arg1: l
ine
+# Get duplicate from. Ex: "dup1-7 planXYZ,geometry..." will return 1
+# Arg1: l
abel
function get_dup_from()
{
function get_dup_from()
{
- dup=$(echo "${1}" | grep -e "label:dup.*" | ${SED} "s/.*label:dup\([0-9]\+\)-.*,geometry.*/\1/g")
- echo "${dup}"
+ local token
+ token=$(echo "${1}" | grep -e "^dup" | ${SED} "s/^dup\([0-9]\+\)-.*/\1/g")
+ echo "${token}"
}
}
-# Get duplicate to. Ex: "
label:
dup1-7 planXYZ,geometry..." will return 7
-# Arg1: l
ine
+# Get duplicate to. Ex: "dup1-7 planXYZ,geometry..." will return 7
+# Arg1: l
abel
function get_dup_to()
{
function get_dup_to()
{
- dup=$(echo "${1}" | grep -e "label:dup.*" | ${SED} "s/.*label:dup[0-9]\+-\([0-9]\+\).*,geometry.*/\1/g")
- echo "${dup}"
+ local token
+ token=$(echo "${1}" | grep -e "^dup" | ${SED} "s/^dup[0-9]\+-\([0-9]\+\).*/\1/g")
+ echo "${token}"
}
function generate_video()
}
function generate_video()
@@
-222,10
+226,11
@@
if [ ${trames} -eq 1 ]; then
scene=$(get_scene_id "${l}")
label=$(get_label "${l}")
p=$(get_pos "${l}")
scene=$(get_scene_id "${l}")
label=$(get_label "${l}")
p=$(get_pos "${l}")
- nf=$(get_frame_id "${l}")
- ng=$(get_group_id "${l}")
- dup_from=$(get_dup_from "${l}")
- dup_to=$(get_dup_to "${l}")
+
+ nf=$(get_frame_id "${label}")
+ ng=$(get_group_id "${label}")
+ dup_from=$(get_dup_from "${label}")
+ dup_to=$(get_dup_to "${label}")
# Also indicate a new frame, but to be copied from..to:
if [ x"${dup_from}" != x"" ]; then
# Also indicate a new frame, but to be copied from..to:
if [ x"${dup_from}" != x"" ]; then