add_relation(Sequencer -> Audio) - Failed, #79985

Closed
opened 2020-08-21 13:33:16 +02:00 by Geo. McCalip · 4 comments

This is similar to https:*developer.blender.org/T78200 but itis not answered in https:*developer.blender.org/T77669.

The code is:

- !/usr/bin/env python
- -*- coding: utf-8 -*-

import bpy
import os
import sys

s = bpy.context.scene
sed = s.sequence_editor
sequences = sed.sequences
vse = s.sequence_editor

event_ID = sys.argv[8]
event = str(event_ID)
print("event_ID = " + event_ID)

pathout = "/var/www/html/data/event"
    
#Declare arrays#
fileOut =[] * 5
fileOut.append("")
    
#Read in voiceovers#
fileOut.append("/var/www/html/data/event1/event1-1.wav")
fileOut.append("/var/www/html/data/event1/event1-2.wav")
fileOut.append("/var/www/html/data/event1/event1-3.wav")
fileOut.append("/var/www/html/data/event1/event1-4.wav")

#Include frames per voiceover# 
vLen1 = 187
print(fileOut[1] + ' length in frames = ' + str(vLen1))

vLen2 = 254
print(fileOut[2] + ' length in frames = ' + str(vLen2))

vLen3 = 333
print(fileOut[3] + ' length in frames = ' + str(vLen3))

vLen4 = 367
print(fileOut[4] + ' length in frames = ' + str(vLen4))

#change voice overs
s1 = fileOut[1]
frame_start1 = 1
frame_end1 = frame_start1+vLen1+9
sound_strip1 = sequences.new_sound("Sound1", s1, 2, frame_start1)
sound_strip1.frame_final_end = frame_end1
print("frame_start1 = " + str(frame_start1))
print("frame_end1 = " + str(frame_end1))

s2 = fileOut[2]
frame_start2 = frame_end1+1
frame_end2 = frame_start2+vLen2+9
sound_strip2 = sequences.new_sound("Sound2", s2, 3, frame_start2)
sound_strip2.frame_final_end = frame_end2
print("frame_start2 = " + str(frame_start2))
print("frame_end2 = " + str(frame_end2))

s3 = fileOut[3]
frame_start3 = frame_end2+1
frame_end3 = frame_start3+vLen3+9
sound_strip3 = sequences.new_sound("Sound3", s3, 4, frame_start3)
sound_strip3.frame_final_end = frame_end3
print("frame_start3 = " + str(frame_start3))
print("frame_end3 = " + str(frame_end3))

s4 = fileOut[4]
frame_start4 = frame_end3+1
frame_end4 = frame_start4+vLen4+9
sound_strip4 = sequences.new_sound("Sound4", s4, 5, frame_start4)
sound_strip4.frame_final_end = frame_end4
print("frame_start4 = " + str(frame_start4))
print("frame_end4 = " + str(frame_end4))

renderout = pathout + event + "/vid" + "-" + event + ".m4v"
print("renderout = " + renderout)

bpy.context.scene.render.image_settings.file_format = 'FFMPEG'
bpy.context.scene.render.filepath = renderout
bpy.ops.render.render(animation=True)

sequences.remove(sound_strip1)
sequences.remove(sound_strip2)
sequences.remove(sound_strip3)
sequences.remove(sound_strip4)

Based on https://developer.blender.org/T77669 I changed the sound strips to 2, 3, 4, and 5 instead of putting everything into sound strip 2.

I still get the following when I run the Python script:

Blender 2.83.3
/run/user/1000/gvfs/ non-existent directory
Read blend: /var/www/html/data/wed-render.blend
event_ID = 1
/var/www/html/data/event1/event1-1.wav length in frames = 187
/var/www/html/data/event1/event1-2.wav length in frames = 254
/var/www/html/data/event1/event1-3.wav length in frames = 333
/var/www/html/data/event1/event1-4.wav length in frames = 367
frame_start1 = 1
frame_end1 = 197
frame_start2 = 198
frame_end2 = 461
frame_start3 = 462
frame_end3 = 804
frame_start4 = 805
frame_end4 = 1181
renderout = /var/www/html/data/event1/vid-1.m4v
add_relation(Sequencer -> Audio) - Failed, but op_from (ComponentKey(SCScene, SEQUENCER)) was ok
add_relation(Sequencer -> Audio) - Could not find op_to (ComponentKey(SCScene, AUDIO))
add_relation(Sequencer -> Audio) - Failed, but op_from (ComponentKey(SCScene, SEQUENCER)) was ok
add_relation(Sequencer -> Audio) - Could not find op_to (ComponentKey(SCScene, AUDIO))
add_relation(Sequencer -> Audio) - Failed, but op_from (ComponentKey(SCScene, SEQUENCER)) was ok
add_relation(Sequencer -> Audio) - Could not find op_to (ComponentKey(SCScene, AUDIO))
Unable to open a display
Aborted (core dumped)

This is done strictly by a script, not using the GUI. The strip is not being copied and pasted. I am adding four separate strips through the Python script.

Just as a test I added the strips in reverse order. I got the same results.

Why am I getting the error? And more important, how do I make this work?

add_relation(Sequencer -> Audio) - Failed, but op_from (ComponentKey(SCScene, SEQUENCER)) was ok
add_relation(Sequencer -> Audio) - Could not find op_to (ComponentKey(SCScene, AUDIO))
This is similar to https:*developer.blender.org/T78200 but it**is not** answered in https:*developer.blender.org/T77669. The code is: ``` - !/usr/bin/env python - -*- coding: utf-8 -*- import bpy import os import sys s = bpy.context.scene sed = s.sequence_editor sequences = sed.sequences vse = s.sequence_editor event_ID = sys.argv[8] event = str(event_ID) print("event_ID = " + event_ID) pathout = "/var/www/html/data/event" #Declare arrays# fileOut =[] * 5 fileOut.append("") #Read in voiceovers# fileOut.append("/var/www/html/data/event1/event1-1.wav") fileOut.append("/var/www/html/data/event1/event1-2.wav") fileOut.append("/var/www/html/data/event1/event1-3.wav") fileOut.append("/var/www/html/data/event1/event1-4.wav") #Include frames per voiceover# vLen1 = 187 print(fileOut[1] + ' length in frames = ' + str(vLen1)) vLen2 = 254 print(fileOut[2] + ' length in frames = ' + str(vLen2)) vLen3 = 333 print(fileOut[3] + ' length in frames = ' + str(vLen3)) vLen4 = 367 print(fileOut[4] + ' length in frames = ' + str(vLen4)) #change voice overs s1 = fileOut[1] frame_start1 = 1 frame_end1 = frame_start1+vLen1+9 sound_strip1 = sequences.new_sound("Sound1", s1, 2, frame_start1) sound_strip1.frame_final_end = frame_end1 print("frame_start1 = " + str(frame_start1)) print("frame_end1 = " + str(frame_end1)) s2 = fileOut[2] frame_start2 = frame_end1+1 frame_end2 = frame_start2+vLen2+9 sound_strip2 = sequences.new_sound("Sound2", s2, 3, frame_start2) sound_strip2.frame_final_end = frame_end2 print("frame_start2 = " + str(frame_start2)) print("frame_end2 = " + str(frame_end2)) s3 = fileOut[3] frame_start3 = frame_end2+1 frame_end3 = frame_start3+vLen3+9 sound_strip3 = sequences.new_sound("Sound3", s3, 4, frame_start3) sound_strip3.frame_final_end = frame_end3 print("frame_start3 = " + str(frame_start3)) print("frame_end3 = " + str(frame_end3)) s4 = fileOut[4] frame_start4 = frame_end3+1 frame_end4 = frame_start4+vLen4+9 sound_strip4 = sequences.new_sound("Sound4", s4, 5, frame_start4) sound_strip4.frame_final_end = frame_end4 print("frame_start4 = " + str(frame_start4)) print("frame_end4 = " + str(frame_end4)) renderout = pathout + event + "/vid" + "-" + event + ".m4v" print("renderout = " + renderout) bpy.context.scene.render.image_settings.file_format = 'FFMPEG' bpy.context.scene.render.filepath = renderout bpy.ops.render.render(animation=True) sequences.remove(sound_strip1) sequences.remove(sound_strip2) sequences.remove(sound_strip3) sequences.remove(sound_strip4) ``` Based on https://developer.blender.org/T77669 I changed the sound strips to 2, 3, 4, and 5 instead of putting everything into sound strip 2. I still get the following when I run the Python script: ``` Blender 2.83.3 /run/user/1000/gvfs/ non-existent directory Read blend: /var/www/html/data/wed-render.blend event_ID = 1 /var/www/html/data/event1/event1-1.wav length in frames = 187 /var/www/html/data/event1/event1-2.wav length in frames = 254 /var/www/html/data/event1/event1-3.wav length in frames = 333 /var/www/html/data/event1/event1-4.wav length in frames = 367 frame_start1 = 1 frame_end1 = 197 frame_start2 = 198 frame_end2 = 461 frame_start3 = 462 frame_end3 = 804 frame_start4 = 805 frame_end4 = 1181 renderout = /var/www/html/data/event1/vid-1.m4v add_relation(Sequencer -> Audio) - Failed, but op_from (ComponentKey(SCScene, SEQUENCER)) was ok add_relation(Sequencer -> Audio) - Could not find op_to (ComponentKey(SCScene, AUDIO)) add_relation(Sequencer -> Audio) - Failed, but op_from (ComponentKey(SCScene, SEQUENCER)) was ok add_relation(Sequencer -> Audio) - Could not find op_to (ComponentKey(SCScene, AUDIO)) add_relation(Sequencer -> Audio) - Failed, but op_from (ComponentKey(SCScene, SEQUENCER)) was ok add_relation(Sequencer -> Audio) - Could not find op_to (ComponentKey(SCScene, AUDIO)) Unable to open a display Aborted (core dumped) ``` This is done strictly by a script, not using the GUI. The strip is not being copied and pasted. I am adding four separate strips through the Python script. Just as a test I added the strips in reverse order. I got the same results. Why am I getting the error? And more important, how do I make this work? ``` add_relation(Sequencer -> Audio) - Failed, but op_from (ComponentKey(SCScene, SEQUENCER)) was ok add_relation(Sequencer -> Audio) - Could not find op_to (ComponentKey(SCScene, AUDIO)) ```
Author

Added subscriber: @mcgeo52

Added subscriber: @mcgeo52
Author

This comment was removed by @mcgeo52

*This comment was removed by @mcgeo52*
Author

Changed status from 'Needs Triage' to: 'Resolved'

Changed status from 'Needs Triage' to: 'Resolved'
Geo. McCalip self-assigned this 2020-08-22 05:07:20 +02:00
Author

SOLVED!!!

All I had to do was add:

bpy.context.scene.frame_end = frame_end4-1
SOLVED!!! All I had to do was add: ``` bpy.context.scene.frame_end = frame_end4-1 ```
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
1 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#79985
No description provided.