__author__ = 'thoth'
# http://blender.stackexchange.com/questions/27740/vse-script-for-to-add-constant-gaps-between-strips
import bpy
def gap_strips(strips, gap):
strips = sorted(strips, key=lambda strip: strip.frame_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 + gap
# blender's anti-overlap code might change the channel. put it back.
for x in cleanup:
x[0].channel = x[1]
def gap_selected_strips(gap):
gap_strips( bpy.context.selected_editable_sequences , gap)
gap_selected_strips(15)
|
Blender python API quick-start
Syntax highlighting by Pygments.