I have the following code in which I want to add a keyframe at two points at the end:
import bpy
import os, glob
# glob all movie files from
vid_dir = "/Volumes/Temp/Grau_Benjamin/01_avi_sequences_264frames_backw/0_glitched/"
# note this will recursively find movies in folder
exts = bpy.path.extensions_movie
files = [f for ext in exts for f in glob.glob(os.path.join(vid_dir, "*%s" % ext))]
files.sort()
scene = bpy.context.scene
scene.sequence_editor_create()
seq = scene.sequence_editor.sequences
for i, fp in enumerate(files):
frame_start = (i * 48) + (i * i) + 1# some offset
name = os.path.basename(fp)
seq.new_movie(name=name,
filepath=fp,
channel=32 - i,
frame_start=frame_start
)
scene.sequence_editor.sequences_all[name].blend_type = 'CROSS'
bpy.context.scene.frame_current = frame_start + ((i+1) * 48) + ((i+1) * (i+1)) + 1
scene.sequence_editor.sequences_all[name].blend_alpha = 100
# Here I want to set a keyframe for the blend parameter
bpy.context.scene.frame_current = frame_start + ((i+2) * 48) + ((i+2) * (i+2)) + 1
scene.sequence_editor.sequences_all[name].blend_alpha = 0
# Here I want to set a keyframe for the blend parameter
I tried using the automatic keyframe insertion, but this wouldn't work. And I don't see what's happening inside the console, so that I could paste it to my code, when doing it manually.
Thank you very much.
Benni