Page MenuHome

VSE, Python: using the bpy.ops.sequencer.movie_strip_add() operator does not take into account that sound strips are now below video
Closed, DuplicatePublic

Description

Blender Version
Broken: (example: 2.80, 2019-05-20

Short description of error
Using the bpy.ops.sequencer.movie_strip_add() operator and setting the channel will cause the video component to be added at the channel, and the audio component to be added below it. The expected behavior would be for the lowest imported strip to be on the given channel. Even worse, with the default channel setting or by setting channel to 1, the audio component will be loaded into channel 0, which shouldnt even be possible!

Exact steps for others to reproduce the error

  1. Ensure that a VSE area is in the active layout
  2. Paste this script into a text editor:
filepath = 'D:\\video.mpg'
import bpy
for area in bpy.context.screen.areas:
    if area.type == 'SEQUENCE_EDITOR':
        override = {'area': area}
        bpy.ops.sequencer.movie_strip_add(override, filepath=filepath, channel=1)
  1. Replace the 'filepath' string with a path to a video file on your computer with audio and video components.
  2. Run the script.

Details

Type
Bug

Event Timeline

Brecht Van Lommel (brecht) triaged this task as Waiting for Developer to Reproduce priority.

alright, figured id make this easier to test, here's a .blend with the script already loaded and ready to run, just make sure you change the filepath variable or make sure you have a 'video.mpg' file on the root of your D drive