Skip to content

Instantly share code, notes, and snippets.

@tin2tin
Last active March 16, 2023 09:46
Show Gist options
  • Save tin2tin/df6915f7f7377eb13bc6d32e6a9de208 to your computer and use it in GitHub Desktop.
Save tin2tin/df6915f7f7377eb13bc6d32e6a9de208 to your computer and use it in GitHub Desktop.
Add a file related Sequence menu to the VSE header.
import bpy
class SEQUENCER_MT_SequenceMenu(bpy.types.Menu):
bl_idname = "SEQUENCER_MT_sequence_menu"
bl_label = "Sequence"
def draw(self, context):
layout = self.layout
layout.operator_context = 'INVOKE_REGION_WIN'
layout.operator("sequencer.refresh_all", text="Refresh All")
layout.operator_context = 'INVOKE_DEFAULT'
layout.separator()
layout.operator("sequencer.movie_strip_add", text="Import Movie")
layout.operator("sequencer.sound_strip_add", text="Import Sound")
layout.operator("sequencer.image_strip_add", text="Import Image/Sequence")
layout.separator()
props = layout.operator("render.opengl", text="Export Sequence")
props.animation = True
props.sequencer = True
layout.operator("render.opengl", text="Render Image").sequencer = True
layout.separator()
layout.operator("sound.mixdown", text="Export Audio Mixdown")
layout.separator()
layout.operator("sequencer.export_subtitles", text="Export Subtitles")
def prepend_sequence_menu(self, context):
self.layout.menu("SEQUENCER_MT_sequence_menu")
self.layout.separator()
def register():
bpy.utils.register_class(SEQUENCER_MT_SequenceMenu)
bpy.types.SEQUENCER_MT_editor_menus.prepend(prepend_sequence_menu)
def unregister():
bpy.utils.unregister_class(SEQUENCER_MT_SequenceMenu)
bpy.types.SEQUENCER_MT_editor_menus.remove(prepend_sequence_menu)
if __name__ == "__main__":
register()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment