Skip to content

tahv/menuet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 

Repository files navigation

menuet

Source Documentation PyPI Pipeline Status

Menuet (/mə.nɥɛ/) is a declarative menu builder for DCC applications.

Features

  • Load menu from a TOML or JSON configuration, from a dict, from entry points, or build it programmatically.
  • Supports, 3ds Max, Maya, MotionBuilder and any PySide6 application.
  • Declare one or more menus in a dedicated .toml file.
  • Compose menu from multiple .toml files.
  • Declare a menu in a pyproject.toml.

Project Information

Important

Development takes place on Codeberg: codeberg.org/tahv/menuet.

Installation

pip install menuet

Usage

Create a menu configuration in TOML format.

# menu.toml
[[action]]
id = "print-hello"
label = "Print Hello"
cb = "print('Hello')"
group = "Separator"

[[action]]
id = "open-gui"
label = "Open GUI"
cb = "ep:myapp.gui:open_gui"
menu = ["Foo", "Bar"]

Load the above configuration into a Model and pass that model to a Menu Builder to create a menu.

from pathlib import Path
from menuet.builders.text import Render, TextMenuBuilder
from menuet.model import Model, loads

model = Model()
loads(Path("menu.toml").read_text(), model)

builder = TextMenuBuilder(model, root_menu="Demo", render=Render.UTF8)
print(builder.build())
Demo
├── Foo
│   └── Bar
│       └── Open GUI
├── Separator ───
└── Print Hello

For more information and examples, visit the documentation at tahv.codeberg.page/menuet.

Contributing

You'd like to use menuet with another application ? Feel free to open an issue, or read the contribution guidelines and open a pull request.

Alternatives

About

Declarative menu builder for DCC applications

Topics

Resources

Stars

Watchers

Forks

Contributors