Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy Effects Between Clips (bug fix) #5424

Merged
merged 3 commits into from
Feb 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/windows/views/webview.py
Original file line number Diff line number Diff line change
Expand Up @@ -1598,6 +1598,7 @@ def Copy_Triggered(self, action, clip_ids, tran_ids):
elif action == MENU_COPY_EFFECTS:
self.copy_clipboard[clip_id]['effects'] = clip.data['effects']


# Loop through transition objects
for tran_id in tran_ids:

Expand Down Expand Up @@ -1669,6 +1670,10 @@ def Paste_Triggered(self, action, position, layer_id, clip_ids, tran_ids):
clip.type = 'insert'
clip.data.pop('id')

# Update effect IDs
clip.data['effects'] = [{k: (get_app().project.generate_id() if k == 'id' else v)
for k, v in effect.items()} for effect in clip.data['effects']]

# Adjust the position and track
clip.data['position'] += position_diff
clip.data['layer'] += layer_diff
Expand Down Expand Up @@ -1706,6 +1711,10 @@ def Paste_Triggered(self, action, position, layer_id, clip_ids, tran_ids):
# Apply clipboard to clip (there should only be a single key in this dict)
for k, v in self.copy_clipboard[list(self.copy_clipboard)[0]].items():
if k != 'id':
if k == 'effects':
# Update effect IDs
v = [{k: (get_app().project.generate_id() if k == 'id' else v)
for k, v in effect.items()} for effect in v]
# Overwrite clips properties (which are in the clipboard)
clip.data[k] = v

Expand Down
Loading