Menu Layout#
This extension adds support for menu layout on demand.
Menu layout defined with omni.kit.menu.utils.MenuLayout could be replaced with [[settings.exts.”omni.app.setup”.menu_layout]] in kit file.
For example:
layout_menu = [
MenuLayout.Menu(
"Layout",
[
MenuLayout.Item("Default", source="Reset Layout"),
MenuLayout.Item("Viewport Only"),
MenuLayout.Seperator(),
MenuLayout.Item("Save Layout", source="Window/Layout/Save Layout..."),
MenuLayout.Item("Load Layout", source="Window/Layout/Load Layout..."),
MenuLayout.Seperator(),
MenuLayout.Seperator(),
MenuLayout.SubMenu("Utilities", [
MenuLayout.Group("Viewport", source="Window/Viewport"),
]),
],
),
MenuLayout.Menu(
"Window",
[
MenuLayout.SubMenu("Layout", [
MenuLayout.Item("Quick Save", remove=True),
MenuLayout.Item("Quick Load", remove=True),
]),
MenuLayout.Sort(exclude_items=["Extensions"], sort_submenus=True),
]
)
]
could be replaced with:
[settings.exts."omni.app.setup".menu_layout.Layout]
items = [
"Default=Reset Layout",
"Viewport Only",
"",
"Save Layout=Window/Layout/Save Layout...",
"Load Layout=Window/Layout/Load Layout...",
"",
"Utilities",
]
Utilities.type = "SubMenu"
Utilities.items = ["Viewport=Window/Viewport"]
Utilities.Viewport.type = "Group"
[settings.exts."omni.app.setup".menu_layout.Window]
items = ["Layout", "sort"]
Layout.type = "SubMenu"
Layout.items = ["-Quick Save", "-Quick Load"]
sort.type = "Sort"
sort.exclude_items = ["Extensions"]
sort.sort_submenus = true