Skip to content

Commit

Permalink
Fixing bug when copying effects from 1 clip to another clip. We were …
Browse files Browse the repository at this point in the history
…copying the "id" from the first clip, instead of generating a new one. Take 2.. generating ID on Paste instead of copy.
  • Loading branch information
jonoomph committed Feb 15, 2024
1 parent 2e433db commit cc313ba
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/windows/views/webview.py
Original file line number Diff line number Diff line change
Expand Up @@ -1596,8 +1596,7 @@ def Copy_Triggered(self, action, clip_ids, tran_ids):
elif action == MENU_COPY_KEYFRAMES_VOLUME:
self.copy_clipboard[clip_id]['volume'] = clip.data['volume']
elif action == MENU_COPY_EFFECTS:
self.copy_clipboard[clip_id]['effects'] = [{k: (get_app().project.generate_id() if k == 'id' else v)
for k, v in effect.items()} for effect in clip.data['effects']]
self.copy_clipboard[clip_id]['effects'] = clip.data['effects']


# Loop through transition objects
Expand Down Expand Up @@ -1708,6 +1707,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

0 comments on commit cc313ba

Please sign in to comment.