Skip to content

Commit 0376b08

Browse files
author
arch
committed
fix funscript next action
1 parent 97fa47f commit 0376b08

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

funscript_editor/data/funscript.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,11 @@ def get_next_action(self, current_timestamp: int) -> dict:
175175
Returns:
176176
dict: action dictionary with {'pos', 'at'}
177177
"""
178-
if len(self.data['actions']) < 2: return {'pos': 0, 'at': 0}
178+
if len(self.data['actions']) < 1: return {'pos': 0, 'at': 0}
179179
idx = (np.abs(np.array(self.get_actions_times()) - current_timestamp)).argmin()
180180
if self.data['actions'][idx]['at'] > current_timestamp + 1: return self.data['actions'][idx]
181-
elif idx < len(self.data['actions']) + 1: return self.data['actions'][idx+1]
181+
elif len(self.data['actions']) == 1: return self.data['actions'][0]
182+
elif idx+1 < len(self.data['actions']): return self.data['actions'][idx+1]
182183
else: return self.data['actions'][0]
183184

184185

funscript_editor/ui/funscript_editor_window.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,8 @@ def __generate_funscript(self):
298298
else:
299299
end_frame = -1
300300

301+
self.__logger.info("Stop at Frame {}".format(end_frame))
302+
301303
reply = QtWidgets.QMessageBox.question(None, 'Track Men', 'Do you want to track the Men? ',
302304
QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No, QtWidgets.QMessageBox.No)
303305
trackMen = True if reply == QtWidgets.QMessageBox.Yes else False

0 commit comments

Comments
 (0)