Extension: omni.kit.viewport.menubar.display-110.0.0 |
Documentation Generated: Aug 27, 2026 |
Usage Examples#
Add Custom Display Settings#
from omni.kit.viewport.menubar.display import get_instance
# Register a custom display setting
instance = get_instance()
instance.register_custom_setting("Custom Visibility", "/exts/my_extension/custom_visibility")

Add a Per-Viewport Custom Display Setting#
Instead of a static setting_path, register_custom_setting can take a get_setting_path_fn
callback. It receives the viewport_api and returns the setting path to bind for that viewport,
so the toggle is resolved per-viewport when the menu is built (the same pattern CategoryStateItem
uses for category items). Use a /persistent/ path so the toggle state is saved across sessions.
from omni.kit.viewport.menubar.display import get_instance
def _setting_path(viewport_api) -> str:
# One setting per viewport; "/persistent/" makes it survive restarts.
return f"/persistent/app/viewport/{viewport_api.id}/my_extension/custom_visibility/visible"
instance = get_instance()
instance.register_custom_setting("Custom Visibility", get_setting_path_fn=_setting_path)
Provide either setting_path or get_setting_path_fn; if both are omitted, the entry has nothing
to bind to and will not render (a warning is logged).

