I've written a script takes the start and end values of a VSE strip, and copies those values to the NLA strip of a selected object (effectively syncing the NLA strip with the VSE strip). The script works well enough, however, I have to click the 'Run Scrript' button every time I move the VSE Strip.
How would I go about making it so that when I move the VSE strip, the NLA strip moves automatically as well?
I've researched using handlers and the def update functions but nothing has worked for me (including drivers).
Below is the script I've worked up. I'll attach the .Blend I use with it as well
import bpy
targetName = 'My_Strip'
for vsestrip in bpy.context.scene.sequence_editor.sequences_all:
if targetName in vsestrip.name:
vsestrip.select = True
vsestrip.frame_start
else:
strip.select = False
vsestart = bpy.context.scene.sequence_editor.sequences_all["My_Strip"].frame_start
for obj in bpy.context.selected_objects:
obj.animation_data.nla_tracks[0].strips[0].frame_start = vsestart
obj.animation_data.nla_tracks[0].strips[0].frame_end = vsestart
obj.animation_data.nla_tracks[0].strips[0].scale = 1