UniMenu: Create custom menus in Blender from a config

update: There’s now a Blender add-on to quickly get started with setting up your custom menu, without having to create your own startup hook.

orginal post:
released unimenu, a python module that let’s you create menus easily from a config

image

Blender can be quiet complex. you have to make an operator, register it, hook up the menu draw function, etc…

With unimenu you can create a complex menu with just a few lines of code.

  1. create your config in yaml
items:
  - name: my menu
    items:
      - name: my item
        command: print("Hello World")
  1. run this to create your menu from the config
import openmenu
config_path = "c:/my_config_path"
openmenu.config_setup(config_path)

as a bonus this also works in unreal and maya


check out my other add-ons on my GitHub profile

3 Likes

renamed the repo to unimenu, since openmenu is trademarked and quite a popular name on github.
new link https://github.com/hannesdelbeke/unimenu

And added support for adding menus with code instead of a config

import unimenu
unimenu.add_item(label="my submenu")  # create a submenu, parent defaults to the menu bar
unimenu.add_item(label="hello", command='print("hello world")', parent="UNIMENU_MT_my_submenu")  # add menu item to our submenu

image

Created an add-on to help you quickly get started with setting up a custom menu. Lowering the technical bar for entry.