I want to make it so I (and my students) can access the Graph Editor's "Key" menu from the Timeline. This is very easy to do by changing the source code: in space_time.py I just need to add sub.menu("GRAPH_MT_key") under the class TIME_MT_editor_menus(Menu): as shown in this screenshot:

enter image description here

However, I would really like to do this via an addon so that it is easier to distribute to my students. I am relatively new to addon coding, so I am probably missing something huge, but it seems like all we should need to do is append the Key menu to the Timeline editor menus. I tried the following, but it didn't work:

bl_info = {
    "name": "Timeline Key Menu",
    "blender": (3, 6, 0),
    "location": "Timeline > Key",
    "description": ("Adds the graph editor's Key menu to the Timeline window"),
    "category": "Animation",

import bpy

def register():

def unregister():

if __name__ == "__main__":

Any thoughts on what I'm missing?

  • $\begingroup$ Hi. Please use a title that matches the content of the question. It should be descriptive but succinct, unique and identifying, summarizing the issue in such way that anyone searching for a similar problem is likely to find it. Use the edit link above, remove anything superfluous, avoid words like "this", "help", "issue with" or "question about". Remember, your title is the first thing potential visitors see, answers you get depend heavily on how insightful it is. See What is the problem of asking “How do I do this?" $\endgroup$ Sep 23 at 23:06
  • $\begingroup$ Out of curiosity, which menu items do you want to reach, not available from a right-click? $\endgroup$
    – Robin Betts
    Sep 30 at 7:53

1 Answer 1


bpy.types.TIME_MT_editor_menus.append() takes a draw function as parameter.

Below is a sample code also available in Templates > Python > Ui Menu in the Blender Text Editor.

import bpy

class CustomMenu(bpy.types.Menu):
    bl_label = "Custom Menu"
    bl_idname = "OBJECT_MT_custom_menu"

    def draw(self, context):
        layout = self.layout

        layout.operator("wm.save_as_mainfile").copy = True


        layout.label(text="Hello world!", icon='WORLD_DATA')

        # use an operator enum property to populate a sub-menu
                                  text="Select All by Type",

        # call another menu
        layout.operator("wm.call_menu", text="Unwrap").name = "VIEW3D_MT_uv_map"

def draw_item(self, context):
    layout = self.layout

def register():

    # lets add ourselves to the main header

def unregister():


if __name__ == "__main__":

    # The menu can also be called from scripts

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .