From 5b1440ab732fd9ea835132af2675662c53a25ac0 Mon Sep 17 00:00:00 2001 From: Jvshen Date: Tue, 8 Oct 2024 20:53:26 -0700 Subject: [PATCH] Set selected instance to None when switching frames or videos --- sleap/gui/commands.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sleap/gui/commands.py b/sleap/gui/commands.py index 075ccf060..89341e517 100644 --- a/sleap/gui/commands.py +++ b/sleap/gui/commands.py @@ -363,10 +363,12 @@ def exportFullPackage(self): def previousLabeledFrame(self): """Goes to labeled frame prior to current frame.""" self.execute(GoPreviousLabeledFrame) + self.state["instance"] = None def nextLabeledFrame(self): """Goes to labeled frame after current frame.""" self.execute(GoNextLabeledFrame) + self.state["instance"] = None def nextUserLabeledFrame(self): """Goes to next labeled frame with user instances.""" @@ -403,6 +405,7 @@ def nextTrackFrame(self): def gotoFrame(self): """Shows gui to go to frame by number.""" self.execute(GoFrameGui) + self.state["instance"] = None def selectToFrame(self): """Shows gui to go to frame by number.""" @@ -411,14 +414,17 @@ def selectToFrame(self): def gotoVideoAndFrame(self, video: Video, frame_idx: int): """Activates video and goes to frame.""" NavCommand.go_to(self, frame_idx, video) + self.state["instance"] = None def nextView(self): """Goes to next view.""" self.execute(GoAdjacentView, prev_or_next="next") + self.state["instance"] = None def prevView(self): """Goes to previous view.""" self.execute(GoAdjacentView, prev_or_next="prev") + self.state["instance"] = None # Editing Commands