# how to create a new operator for the VSE?

I want to create an addon that will allow me to copy and paste video and image clips from one blender window(VSE) to another separately opened blender window(another VSE window). But I've been struggling with understanding how to code the operator for the task. Any tips or good examples on how to structure the code?

• How to append a menu: blender.stackexchange.com/questions/152525/… – tintwotin Oct 19 '20 at 21:04
• Can you clarify a bit? Do you intend to copy strips between two Blender instances (you started Blender 2x, load a different project in each instance, and want to copy from one project to another) In that case, you should try with the operation of File > Append) . Or do you want to copy strips between scenes in one project? – Husch Oct 21 '20 at 9:22
• i have two separate projects that I'm working on in two separate VSE windows. I want to be able to copy a clip or image from one project and paste into the other project. And i am using the same version/patch for both. – blenderuser001 Oct 21 '20 at 16:32
• For more code examples for the VSE: blenderartists.org/t/video-sequence-editor-news-add-ons/1188770 – tintwotin Oct 25 '20 at 13:44

The keyword you need is SEQUENCER_MT_context_menu.

def menu_func(self, context):
self.layout.operator(ScriptClassNameHere.bl_idname)

def register():
bpy.utils.register_class(ScriptClassNameHere)

def unregister():
bpy.utils.unregister_class(ScriptClassNameHere)


How I found this out:

Opening up the right-click menu on the VSE lets me know it's called a "Sequencer Context Menu" (it's written at the top before any of the menu items).

Notice the ‘CATEGORY_MT_name’ in Menu.bl_idname, this is a naming convention for menus.

Maybe this is clear enough to Blender developers, but it took me a while. I couldn't find any documentation that lists these properly. What I did find is a Blender translation file where I looked up _MT_ and eventually found SEQUENCER_MT_context_menu, which worked after testing.

For posterity, here are some other Sequencer-related menus (bpy.types.SEQUENCER_MT_*) in that file that would be useful for extending menus via add-ons:

add
change
marker
preview_zoom
proxy
range
select
select_channel
select_handle
strip
strip_effect
strip_image_transform
strip_input
strip_lock_mute
strip_movie
strip_transform
view
view_cache


Other bpy.types. categories are:

CLIP
COLLECTION
CONSOLE
DATA
DOPESHEET
FILEBROWSER
GPENCIL
GRAPH
HAIR
IMAGE
INFO
MATERIAL
MESH
NLA
NODE
OUTLINER
PARTICLE
POINTCLOUD
RENDER
SEQUENCER
TEXT
TEXTURE
TIME
TOPBAR
USERPREF
VIEW3D
WM


The rest of the code is taken straight out of The Blender Add-on Tutorial.

Blender 2.93