Getting the next empty channel number in Sequence Editor with the Blender Python API

To add a new strip to the Sequence Editor programmatically, we need to know the channel number to place it. We can get the number of an empty channel in the Sequence Editor throug the Blender Python API by walking through the list of sequences already added to the Sequence Editor.

The list of sequences already added to the Sequence Editor can be obtained as follows:

Each sequence has a link to the channel on which it is placed:

So, to get the number of a next empty channel, we need to take the maximum number of already occupied channels and add 1 to it:

A channel with this number is guaranteed to be empty and we can upload a new strip to it.

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comment
Inline Feedbacks
View all comments