Suppose the duration of the listed strips changed during the project.
You will need to refresh and rearrange the strips.

enter image description here In Blender, this seems to be a manual task.

enter image description here But After Effects has the ability to automatically align strips.
(I've attached an example of AE to help you understand what I want.)

I want to know if Blender VSE has the same functionality as After Effects's keyframe assistant-sequnce layers.


Select all of your strips you want to put in order and run this script:

import bpy

strips = bpy.context.selected_editable_sequences
strips = sorted(strips, key=lambda strip: strip.frame_final_start)

cleanup = []
for i in range(1, len(strips)):
    st0 = strips[i-1]
    st1 = strips[i]
    cleanup.append( [ st1, st1.channel ])
    st1.frame_start = st0.frame_start + st0.frame_final_duration
for x in cleanup:
    x[0].channel = 1
strips[0].channel = 1

enter image description here It's a version of this script: VSE script for to add constant gaps between strips?

  • 2
    $\begingroup$ Amazing power and possibilities of the script. I want to learn Blender Python. $\endgroup$ – J. SungHoon Oct 3 '19 at 7:45
  • $\begingroup$ Nice work! And a great example of simple scripting in the VSE $\endgroup$ – 3pointedit Oct 24 '19 at 6:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.