Logo

omni.kit.menu.utils

  • Overview
  • Update menus
  • Layouts & Hooks
  • Menu Helpers
  • Examples
  • API (python)
    • Modules
      • omni.kit.menu.utils
        • Submodules
          • scripts
            • Submodules
              • actions
                • Classes
                • Functions
              • app_menu
                • Classes
                • Functions
              • builder_utils
                • Classes
                • Functions
              • debug_window
                • Classes
              • extension_window_helper
                • Classes
              • extension_window_helper_full
                • Classes
              • layout
                • Classes
                • Functions
              • utils
                • Classes
                • Functions
            • Classes
              • ActionMenuSubscription
              • IconMenuDelegate
              • LayoutSourceSearch
              • MenuActionControl
              • MenuAlignment
              • MenuHelperExtension
              • MenuHelperExtensionFull
              • MenuHelperWindow
              • MenuItemDescription
              • MenuItemOrder
              • MenuLayout
              • MenuState
              • MenuUtilsDebugExtension
              • MenuUtilsExtension
              • PrebuiltItemOrder
            • Functions
              • add_action_to_menu
              • add_hook
              • add_layout
              • add_menu_items
              • build_submenu_dict
              • get_action_path
              • get_debug_stats
              • get_instance
              • get_menu_layout
              • get_merged_menus
              • rebuild_menus
              • refresh_menu_items
              • remove_hook
              • remove_layout
              • remove_menu_items
              • replace_menu_items
              • set_default_menu_proirity
        • Classes
          • ActionMenuSubscription
          • IconMenuDelegate
          • LayoutSourceSearch
          • MenuActionControl
          • MenuAlignment
          • MenuHelperExtension
          • MenuHelperExtensionFull
          • MenuHelperWindow
          • MenuItemDescription
          • MenuItemOrder
          • MenuLayout
          • MenuState
          • MenuUtilsDebugExtension
          • MenuUtilsExtension
          • PrebuiltItemOrder
        • Functions
          • add_action_to_menu
          • add_hook
          • add_layout
          • add_menu_items
          • build_submenu_dict
          • get_action_path
          • get_debug_stats
          • get_instance
          • get_menu_layout
          • get_merged_menus
          • rebuild_menus
          • refresh_menu_items
          • remove_hook
          • remove_layout
          • remove_menu_items
          • replace_menu_items
          • set_default_menu_proirity
  • Changelog
Omniverse Kit
  • »
  • API (python) »
  • Modules »
  • omni.kit.menu.utils »
  • omni.kit.menu.utils Submodules »
  • omni.kit.menu.utils.scripts »
  • omni.kit.menu.utils.scripts Submodules »
  • omni.kit.menu.utils.scripts.builder_utils »
  • omni.kit.menu.utils.scripts.builder_utils Classes »
  • MenuItemDescription
  •  

MenuItemDescription

class omni.kit.menu.utils.scripts.builder_utils.MenuItemDescription(name: str = '', glyph: str = '', header: Optional[str] = None, appear_after: Union[list, str] = '', enabled: bool = True, ticked: bool = False, ticked_value: Optional[bool] = None, sub_menu=None, hotkey: Optional[Tuple[int, int]] = None, name_fn: Optional[Callable] = None, show_fn: Optional[Callable] = None, enable_fn: Optional[Callable] = None, ticked_fn: Optional[Callable] = None, onclick_action: Optional[Tuple] = None, unclick_action: Optional[Tuple] = None, onclick_fn: Optional[Callable] = None, unclick_fn: Optional[Callable] = None, onclick_right_fn: Optional[Callable] = None, original_svg_color: bool = False, original_menu_item=None, user={})

Bases: object

Class for creation of menu items

  • “name” is name shown on menu. (if name is “” then a menu spacer is added. Can be combined with show_fn)

  • “glyph” is icon shown on menu, full paths are allowed

  • “header” is None or string value & will add separator above item

  • “appear_after” is name of menu item to insert after. Used for appending menus, can be a list or string

  • “enabled” is True/False, True when item enabled

  • “ticked” menu item is ticked when True

  • “ticked_fn” function or list of functions used to decide if menu item is ticked

  • “ticked_value” is value used to decide if menu item is ticked

  • “sub_menu” is sub menu to this menu

  • “hotkey” is hotkey values for menu item

  • “name_fn” is function to get menu name

  • “show_fn” function or list of functions used to decide if menu item is shown. All functions must return True to show

  • “enable_fn” function or list of functions used to decide if menu item is enabled. All functions must return True to be enabled

  • “onclick_action” action called when user clicks menu item

  • “unclick_action” action called when user release’s button on menu item

  • “onclick_fn” function called when user clicks menu item (deprecated)

  • “unclick_fn” function called when user releases click on menu item (deprecated)

  • “onclick_right_fn” function called when user right clicks menu item (deprecated)

  • “original_svg_color” isn’t used (deprecated)

  • “user” is user dictionary that is passed to menu. NOTE: values will be added to this dictionary

Methods

__init__([name, glyph, header, ...])

add_on_delete_func(on_delete_fn)

add_on_hotkey_update_func(hotkey_update_fn)

get(key[, default_value])

get_action_mapping_desc()

has_action()

json_enc()

remove_on_delete_func(on_delete_fn)

remove_on_hotkey_update_func(hotkey_update_fn)

set_hotkey(hotkey)

Attributes

MAX_DEPTH

__init__(name: str = '', glyph: str = '', header: Optional[str] = None, appear_after: Union[list, str] = '', enabled: bool = True, ticked: bool = False, ticked_value: Optional[bool] = None, sub_menu=None, hotkey: Optional[Tuple[int, int]] = None, name_fn: Optional[Callable] = None, show_fn: Optional[Callable] = None, enable_fn: Optional[Callable] = None, ticked_fn: Optional[Callable] = None, onclick_action: Optional[Tuple] = None, unclick_action: Optional[Tuple] = None, onclick_fn: Optional[Callable] = None, unclick_fn: Optional[Callable] = None, onclick_right_fn: Optional[Callable] = None, original_svg_color: bool = False, original_menu_item=None, user={})

© Copyright 2019-2024, NVIDIA. Last updated on May 28, 2024.