Skip to content

Commit 355d2f3

Browse files
author
arch
committed
apply top bothom for diagonal tracking
1 parent d3aa1fc commit 355d2f3

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

funscript_editor/algorithms/funscriptgenerator.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -805,14 +805,14 @@ def apply_shift(self, frame_number, position: str) -> int:
805805
position (str): is max or min
806806
"""
807807
if self.params.direction == 'd':
808-
shift_a = 0
808+
shift_a = self.params.shift_top_points
809809
elif self.params.direction == 'x':
810810
shift_a = self.params.shift_right_points
811811
else:
812812
shift_a = self.params.shift_top_points
813813

814814
if self.params.direction == 'd':
815-
shift_b = 0
815+
shift_b = self.params.shift_bottom_points
816816
elif self.params.direction == 'x':
817817
shift_b = self.params.shift_left_points
818818
else:
@@ -841,14 +841,14 @@ def get_score_with_offset(self, idx_dict) -> list:
841841
list: score with offset
842842
"""
843843
if self.params.direction == 'd':
844-
offset_a = 0
844+
offset_a = self.params.top_points_offset
845845
elif self.params.direction == 'x':
846846
offset_a = self.params.right_points_offset
847847
else:
848848
offset_a = self.params.top_points_offset
849849

850850
if self.params.direction == 'd':
851-
offset_b = 0
851+
offset_b = self.params.bottom_points_offset
852852
elif self.params.direction == 'x':
853853
offset_b = self.params.left_points_offset
854854
else:
@@ -913,14 +913,14 @@ def create_funscript(self, idx_dict: dict) -> None:
913913
output_score = self.get_score_with_offset(idx_dict)
914914

915915
if self.params.direction == 'd':
916-
threshold_a = 0
916+
threshold_a = self.params.bottom_threshold
917917
elif self.params.direction == 'x':
918918
threshold_a = self.params.left_threshold
919919
else:
920920
threshold_a = self.params.bottom_threshold
921921

922922
if self.params.direction == 'd':
923-
threshold_b = 0
923+
threshold_b = self.params.top_threshold
924924
elif self.params.direction == 'x':
925925
threshold_b = self.params.right_threshold
926926
else:
@@ -966,9 +966,10 @@ def run(self) -> None:
966966

967967
idx_dict = self.determin_change_points()
968968

969-
idx_list = [x for k in ['min', 'max'] for x in idx_dict[k]]
970-
idx_list.sort()
971-
self.plot_y_score('debug.png', idx_list)
969+
if False:
970+
idx_list = [x for k in ['min', 'max'] for x in idx_dict[k]]
971+
idx_list.sort()
972+
self.plot_y_score('debug.png', idx_list)
972973

973974
self.create_funscript(idx_dict)
974975
self.finished(status, True)

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ pyreadline
1515
python-dateutil
1616
python-mpv
1717
PyYAML
18+
scipy
1819
screeninfo
1920
six

0 commit comments

Comments
 (0)