Fix #151951: VSE: Crossfade sounds zeroes out the audio

Calling `.keyframe_insert` creates a frame at
`bpy.context.scene.frame_current` by default. Explicitly pass the frame
so that we keyframe on the strip's sequencer scene instead.
This commit is contained in:
John Kiril Swenson 2026-03-15 21:07:59 -05:00 • committed by John Kiril Swenson
parent 1faa192978
commit d3077785b4

View file

@ -59,17 +59,12 @@ class SequencerCrossfadeSounds(Operator):
if strip1.frame_final_start > strip2.frame_final_start:
strip1, strip2 = strip2, strip1
if strip1.frame_final_end > strip2.frame_final_start:
tempcfra = scene.frame_current
scene.frame_current = strip2.frame_final_start
strip1.keyframe_insert("volume")
scene.frame_current = strip1.frame_final_end
strip1.keyframe_insert("volume", frame=strip2.frame_final_start)
strip1.volume = 0
strip1.keyframe_insert("volume")
strip2.keyframe_insert("volume")
scene.frame_current = strip2.frame_final_start
strip1.keyframe_insert("volume", frame=strip1.frame_final_end)
strip2.keyframe_insert("volume", frame=strip1.frame_final_end)
strip2.volume = 0
strip2.keyframe_insert("volume")
scene.frame_current = tempcfra
strip2.keyframe_insert("volume", frame=strip2.frame_final_start)
return {'FINISHED'}
self.report({'ERROR'}, "The selected strips don't overlap")