Lazy Loading Extensions

This extension adds support for lazy loading extensions on demand.

Typically extensions implement a window that is opened using the menu. Until the menu is clicked extension is not required. A user doesn’t have to wait for the extension to load as part of app startup.

Extensions can specify [[trigger]] sections in extension.toml:

[[trigger]]
menu.name = "Windows/My Window" # menu path
menu.window = "MyWindow" # window name
menu.priority = 100 # menu priority

omni.app.setup finds all extensions with [[trigger]] section and adds a menu entry to the menu specified in menu.name. When the menu is clicked the extension is loaded and the window is opened using ui.Workspace.show_window API.

Also this extension could setup include list and exclude list for “lazy” menus.

[settings.exts."omni.app.setup".lazy_menu]
include_list = []
exclude_list = []

A “lazy” menu path will not be added if:

  • white list is not empty and menu path NOT in white list

  • black list is not empty and menu path IN black list