@@ -49,7 +49,7 @@ class FunscriptGeneratorParameter:
4949 # General
5050 skip_frames : int = max ((0 , int (HYPERPARAMETER ['skip_frames' ])))
5151
52- # y- Movement
52+ # y VR Movement
5353 shift_bottom_points : int = int (HYPERPARAMETER ['shift_bottom_points' ])
5454 shift_top_points : int = int (HYPERPARAMETER ['shift_top_points' ])
5555 bottom_points_offset : float = float (HYPERPARAMETER ['bottom_points_offset' ])
@@ -58,12 +58,12 @@ class FunscriptGeneratorParameter:
5858 top_threshold : float = float (HYPERPARAMETER ['top_threshold' ])
5959
6060 # x-Movement
61- shift_left_points : int = int (HYPERPARAMETER ['shift_left_points ' ])
62- shift_right_points : int = int (HYPERPARAMETER ['shift_right_points ' ])
63- left_points_offset : float = float (HYPERPARAMETER ['left_points_offset ' ])
64- right_points_offset : float = float (HYPERPARAMETER ['right_points_offset ' ])
65- left_threshold : float = float (HYPERPARAMETER ['left_threshold ' ])
66- right_threshold : float = float (HYPERPARAMETER ['right_threshold ' ])
61+ shift_min_points : int = int (HYPERPARAMETER ['shift_min_points ' ])
62+ shift_max_points : int = int (HYPERPARAMETER ['shift_max_points ' ])
63+ min_points_offset : float = float (HYPERPARAMETER ['min_points_offset ' ])
64+ max_points_offset : float = float (HYPERPARAMETER ['max_points_offset ' ])
65+ min_threshold : float = float (HYPERPARAMETER ['min_threshold ' ])
66+ max_threshold : float = float (HYPERPARAMETER ['max_threshold ' ])
6767
6868
6969class FunscriptGeneratorThread (QtCore .QThread ):
@@ -331,7 +331,7 @@ def calculate_score(self) -> None:
331331 # this should never happen
332332 self .logger .error ('Calculate score not implement for x=%d, y=%d' , x , y )
333333
334- # invert
334+ # invert because math angle is ccw
335335 self .score ['pitch' ] = [- 1.0 * item for item in self .score ['pitch' ]]
336336
337337
@@ -799,8 +799,8 @@ def apply_shift(self, frame_number: int, metric: str, position: str) -> int:
799799 Returns:
800800 int: real frame position
801801 """
802- shift_max = self .params .shift_top_points if metric == 'y' else self .params .shift_right_points
803- shift_min = self .params .shift_bottom_points if metric == 'y' else self .params .shift_left_points
802+ shift_max = self .params .shift_top_points if metric == 'y' else self .params .shift_max_points
803+ shift_min = self .params .shift_bottom_points if metric == 'y' else self .params .shift_min_points
804804
805805 if position in ['max' ] :
806806 if frame_number >= - 1 * shift_max \
@@ -825,8 +825,8 @@ def get_score_with_offset(self, idx_dict: dict, metric: str) -> list:
825825 Returns:
826826 list: score with offset
827827 """
828- offset_max = self .params .top_points_offset if metric == 'y' else self .params .right_points_offset
829- offset_min = self .params .bottom_points_offset if metric == 'y' else self .params .left_points_offset
828+ offset_max = self .params .top_points_offset if metric == 'y' else self .params .max_points_offset
829+ offset_min = self .params .bottom_points_offset if metric == 'y' else self .params .min_points_offset
830830
831831 score = copy .deepcopy (self .score [metric ])
832832 score_min , score_max = min (score ), max (score )
@@ -895,8 +895,8 @@ def create_funscript(self, idx_dict: dict) -> None:
895895 else :
896896 output_score = self .get_score_with_offset (idx_dict , self .params .metric )
897897
898- threshold_min = self .params .bottom_threshold if self .params .metric == 'y' else self .params .left_threshold
899- threshold_max = self .params .top_threshold if self .params .metric == 'y' else self .params .right_threshold
898+ threshold_min = self .params .bottom_threshold if self .params .metric == 'y' else self .params .min_threshold
899+ threshold_max = self .params .top_threshold if self .params .metric == 'y' else self .params .max_threshold
900900
901901 for idx in idx_dict ['min' ]:
902902 self .funscript .add_action (
0 commit comments