H4nnes
October 3, 2022, 10:04am
1
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
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.
create your config in yaml
items:
- name: my menu
items:
- name: my item
command: print("Hello World")
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
easy consistent menus across apps: unreal, blender, maya, krita, substance painter, Katana, marmoset, 3ds max, cry-engine, FreeCAD, Hero, Nuke, Qt,... - GitHub - hannesdelbeke/unimenu: easy consis...
check out my other add-ons on my GitHub profile
3 Likes
H4nnes
December 29, 2022, 12:20pm
2
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
H4nnes
March 19, 2023, 11:37pm
3
Created an add-on to help you quickly get started with setting up a custom menu. Lowering the technical bar for entry.