2
$\begingroup$

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.

$\endgroup$

1 Answer 1

3
$\begingroup$

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?

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

You must log in to answer this question.

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