1
$\begingroup$

In the VSE, I create a new effect and a keyframe for a property (speed_factor):

scn = bpy.context.scene
sp = scn.sequence_editor.sequences.new_effect("speed",
        'SPEED', 7, start_frame, seq1 = s)
sp.speed_factor = 0
sp.keyframe_insert('speed_factor', frame = start_frame)

How do I then change the handle_type of the keyframe to VECTOR? It seems odd to me that keyframe_insert only returns a success flag rather than some kind of reference to the keyframe I've just created.

$\endgroup$

1 Answer 1

1
$\begingroup$

I figured out a way to do it but in my opinion it's not ideal:

keyframe = sp.id_data.animation_data.action.fcurves[-1].keyframe_points[-1]
keyframe.handle_left_type = 'VECTOR'
keyframe.handle_right_type = 'VECTOR'

It's not ideal because the action might have other fcurves but it solves my case because I know it doesn't for my particular problem.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .