Skip to content

Commit 6995be0

Browse files
author
arch
committed
improve linux install
1 parent ab7a345 commit 6995be0

3 files changed

Lines changed: 62 additions & 24 deletions

File tree

contrib/Installer/assets/main.lua

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,13 @@ function update(delta)
253253
import_funscript_generator_result()
254254
end
255255
if math.fmod(updateCounter, 1000) == 1 then
256-
local f = io.open("C:/Temp/funscript_editor.log")
256+
local logfile = ""
257+
if platform == "Windows" then
258+
logfile = "C:/Temp/funscript_editor.log"
259+
else
260+
logfile = "/tmp/funscript_editor.log"
261+
end
262+
local f = io.open(logfile)
257263
if f then
258264
logfileExist = true
259265
f:close()
@@ -297,12 +303,19 @@ function gui()
297303
end
298304
end
299305

300-
-- if logfileExist then
301-
-- ofs.SameLine()
302-
-- if ofs.Button("Open Log") then
303-
-- processHandleLogFile = ofs.CreateProcess("notepad.exe", "C:/Temp/funscript_editor.log")
304-
-- end
305-
-- end
306+
if logfileExist then
307+
if platform == "Windows" then
308+
-- ofs.SameLine()
309+
-- if ofs.Button("Open Log") then
310+
-- processHandleLogFile = ofs.CreateProcess("notepad.exe", "C:/Temp/funscript_editor.log")
311+
-- end
312+
else
313+
ofs.SameLine()
314+
if ofs.Button("Open Log") then
315+
processHandleLogFile = ofs.CreateProcess("/usr/bin/xdg-open", "/tmp/funscript_editor.log")
316+
end
317+
end
318+
end
306319

307320
ofs.Separator()
308321
ofs.Text("Post-Processing:")

contrib/OpenFunscripter/openfunscripter_setup_linux.sh

Lines changed: 40 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,50 +4,75 @@ if command -v apt; then
44
sudo apt install -y cmake build-essential libmpv-dev libglvnd-dev libxext-dev make git gcc g++ cmake libmpv-dev libatlas-base-dev
55
fi
66

7-
if [ -d ./OFS ]; then
8-
echo "OpenFunscripter Source already downloaded"
9-
pushd OFS
7+
OFS_DIR="$HOME/.local/share/OFS/application"
8+
9+
if [ -d $OFS_DIR ]; then
10+
echo ">> OpenFunscripter Source already downloaded (Updating...)"
11+
pushd $OFS_DIR
1012
git pull
1113
git submodule update
1214
else
13-
git clone https://github.com/OpenFunscripter/OFS.git
14-
pushd OFS
15+
mkdir -p `dirname $OFS_DIR`
16+
echo ">> Clone OpenFunscripter Source"
17+
git clone https://github.com/OpenFunscripter/OFS.git $OFS_DIR
18+
pushd $OFS_DIR
1519
git submodule update --init
16-
pushd lib/EASTL
20+
pushd $OFS_DIR/lib/EASTL
1721
git submodule update --init
1822
popd
19-
echo "OpenFunscripter Source downloaded to ./OFS"
23+
echo ">> OpenFunscripter Source downloaded to $OFS_DIR"
2024
fi
2125

22-
echo "build OFS"
26+
echo ">> Build OFS"
2327
rm -rf build
2428
mkdir -p build
2529
pushd build
2630
cmake ..
2731
make -j$(expr $(nproc) \+ 1)
28-
popd
29-
popd
32+
popd # build
33+
popd # $OFS_DIR
3034

31-
echo "install ofs extension"
35+
echo ">> Install ofs extension"
3236
mkdir -p ~/.local/share/OFS/OFS_data/extensions/MTFG
3337
pushd ~/.local/share/OFS/OFS_data/extensions/MTFG
38+
3439
if [ ! -d ~/.local/share/OFS/OFS_data/extensions/MTFG/Python-Funscript-Editor ]; then
3540
git clone https://github.com/michael-mueller-git/Python-Funscript-Editor.git
3641
fi
3742

3843
pushd ~/.local/share/OFS/OFS_data/extensions/MTFG/Python-Funscript-Editor
3944
git pull
40-
source ~/anaconda3/etc/profile.d/conda.sh 2>/dev/null
41-
source ~/miniconda3/etc/profile.d/conda.sh 2>/dev/null
42-
conda env create -f environment_ubuntu.yaml
45+
46+
if command -v apt; then
47+
source ~/anaconda3/etc/profile.d/conda.sh 2>/dev/null
48+
source ~/miniconda3/etc/profile.d/conda.sh 2>/dev/null
49+
conda env create -f environment_ubuntu.yaml
50+
fi
51+
4352
if [ -f ~/.local/share/OFS/OFS_data/extensions/MTFG/Python-Funscript-Editor/assets/ffmpeg ]; then
4453
cp -fv ~/.local/share/OFS/OFS_data/extensions/MTFG/Python-Funscript-Editor/assets/ffmpeg ~/.local/share/OFS/OFS_data/extensions/MTFG/Python-Funscript-Editor/funscript_editor/data/ffmpeg
4554
else
46-
# TODO newes ffmpeg break MTFG!!
55+
# TODO newest ffmpeg break MTFG!!
4756
bash download_ffmpeg.sh
4857
fi
4958
popd
5059

5160
cp -fv ~/.local/share/OFS/OFS_data/extensions/MTFG/Python-Funscript-Editor/contrib/Installer/assets/main.lua ~/.local/share/OFS/OFS_data/extensions/MTFG/main.lua
5261

5362
popd
63+
64+
if [ ! -e ~/.local/bin/OpenFunscripter ]; then
65+
ln -s `realpath $OFS_DIR`/bin/OpenFunscripter ~/.local/bin/OpenFunscripter
66+
fi
67+
68+
69+
mkdir -p ~/.local/share/applications
70+
71+
cat >> ~/.local/share/applications/OpenFunscripter <<'EOF'
72+
[Desktop Entry]
73+
Type=Application
74+
Name=OpenFunscripter
75+
Exec=$HOME/.local/bin/OpenFunscripter
76+
Comment=OpenFunscripter
77+
StartupWMClass=OpenFunscripter
78+
EOF

funscript_editor/algorithms/funscriptgenerator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -615,15 +615,15 @@ def tracking(self) -> str:
615615
(woman_tracker_status, bbox_woman[tracker_number]) = trackers_woman[tracker_number].result()
616616
if woman_tracker_status != StaticVideoTracker.Status.OK:
617617
status = '{}.1 '.format(tracker_number+1) + woman_tracker_status
618-
delete_last_predictions = (self.params.skip_frames+1)
618+
delete_last_predictions = (self.params.skip_frames+1)*3
619619
stop_tracking = True
620620
break
621621

622622
if self.params.track_men:
623623
(men_tracker_status, bbox_men[tracker_number]) = trackers_men[tracker_number].result()
624624
if men_tracker_status != StaticVideoTracker.Status.OK:
625625
status = '{}.2 '.format(tracker_number+1) + men_tracker_status
626-
delete_last_predictions = (self.params.skip_frames+1)
626+
delete_last_predictions = (self.params.skip_frames+1)*3
627627
stop_tracking = True
628628
break
629629

0 commit comments

Comments
 (0)