Skip to content

Quick start

hannes edited this page Mar 4, 2023 · 12 revisions

1. Installation

PIP install the UniMenu python module to your Python path.

pip install unimenu

2. Create menu

a. from a dict

Once installed, you can run this code sample to create a new menu from a dict : my menu/test

import unimenu
data = {"label":"my menu", "items": [{"label": "test","command": 'print("hello world")'}]}
unimenu.setup(data)

b. from classes

import unimenu

menu = unimenu.dccs.blender.MenuNodeBlender(label="my submenu")  # create a submenu, parent defaults to the menu bar
item = unimenu.dccs.blender.MenuNodeBlender(label="hello", command='print("hello world")',
                                            parent="UNIMENU_MT_my_submenu")  # add menu item to our submenu
menu.items.append(item)  # add the item to the submenu
menu.setup()  # setup the menu

Now that you are setup and know the basics, you can choose how you'd like to use UniMenu. create menus from:

  • configs
  • classes
  • dict
  • a tools folder
Clone this wiki locally