From 6dfa354d01529ad2463df1787465864f18713e31 Mon Sep 17 00:00:00 2001 From: Jonathan Thomas Date: Tue, 17 Dec 2024 15:45:03 -0600 Subject: [PATCH 1/2] Improved ripple slice to jump playhead when ripple slice (Keep Right) is selected. We now seek the playhead to the new start position. --- src/windows/views/timeline.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/windows/views/timeline.py b/src/windows/views/timeline.py index 188a37d1d..3923c07a1 100644 --- a/src/windows/views/timeline.py +++ b/src/windows/views/timeline.py @@ -2003,6 +2003,7 @@ def Slice_Triggered(self, action, clip_ids, trans_ids, playhead_position=0, ripp # Emit signal to ignore updates (start ignoring updates) get_app().window.IgnoreUpdates.emit(True) + new_starting_frame = -1 try: # Get the nearest starting frame position to the playhead (snap to frame boundaries) @@ -2040,6 +2041,9 @@ def Slice_Triggered(self, action, clip_ids, trans_ids, playhead_position=0, ripp clip.data["position"] = original_position # Move right side back to original position self.ripple_delete_gap(playhead_position, clip.data["layer"], removed_duration) + # Seek to new starting frame + new_starting_frame = original_position * (fps_num / fps_den) + 1 + elif action == MenuSlice.KEEP_BOTH: # Update clip data for the left clip clip.data["end"] = start_of_clip + (playhead_position - original_position) @@ -2093,6 +2097,9 @@ def Slice_Triggered(self, action, clip_ids, trans_ids, playhead_position=0, ripp trans.data["position"] = original_position self.ripple_delete_gap(playhead_position, trans.data["layer"], removed_duration) + # Seek to new starting frame + new_starting_frame = original_position * (fps_num / fps_den) + 1 + elif action == MenuSlice.KEEP_BOTH: # Update data for the left transition trans.data["end"] = start_of_tran + (playhead_position - original_position) @@ -2119,6 +2126,10 @@ def Slice_Triggered(self, action, clip_ids, trans_ids, playhead_position=0, ripp # Emit signal to resume updates (stop ignoring updates) get_app().window.IgnoreUpdates.emit(False) + if new_starting_frame != -1: + # Seek to new position (if needed) + self.window.SeekSignal.emit(round(new_starting_frame)) + def ripple_delete_gap(self, ripple_start, layer, ripple_gap): """Remove the ripple gap and adjust subsequent items""" # Get all clips and transitions right of ripple_start in the given layer From ad8f2ec9ad38430d574919a4ea5e72a1cf5d09c1 Mon Sep 17 00:00:00 2001 From: Jonathan Thomas Date: Tue, 17 Dec 2024 16:03:05 -0600 Subject: [PATCH 2/2] Display properties dock if keyframe or effect selected on timeline --- src/windows/views/timeline.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/windows/views/timeline.py b/src/windows/views/timeline.py index 3923c07a1..008028f59 100644 --- a/src/windows/views/timeline.py +++ b/src/windows/views/timeline.py @@ -2893,6 +2893,9 @@ def SeekToKeyframe(self, frame_number): # Seek to frame self.window.SeekSignal.emit(frame_number) + # Display properties (if not visible) + self.window.actionProperties.trigger() + @pyqtSlot(int) def PlayheadMoved(self, position_frames): @@ -2944,6 +2947,9 @@ def SetPlayheadFollow(self, enable_follow): def addSelection(self, item_id, item_type, clear_existing=False): """ Add the selected item to the current selection """ self.window.SelectionAdded.emit(item_id, item_type, clear_existing) + if item_id and item_type == "effect": + # Display properties for effect (if not visible) + self.window.actionProperties.trigger() def addRippleSelection(self, item_id, item_type): if item_type == "clip":