Fix: #134636: VSE - Fade In and Out not working

Use the new `action.fcurve_ensure_for_datablock()` function to ensure
the opacity F-Curve exists.

This function also ensures that the Action itself is ready for keying
(it has a layer and a keyframe strip), and ensures the slot for the
Scene exists and is assigned.

Co-authored-by: Pratik Borhade <pratikborhade302@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/134753
This commit is contained in:
Sybren A. Stüvel
2025-02-20 11:13:57 +01:00
parent f0e92c695d
commit 0bb750ee84

View File

@@ -287,16 +287,9 @@ class SequencerFadesAdd(Operator):
Returns the matching FCurve or creates a new one if the function can't find a match.
"""
scene = context.scene
fade_fcurve = None
fcurves = scene.animation_data.action.fcurves
action = scene.animation_data.action
searched_data_path = sequence.path_from_id(animated_property)
for fcurve in fcurves:
if fcurve.data_path == searched_data_path:
fade_fcurve = fcurve
break
if not fade_fcurve:
fade_fcurve = fcurves.new(data_path=searched_data_path)
return fade_fcurve
return action.fcurve_ensure_for_datablock(scene, searched_data_path)
def fade_animation_clear(self, fade_fcurve, fades):
"""