This script adds an effect color strip in the VSE then adds an image above it. I want to add a gamma cross strip so I can do a fade in. The trouble is there doesn't seem to be a way to select sequence strips by name. It seems odd that there isn't the ability to so something so simple. Is there a way to do it or some work around?
import bpy
import os
import operator
class CustomPanel(bpy.types.Panel):
bl_label = "OpenSource::Classicism XL"
bl_space_type = "SEQUENCE_EDITOR"
bl_region_type = "UI"
bl_options = {'DEFAULT_CLOSED'}
def draw(self, context):
def add_label():
row = self.layout.row()
row.label("Intro Directory")
def add_import_button():
col = self.layout.split().column(align = True)
col.operator("sequencer.add_intro" , text= "Import")
add_label()
add_import_button()
class Add_Intro(bpy.types.Operator):
bl_idname = "sequencer.add_intro"
bl_label = "Add Intro"
def execute(self, context):
selection = []
def add_sequence_to_list():
selection.append(bpy.context.selected_sequences[0].name)
def select_strip(x):
bpy.context.scene.sequence_editor.sequences_all[image_file_list[0]].use_translation = True
def add_splash_screen():
start = 1
end = 90
channel = 2
directory = "C:\\Users\\...\\"
files = [{"name":"your_image.png"}]
bpy.ops.sequencer.image_strip_add(directory=directory, files=files, frame_start=start, frame_end=end, channel=channel)
add_sequence_to_list()
def add_background_color():
start = 1
end = 91
channel = 1
bpy.ops.sequencer.effect_strip_add(frame_start=start, frame_end=end, channel=channel, type='COLOR')
add_sequence_to_list()
def add_fade_in():
start = 1
end = 90
bpy.ops.sequencer.effect_strip_add(frame_start=1, frame_end=90, type='GAMMA_CROSS')
add_splash_screen()
add_background_color()
add_fade_in()
return {'FINISHED'}
def register():
bpy.utils.register_module(__name__)
def unregister():
bpy.utils.unregister_module(__name__)
if __name__ == "__main__":
register()