In Blender's built-in Text Editor, there's a Templates menu at the bottom with a bunch of pre-built templates for scripting addons. However, I have created a few new templates myself that I use frequently. Is there any way for me to add my templates to this menu?


In [version_number]/scripts subfolder of your Blender installation, or in any additional path(s) for scripts you've set in User Preferences, there's a folder templates_py (and one for osl too). Just put the templates there; in the menu, each _ in the file name will be converted into a space and each beginning letter of a word capitalized.

  • $\begingroup$ Very trivial note ;), the beginning letter gets uppercased and also the first letter that comes after a number. $\endgroup$ – iKlsR Jul 8 '13 at 1:28
  • $\begingroup$ Ha! Never realized the number-prefix bits :D $\endgroup$ – Adhi Jul 8 '13 at 1:47

The Templates > Python menu item is getting quite long now.

1. x_templates

repository link

Here's an add-on that adds an extra sub-menu called x_templates to the Templates list, and dynamically creates sub-sub-menus


To make menu items all you have to do is add folders and files into the add-on's folder. The add-on does the rest.

enter image description here

Each of these folders (except the __pycache__ folder) contains some number of .py files.

2. Using self.path_menu

Add your own folder along side the existing folders.

enter image description here

self.path_menu(fullpath, "text.open", {"internal: True})

like this

bl_info = {
    "name": "Extra Templates",
    "author": "you",
    "version": (0, 1),
    "blender": (2, 7, 6),
    "category": "Text Editor"

import bpy

class TEXT_MT_templates_my_py(bpy.types.Menu):
    bl_label = "My Python"
    bl_idname = "OBJECT_MT_custom_py_menu"

    def draw(self, context):
            {"internal": True},

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

def register():

def unregister():

if __name__ == "__main__":

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.