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

Closed
opened 2019-05-22 01:15:45 +02:00 by hudson barkley · 3 comments

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.
**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) ``` 3. Replace the 'filepath' string with a path to a video file on your computer with audio and video components. 4. Run the script.
Author

Added subscriber: @snuq

Added subscriber: @snuq
Richard Antalik was assigned by Brecht Van Lommel 2019-05-22 10:21:34 +02:00
Author

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
videoload.blend

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 [videoload.blend](https://archive.blender.org/developer/F7078132/videoload.blend)

Closed as duplicate of blender/blender#65046

Closed as duplicate of blender/blender#65046
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#64964
No description provided.