file_path
stringlengths
5
148
content
stringlengths
0
526k
omni.kit.material.library.MaterialUtils.md
# MaterialUtils ## Overview Material library MaterialUtils class. Provides upto date cache of known materials in stage. ### Methods - `__init__()` - `add_cache_changed_fn(cache_changed_fn)` - Adds callback to material cache changed list. - `add_materials_from_stage_filter_func(filter_fn)` - Add filter callback function to get_materials_from_stage_async() callback. - `destroy()` - Destroy class and cleanup. - `flush_material_cache()` - Clear material cache. | Function Name | Description | |---------------|-------------| | get_materials_from_stage_async | Get list of materials for stage asynchronously. | | is_valid_material | Is prim a valid material. | | remove_cache_changed_fn | Remove callback to material cache changed list. | | remove_materials_from_stage_filter_func | Remove filter callback function from get_materials_from_stage_async() callback. | | stop | Stop traversing the stage | ### __init__() ### add_cache_changed_fn(cache_changed_fn: callable) Adds callback to material cache changed list. **Parameters:** - **cache_changed_fn** (callable) – Callback. ### add_materials_from_stage_filter_func(filter_fn: callable) Add filter callback function to get_materials_from_stage_async() callback. **Parameters:** - **filter_fn** (callable) – Filter function. ### destroy() Destroy class and cleanup. ### flush_material_cache() Clear material cache. ### get_materials_from_stage Get list of materials for stage. NOTE: This function can block on large stages. #### Parameters - **ext_filter_func** (callable) – filter function to remove material names from list. Optional. #### Returns - list of materials names #### Return type - (list) ### get_materials_from_stage_async Get list of materials for stage asynchronously. #### Parameters - **update_func** (callable) – function to call when new material names are available. - **wait_frames** (int) – number of frames to wait before starting to get materials list. - **ext_filter_func** (callable) – filter function to remove material names from list. Optional. ### is_valid_material Is prim a valid material. #### Parameters - **filter_funcs** (list) – List of additional functions to validate material prim. - **ext_filter_func** (callable) – Additional function to validate material prim. #### Returns - True if valid material otherwise False. #### Return type - (bool) ### remove_cache_changed_fn Remove callback to material cache changed list. #### Parameters - **cache_changed_fn** (callable) – callback function. ### Parameters #### cache_changed_fn (callable) – Callback. ### remove_materials_from_stage_filter_func (filter_fn: callable) Remove filter callback function from get_materials_from_stage_async() callback. #### Parameters ##### filter_fn (callable) – Filter function. ### stop () Stop traversing the stage
omni.kit.material.library.material_list_refresh.md
# material_list_refresh ## material_list_refresh Remove custom material, this will also get removed from context menu Create menu. ### Parameters - **name** (str) – Material name. - **refresh** (bool) – Refresh UI Flag.
omni.kit.material.library.md
# omni.kit.material.library ## Classes Summary: - **CreateAndBindMdlMaterialFromLibrary** - Creates material prim from Core MDL Library. - **CreateAndBindPreviewSurfaceFromLibrary** - Creates PreviewSurface material prim. - **CreateAndBindPreviewSurfaceTextureFromLibrary** - Creates PreviewSurfaceTexture material prim. - **MaterialLibraryExtension** - Material extension class. - **MaterialUtils** - Material library MaterialUtils class. Provides upto date cache of known materials in stage. - **UpdateState** - State of cache of known materials in stage, passed to update_func. ## Functions Summary: - **add_cache_changed_fn** - Adds callback to material cache changed list. - **add_material_list_item** - Add custom material, this will also get added to context menu Create menu. - **add_material_list_refresh_callback** - Add callback to trigger when material library UI refreshes. - **add_materials_from_stage_filter_func** - (Function description not provided in the HTML snippet) | 功能 | 描述 | | --- | --- | | add_to_mtl_lib | Add custom folder to list of folders to generate context menu “Create/Materials” from. | | add_usd_source_asset_path_to_mtl_lib | Adds a material to the context menu. | | bind_material_to_prims_dialog | Show dialog to user, so they can select material and bind to prims. | | bind_material_to_selected_prims | Bind material to selected prims. | | build_material_combobox_ui | Deprecated & not used. Build simulated combobox in conjunction with MaterialListBoxWidget. | | create_mdl_material | Create material prim from .mdl file. | | create_mtlx_material | Create materialX prim from .mdl file. | | custom_material_dialog | Show custom material dialog. | | delayed_material_list_refresh | Async refresh material_list. | | destroy_material_utils | Destroy material_utils. This should only be called from omni.kit.material.library on_shutdown. | | drop_material | Build bind material menu UI. | | get_instance | Get MaterialLibraryExtension instance. | | get_material_enums | Get material Enum data. | | get_material_filename_from_prim | Gets material thumbnail image path for prim. | | get_material_hidden_list | Gets list of hidden materials, which is /exts/omni.kit.material.library/ui_hidden_list. | | get_material_list | Builds a list of materials and other information, used by omni.kit.context_menu and omni.kit.menu.create | | get_material_prim_path | Make valid material prim path from material_prim_name. | | get_materials_from_stage | Get list of materials for stage. NOTE: This function can block on large stages. | | get_materials_from_stage_async | Get list of materials for stage asynchronously. | | get_mdl_lib_paths | | ## Functions - **get_mdl_lib_paths** - Get material library paths. Which is “/exts/omni.kit.material.library/lib_paths” - **get_mdl_list** - Gets list of materials asynchronously. Can return [] if mdl_list_cache is not complete yet. - **get_mdl_list_async** - Gets list of materials asynchronously. Can wait if mdl_list_cache is not complete yet. - **get_mdl_usd_source_asset_list** - Get material source asset file, from “/exts/omni.kit.material.library/usd_source_asset_list”. - **get_prim_children_paths** - Get all child prims from prim_path. - **get_subidentifier_from_material** - get sub-identifier list from material prim asynchronously. - **get_subidentifier_from_mdl** - get sub-identifier list from mdl file asynchronously. - **initalize_material_utils** - Initialize material_utils. This should only be called from omni.kit.material.library on_startup. - **material_list_refresh** - Remove custom material, this will also get removed from context menu Create menu. - **multi_descendents_dialog** - Show multi descendants dialog. - **remove_cache_changed_fn** - Remove callback to material cache changed list. - **remove_from_mtl_lib** - Remove custom folder to list of folders to generate context menu “Create/Materials” from. - **remove_material_list_item** - Remove custom material, this will also get removed from context menu Create menu. - **remove_material_list_refresh_callback** - Remove callback to trigger when material library UI refreshes. - **remove_materials_from_stage_filter_func** - Remove filter callback function from get_materials_from_stage_async() callback. - **remove_mdl_from_cache** - Remove material from cache. Call by Material Watcher when re-loading modified mdl files. - **remove_usd_source_asset_path_from_mtl_lib** - Removes a material from the context menu.
omni.kit.material.library.multi_descendents_dialog.md
# multi_descendents_dialog ## multi_descendents_dialog ```python omni.kit.material.library.multi_descendents_dialog(prim_paths: list, on_click_fn: callable) ``` Show multi descendants dialog. ### Parameters - **prim_paths** (list) – Prim path list. - **apply_material_fn** (callable) – Prim selected callback. ```
omni.kit.material.library.remove_cache_changed_fn.md
# remove_cache_changed_fn ## remove_cache_changed_fn ```python omni.kit.material.library.remove_cache_changed_fn(cache_changed_fn: callable) ``` Remove callback to material cache changed list. ### Parameters - **cache_changed_fn** (callable) – Callback. ```
omni.kit.material.library.remove_from_mtl_lib.md
# remove_from_mtl_lib  ## remove_from_mtl_lib  ### omni.kit.material.library.remove_from_mtl_lib  #### remove_from_mtl_lib(folder_paths: list[str]) -> list[str] Remove custom folder to list of folders to generate context menu “Create/Materials” from. ##### Parameters - **folder_paths** (list) – List of folder paths to remove. ##### Returns - Updated list of folders to generate context menu “Create/Materials” from. ##### Return type - (list)
omni.kit.material.library.remove_materials_from_stage_filter_func.md
# remove_materials_from_stage_filter_func ## remove_materials_from_stage_filter_func ```python omni.kit.material.library.remove_materials_from_stage_filter_func(filter_fn: callable) ``` Remove filter callback function from get_materials_from_stage_async() callback. **Parameters** - **filter_fn** (callable) – Filter function.
omni.kit.material.library.remove_material_list_item.md
# remove_material_list_item ## remove_material_list_item ```python omni.kit.material.library.remove_material_list_item(name: str, refresh: bool = True) ``` Remove custom material, this will also get removed from context menu Create menu. ### Parameters - **name** (str) – Material name. - **refresh** (bool) – Refresh UI Flag.
omni.kit.material.library.remove_material_list_refresh_callback.md
# remove_material_list_refresh_callback ## remove_material_list_refresh_callback ```python omni.kit.material.library.remove_material_list_refresh_callback(on_refresh_fn: callable) ``` Remove callback to trigger when material library UI refreshes. ### Parameters - **on_refresh_fn** (callable) – Callback to be removed.
omni.kit.material.library.remove_mdl_from_cache.md
# remove_mdl_from_cache ## remove_mdl_from_cache ```python omni.kit.material.library.remove_mdl_from_cache(shader_prim_path: str) ``` Remove material from cache. Call by Material Watcher when re-loading modified mdl files. **Parameters** - **shader_prim_path** (str) – material prim path.
omni.kit.material.library.remove_usd_source_asset_path_from_mtl_lib.md
# remove_usd_source_asset_path_from_mtl_lib ## remove_usd_source_asset_path_from_mtl_lib Removes a material from the context menu. ### Parameters - **source_asset_path** (str) – The USD Identifier corresponding to the source asset path of a USD Shader Node. - **source_asset_subid** (str) – The USD Sub-identifier corresponding to the source asset sub-identifier of a USD Shader Node.
omni.kit.material.library.UpdateState.md
# UpdateState ## UpdateState ```python class omni.kit.material.library.UpdateState(value) ``` Bases: `Enum` State of cache of known materials in stage, passed to update_func. ### Attributes | Attribute | Description | |-----------|-------------| | `UPDATE` | Cache is updating & partial list of materials is passed. | | `UPDATE_COMPLETE` | Cache has finished updating & partial list of materials is passed. | | `COMPLETE_LIST` | Cache has finished updating & complete list of materials is passed. | ```python def __init__(self): pass ``` ```python COMPLETE_LIST = 3 ``` Cache has finished updating & complete list of materials is passed. ### UPDATE ``` UPDATE = 1 ``` Cache is updating & partial list of materials is passed. ``` ### UPDATE_COMPLETE ``` UPDATE_COMPLETE = 2 ``` Cache has finished updating & partial list of materials is passed. ```
omni.kit.menu.core.Classes.md
# omni.kit.menu.core Classes ## Classes Summary - **DictReadOnly** - Read-only dictionary. Prevents accidental write-backs to dictionary. - **IconMenuBaseDelegate** - Icon Menu Delegate class. - **uiMenu** - ui.Menu subclass. Has glyph, menu_checkable, menu_hotkey_text, submenu and parent_menu properties - **uiMenuItem** - ui.MenuItem subclass. Has glyph, menu_checkable, menu_hotkey_text and parent_menu properties
omni.kit.menu.core.DictReadOnly.md
# DictReadOnly ## DictReadOnly ### Class: omni.kit.menu.core.DictReadOnly(data) **Bases:** `Mapping` **Description:** Read-only dictionary. Prevents accidental write-backs to dictionary. ### Methods | Method | Description | |--------|-------------| | `__init__(data)` | | | `copy()` | | | `merge_dict(other)` | | #### `__init__(data)`
omni.kit.menu.core.Functions.md
# omni.kit.menu.core Functions ## Functions Summary: | Function Name | Description | |---------------|-------------| | has_delegate_func | Checks if delegate class has func_name function. |
omni.kit.menu.core.has_delegate_func.md
# has_delegate_func ## has_delegate_func Checks if delegate class has func_name function. ### Function Definition ```python omni.kit.menu.core.has_delegate_func(delegate, func_name) ``` Checks if delegate class has func_name function. ``` ```
omni.kit.menu.core.IconMenuBaseDelegate.md
# IconMenuBaseDelegate ## IconMenuBaseDelegate ```python class omni.kit.menu.core.IconMenuBaseDelegate(**kwargs) ``` **Bases:** `MenuDelegate` **Description:** Icon Menu Delegate class. ### Methods | Method | Description | |--------|-------------| | `__init__(self, **kwargs)` | Constructor. | | `build_item(item)` | Build menu omni.ui for item, only uiMenu or uiMenuItem are handled by this function, anything else is handled by the ui.MenuDelegate base-class. | | `get_style()` | Get current style | | `load_settings(extension)` | Loads settings from /exts/{extension}/* which control how menus are built. | ### Attributes | Attribute | Description | |-----------|-------------| <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.menu.core.IconMenuBaseDelegate.__init__"> <span class="sig-name descname"> <span class="pre"> __init__ </span> </span> <span class="sig-paren"> ( </span> <em class="sig-param"> <span class="n"> <span class="pre"> self </span> </span> <span class="p"> <span class="pre"> : </span> </span> <span class="w"> </span> <span class="n"> <span class="pre"> omni.ui._ui.MenuDelegate </span> </span> </em> , <em class="sig-param"> <span class="o"> <span class="pre"> ** </span> </span> <span class="n"> <span class="pre"> kwargs </span> </span> </em> <span class="sig-paren"> ) </span> <span class="sig-return"> <span class="sig-return-icon"> → </span> <span class="sig-return-typehint"> <span class="pre"> None </span> </span> </span> </dt> <dd> <p> Constructor. </p> <blockquote> <div> <dl class="simple"> <dt> `kwargs <span class="classifier"> dict` </span> </dt> <dd> <p> See below </p> </dd> </dl> </div> </blockquote> <p> ### Keyword Arguments: </p> <blockquote> <div> <dl class="simple"> <dt> `on_build_item <span class="classifier"> ` </span> </dt> <dd> <p> Called to create a new item. </p> </dd> <dt> `on_build_title <span class="classifier"> ` </span> </dt> <dd> <p> Called to create a new title. </p> </dd> <dt> `on_build_status <span class="classifier"> ` </span> </dt> <dd> <p> Called to create a new widget on the bottom of the window. </p> </dd> <dt> `propagate <span class="classifier"> ` </span> </dt> <dd> <p> Determine if Menu children should use this delegate when they don’t have the own one. </p> </dd> </dl> </div> </blockquote> </dd> </dl> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.menu.core.IconMenuBaseDelegate.build_item"> <span class="sig-name descname"> <span class="pre"> build_item </span> </span> <span class="sig-paren"> ( </span> <em class="sig-param"> <span class="n"> <span class="pre"> item </span> </span> <span class="p"> <span class="pre"> : </span> </span> <span class="w"> </span> <span class="n"> <span class="pre"> Widget </span> </span> </em> <span class="sig-paren"> ) </span> </dt> <dd> <p> Build menu omni.ui for item, only uiMenu or uiMenuItem are handled by this function, anything else is handled by the ui.MenuDelegate base-class. Can be overridden on subclass along with _build_item_header, _build_item_tick, _build_item_glyph, _build_item_label, _build_item_hotkey, _build_item_subdir. </p> </dd> </dl> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.menu.core.IconMenuBaseDelegate.get_style"> <span class="sig-name descname"> <span class="pre"> get_style </span> </span> <span class="sig-paren"> ( </span> <span class="sig-paren"> ) </span> </dt> <dd> <p> Get current style </p> </dd> </dl> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.menu.core.IconMenuBaseDelegate.load_settings"> <span class="sig-name descname"> <span class="pre"> load_settings </span> </span> <span class="sig-paren"> ( </span> <em class="sig-param"> <span class="n"> <span class="pre"> extension </span> </span> </em> <span class="sig-paren"> ) </span> </dt> <dd> <p> Loads settings from /exts/{extension}/* which control how menus are built. Values read are; icon_size (float), text_size (float), tick_size (float), tick_spacing ([float, float]), margin_size ([float, float]), root_spacing (float), submenu_pre_spacing (float), submenu_spacing (float), submenu_icon_size (float), item_spacing ([float, float]), icon_spacing ([float, float]), hotkey_spacing ([float, float]), color_label_enabled (int), color_label_disabled (int), color_tick_enabled (int), color_tick_disabled (int), color_separator (int), </p> </dd> </dl>
omni.kit.menu.core.md
# omni.kit.menu.core ## Submodules Summary: - **omni.kit.menu.core.scripts** - Core menu class. Used by omni.kit.menu.utils and omni.kit.context_menu to build menus. ## Classes Summary: - **DictReadOnly** - Read-only dictionary. Prevents accidental write-backs to dictionary. - **IconMenuBaseDelegate** - Icon Menu Delegate class. - **uiMenu** - ui.Menu subclass. Has glyph, menu_checkable, menu_hotkey_text, submenu and parent_menu properties - **uiMenuItem** - ui.MenuItem subclass. Has glyph, menu_checkable, menu_hotkey_text and parent_menu properties ## Functions Summary: - **has_delegate_func** - Checks if delegate class has func_name function.
omni.kit.menu.core.scripts.core.Functions.md
# omni.kit.menu.core.scripts.core Functions ## Functions Summary: | Function | Description | |----------|-------------| | [has_delegate_func](omni.kit.menu.core.scripts.core/omni.kit.menu.core.scripts.core.has_delegate_func.html) | Checks if delegate class has func_name function. |
omni.kit.menu.core.scripts.core.md
# omni.kit.menu.core.scripts.core ## Classes Summary: | Class | Description | | --- | --- | | [DictReadOnly](omni.kit.menu.core.scripts.core/omni.kit.menu.core.scripts.core.DictReadOnly.html) | Read-only dictionary. Prevents accidental write-backs to dictionary. | | [IconMenuBaseDelegate](omni.kit.menu.core.scripts.core/omni.kit.menu.core.scripts.core.IconMenuBaseDelegate.html) | Icon Menu Delegate class. | | [uiMenu](omni.kit.menu.core.scripts.core/omni.kit.menu.core.scripts.core.uiMenu.html) | ui.Menu subclass. Has glyph, menu_checkable, menu_hotkey_text, submenu and parent_menu properties | | [uiMenuItem](omni.kit.menu.core.scripts.core/omni.kit.menu.core.scripts.core.uiMenuItem.html) | ui.MenuItem subclass. Has glyph, menu_checkable, menu_hotkey_text and parent_menu properties | ## Functions Summary: | Function | Description | | --- | --- | | [has_delegate_func](omni.kit.menu.core.scripts.core/omni.kit.menu.core.scripts.core.has_delegate_func.html) | Checks if delegate class has func_name function. |
omni.kit.menu.core.scripts.DictReadOnly.md
# DictReadOnly ## DictReadOnly ### Methods - `__init__(data)` - `copy()` - `merge_dict(other)` ### `__init__(data)`
omni.kit.menu.core.scripts.has_delegate_func.md
# has_delegate_func ## has_delegate_func Checks if delegate class has func_name function. ### Function Details ```python omni.kit.menu.core.scripts.has_delegate_func(delegate, func_name) ``` - **Description**: Checks if delegate class has func_name function. ```
omni.kit.menu.core.scripts.Submodules.md
# omni.kit.menu.core.scripts Submodules ## Submodules Summary - [omni.kit.menu.core.scripts.core](./omni.kit.menu.core.scripts.core.html) - Core menu class. Used by omni.kit.menu.utils and omni.kit.context_menu to build menus.
omni.kit.menu.core.scripts.uiMenu.md
# uiMenu ## Class: omni.kit.menu.core.scripts.uiMenu ```python class omni.kit.menu.core.scripts.uiMenu(*args, **kwargs) ``` Bases: `Menu` ui.Menu subclass. Has glyph, menu_checkable, menu_hotkey_text, submenu and parent_menu properties ### Methods | Method | Description | |--------|-------------| | `__init__(self[, text])` | Construct Menu. | ### Attributes | Attribute | Description | |-----------|-------------| ``` ### `__init__` Method ```python def __init__(self, text: str = '') ``` Construct Menu. <dl class="simple"> <dt> `text :` </dt> <dd> <p> The text for the menu. </p> </dd> <dt> `kwargs <span class="classifier"> dict` </span> </dt> <dd> <p> See below </p> </dd> </dl> <p> ### Keyword Arguments: </p> <blockquote> <div> <dl class="simple"> <dt> `tearable <span class="classifier"> bool` </span> </dt> <dd> <p> The ability to tear the window off. </p> </dd> <dt> `shown_changed_fn <span class="classifier"> ` </span> </dt> <dd> <p> If the pulldown menu is shown on the screen. </p> </dd> <dt> `teared_changed_fn <span class="classifier"> ` </span> </dt> <dd> <p> If the window is teared off. </p> </dd> <dt> `on_build_fn <span class="classifier"> ` </span> </dt> <dd> <p> Called to re-create new children. </p> </dd> <dt> `text <span class="classifier"> str` </span> </dt> <dd> <p> This property holds the menu’s text. </p> </dd> <dt> `hotkey_text <span class="classifier"> str` </span> </dt> <dd> <p> This property holds the menu’s hotkey text. </p> </dd> <dt> `checkable <span class="classifier"> bool` </span> </dt> <dd> <p> This property holds whether this menu item is checkable. A checkable item is one which has an on/off state. </p> </dd> <dt> `hide_on_click <span class="classifier"> bool` </span> </dt> <dd> <p> Hide or keep the window when the user clicked this item. </p> </dd> <dt> `delegate <span class="classifier"> MenuDelegate` </span> </dt> <dd> <p> The delegate that generates a widget per menu item. </p> </dd> <dt> `triggered_fn <span class="classifier"> void` </span> </dt> <dd> <p> Sets the function that is called when an action is activated by the user; for example, when the user clicks a menu option, or presses an action’s shortcut key combination. </p> </dd> <dt> `direction <span class="classifier"> ` </span> </dt> <dd> <p> This type is used to determine the direction of the layout. If the Stack’s orientation is eLeftToRight the widgets are placed in a horizontal row, from left to right. If the Stack’s orientation is eRightToLeft the widgets are placed in a horizontal row, from right to left. If the Stack’s orientation is eTopToBottom, the widgets are placed in a vertical column, from top to bottom. If the Stack’s orientation is eBottomToTop, the widgets are placed in a vertical column, from bottom to top. If the Stack’s orientation is eBackToFront, the widgets are placed sorted in a Z-order in top right corner. If the Stack’s orientation is eFrontToBack, the widgets are placed sorted in a Z-order in top right corner, the first widget goes to front. </p> </dd> <dt> `content_clipping <span class="classifier"> ` </span> </dt> <dd> <p> Determines if the child widgets should be clipped by the rectangle of this Stack. </p> </dd> <dt> `spacing <span class="classifier"> ` </span> </dt> <dd> <p> Sets a non-stretchable space in pixels between child items of this layout. </p> </dd> <dt> `send_mouse_events_to_back <span class="classifier"> ` </span> </dt> <dd> <p> When children of a Z-based stack overlap mouse events are normally sent to the topmost one. Setting this property true will invert that behavior, sending mouse events to the bottom-most child. </p> </dd> <dt> `width <span class="classifier"> ui.Length` </span> </dt> <dd> <p> This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen. </p> </dd> <dt> `height <span class="classifier"> ui.Length` </span> </dt> <dd> <p> This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen. </p> </dd> <dt> `name <span class="classifier"> str` </span> </dt> <dd> <p> The name of the widget that user can set. </p> </dd> <dt> `style_type_name_override <span class="classifier"> str` </span> </dt> <dd> <p> By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style. </p> </dd> <dt> `identifier <span class="classifier"> str` </span> </dt> <dd> <p> An optional identifier of the widget we can use to refer to it in queries. </p> </dd> <dt> `visible <span class="classifier"> bool` </span> </dt> <dd> <p> This property holds whether the widget is visible. </p> </dd> <dt> `visibleMin <span class="classifier"> float` </span> </dt> <dd> <p> If the current zoom factor and DPI is less than this value, the widget is not visible. </p> </dd> <dt> `visibleMax <span class="classifier"> float` </span> </dt> <dd> <p> If the current zoom factor and DPI is bigger than this value, the widget is not visible. </p> </dd> </dl> </div> </blockquote> <dl> <dt> `tooltip <span class="classifier"> str` </span> </dt> <dd> <p> Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style </p> </dd> <dt> `tooltip_fn <span class="classifier"> Callable` </span> </dt> <dd> <p> Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly. </p> </dd> <dt> `tooltip_offset_x <span class="classifier"> float` </span> </dt> <dd> <p> Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown. </p> </dd> <dt> `tooltip_offset_y <span class="classifier"> float` </span> </dt> <dd> <p> Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown. </p> </dd> <dt> `enabled <span class="classifier"> bool` </span> </dt> <dd> <p> This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled. </p> </dd> <dt> `selected <span class="classifier"> bool` </span> </dt> <dd> <p> This property holds a flag that specifies the widget has to use eSelected state of the style. </p> </dd> <dt> `checked <span class="classifier"> bool` </span> </dt> <dd> <p> This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked. </p> </dd> <dt> `dragging <span class="classifier"> bool` </span> </dt> <dd> <p> This property holds if the widget is being dragged. </p> </dd> <dt> `opaque_for_mouse_events <span class="classifier"> bool` </span> </dt> <dd> <p> If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either </p> </dd> <dt> `skip_draw_when_clipped <span class="classifier"> bool` </span> </dt> <dd> <p> The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list. </p> </dd> <dt> `mouse_moved_fn <span class="classifier"> Callable` </span> </dt> <dd> <p> Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier) </p> </dd> <dt> `mouse_pressed_fn <span class="classifier"> Callable` </span> </dt> <dd> <p> Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key. </p> </dd> <dt> `mouse_released_fn <span class="classifier"> Callable` </span> </dt> <dd> <p> Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) </p> </dd> <dt> `mouse_double_clicked_fn <span class="classifier"> Callable` </span> </dt> <dd> <p> Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) </p> </dd> <dt> `mouse_wheel_fn <span class="classifier"> Callable` </span> </dt> <dd> <p> Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier) </p> </dd> <dt> `mouse_hovered_fn <span class="classifier"> Callable` </span> </dt> <dd> <p> Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered) </p> </dd> <dt> `drag_fn <span class="classifier"> Callable` </span> </dt> <dd> <p> Specify that this Widget is draggable, and set the callback that is attached to the drag operation. </p> </dd> <dt> `accept_drop_fn <span class="classifier"> Callable` </span> </dt> <dd> <p> Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted. </p> </dd> <dt> `drop_fn <span class="classifier"> Callable` </span> </dt> <dd> <p> Specify that this Widget accepts drops and set the callback to the drop operation. </p> </dd> <dt> `computed_content_size_changed_fn <span class="classifier"> Callable` </span> </dt> <dd> <p> Called when the size of the widget is changed. </p> </dd> </dl>
omni.kit.menu.core.scripts.uiMenuItem.md
# uiMenuItem ## Class: omni.kit.menu.core.scripts.uiMenuItem ### Constructor ```python __init__(self, arg0, **kwargs) ``` Construct MenuItem. ### Attributes - No attributes listed. ### Method Details ```python __init__(self, arg0: str, **kwargs) ``` Constructs a new instance of the `uiMenuItem` class. ``` Construct MenuItem. ### Keyword Arguments: - `text (str)`: This property holds the menu’s text. - `hotkey_text (str)`: This property holds the menu’s hotkey text. - `checkable (bool)`: This property holds whether this menu item is checkable. A checkable item is one which has an on/off state. - `hide_on_click (bool)`: Hide or keep the window when the user clicked this item. - `delegate (MenuDelegate)`: The delegate that generates a widget per menu item. - `triggered_fn (void)`: Sets the function that is called when an action is activated by the user; for example, when the user clicks a menu option, or presses an action’s shortcut key combination. - `width (ui.Length)`: This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen. - `height (ui.Length)`: This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen. - `name (str)`: The name of the widget that user can set. - `style_type_name_override (str)`: By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style. - `identifier (str)`: An optional identifier of the widget we can use to refer to it in queries. - `visible (bool)`: This property holds whether the widget is visible. - `visibleMin (float)`: If the current zoom factor and DPI is less than this value, the widget is not visible. - `visibleMax (float)`: If the current zoom factor and DPI is bigger than this value, the widget is not visible. - `tooltip (str)`: Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style. - `tooltip_fn (Callable)`: Set dynamic tooltip that will be created dynamically the first time it is needed. The function is called inside a ui.Frame scope that the widget will be parented correctly. - `tooltip_offset_x (float)`: Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown. - `tooltip_offset_y (float)`: Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown. - `enabled (bool)`: This property holds whether the widget is enabled. In general, an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled. - `selected (bool)`: This property holds a flag that specifies the widget has to use eSelected state of the style. - `checked (bool)`: This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked. - `dragging (bool)`: This property holds if the widget is being dragged. - `opaque_for_mouse_events (bool)`: If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either. <dl> <dt> `skip_draw_when_clipped <span class="classifier"> bool` </span> </dt> <dd> <p> The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list. </p> </dd> <dt> `mouse_moved_fn <span class="classifier"> Callable` </span> </dt> <dd> <p> Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier) </p> </dd> <dt> `mouse_pressed_fn <span class="classifier"> Callable` </span> </dt> <dd> <p> Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key. </p> </dd> <dt> `mouse_released_fn <span class="classifier"> Callable` </span> </dt> <dd> <p> Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) </p> </dd> <dt> `mouse_double_clicked_fn <span class="classifier"> Callable` </span> </dt> <dd> <p> Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) </p> </dd> <dt> `mouse_wheel_fn <span class="classifier"> Callable` </span> </dt> <dd> <p> Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier) </p> </dd> <dt> `mouse_hovered_fn <span class="classifier"> Callable` </span> </dt> <dd> <p> Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered) </p> </dd> <dt> `drag_fn <span class="classifier"> Callable` </span> </dt> <dd> <p> Specify that this Widget is draggable, and set the callback that is attached to the drag operation. </p> </dd> <dt> `accept_drop_fn <span class="classifier"> Callable` </span> </dt> <dd> <p> Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted. </p> </dd> <dt> `drop_fn <span class="classifier"> Callable` </span> </dt> <dd> <p> Specify that this Widget accepts drops and set the callback to the drop operation. </p> </dd> <dt> `computed_content_size_changed_fn <span class="classifier"> Callable` </span> </dt> <dd> <p> Called when the size of the widget is changed. </p> </dd> </dl>
omni.kit.menu.core.Submodules.md
# omni.kit.menu.core Submodules ## omni.kit.menu.core Submodules ### Submodules Summary: | Module | Description | |--------|-------------| | [omni.kit.menu.core.scripts](omni.kit.menu.core.scripts.html) | Core menu class. Used by omni.kit.menu.utils and omni.kit.context_menu to build menus. |
omni.kit.menu.core.uiMenuItem.md
# uiMenuItem ## Class: omni.kit.menu.core.uiMenuItem(*args, **kwargs) Bases: `MenuItem` ui.MenuItem subclass. Has glyph, menu_checkable, menu_hotkey_text and parent_menu properties ### Methods | Method | Description | |--------|-------------| | `__init__(self, arg0, **kwargs)` | Construct MenuItem. | ### Attributes | Attribute | Description | |-----------|-------------| ## `__init__(self, arg0, **kwargs)` Construct MenuItem. - `self` : `omni.ui._ui.MenuItem` - `arg0` : `str` - `**kwargs` Returns: `None` <dl> <dt> `mouse_moved_fn <span class="classifier"> Callable` </span> </dt> <dd> <p> Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier) </p> </dd> <dt> `mouse_pressed_fn <span class="classifier"> Callable` </span> </dt> <dd> <p> Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key. </p> </dd> <dt> `mouse_released_fn <span class="classifier"> Callable` </span> </dt> <dd> <p> Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) </p> </dd> <dt> `mouse_double_clicked_fn <span class="classifier"> Callable` </span> </dt> <dd> <p> Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) </p> </dd> <dt> `mouse_wheel_fn <span class="classifier"> Callable` </span> </dt> <dd> <p> Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier) </p> </dd> <dt> `mouse_hovered_fn <span class="classifier"> Callable` </span> </dt> <dd> <p> Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered) </p> </dd> <dt> `drag_fn <span class="classifier"> Callable` </span> </dt> <dd> <p> Specify that this Widget is draggable, and set the callback that is attached to the drag operation. </p> </dd> <dt> `accept_drop_fn <span class="classifier"> Callable` </span> </dt> <dd> <p> Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted. </p> </dd> <dt> `drop_fn <span class="classifier"> Callable` </span> </dt> <dd> <p> Specify that this Widget accepts drops and set the callback to the drop operation. </p> </dd> <dt> `computed_content_size_changed_fn <span class="classifier"> Callable` </span> </dt> <dd> <p> Called when the size of the widget is changed. </p> </dd> </dl>
omni.kit.menu.utils.ActionMenuSubscription.md
# ActionMenuSubscription ## ActionMenuSubscription - **Bases:** `object` - **Description:** Action menu subscription wrapper to make it scoped (auto unsubscribe on del) (deprecated) ### Methods - **`__init__(_on_del: Callable)`** - **`unsubscribe()`** ### `__init__(_on_del: Callable)` ``` ```
omni.kit.menu.utils.add_action_to_menu.md
# add_action_to_menu ## add_action_to_menu ### omni.kit.menu.utils.add_action_to_menu Add action to menu path. (deprecated) This function binds passed callable `on_action` function with `carb.input` action and a menu path together. If `default_hotkey` is provided it is set into settings and appears on the menu. **Parameters** - **menu_path** – menu path. E.g. “File/Open”. - **on_action** – function to be called as an action. - **on_rmb_click** – function to be called when right mouse button clicked. - **action_name** – action name. If not provided menu path is used as action, where all ‘/’ are replaced with ‘-‘. - **default_hotkey** (tuple(int, `carb.input.KeyboardInput`)) – modifier and key tuple to associate with given action. **Returns** Subscription holder object. Action is removed when this object is destroyed.
omni.kit.menu.utils.add_hook.md
# add_hook ## add_hook ```python omni.kit.menu.utils.add_hook(callback: Callable) ``` add a menu modification callback hook callback is function to be called when menus are re-generated ```
omni.kit.menu.utils.add_layout.md
# add_layout ## add_layout ```python omni.kit.menu.utils.add_layout(layout: List[Union[Menu, SubMenu, Item, Seperator, Group]]) ``` add a menu layout. ```
omni.kit.menu.utils.add_menu_items.md
# add_menu_items ## add_menu_items ```python omni.kit.menu.utils.add_menu_items(menu: list, name: str, menu_index: int = 0, can_rebuild_menus: bool = True, delegate: ui.MenuDelegate = None) ``` add a list of menus items to menu. menu is list of MenuItemDescription() name is name to appear when menu is collapsed menu_index is horizontal positioning can_rebuild_menus is flag to call rebuild_menus when True delegate ui.MenuDelegate delegate ``` ---
omni.kit.menu.utils.build_submenu_dict.md
# build_submenu_dict ## build_submenu_dict ```python omni.kit.menu.utils.build_submenu_dict(menu_list: list, glyph: Optional[str] = None) ``` builds a dictionary of List[MenuItemDescription] with sub_menus from List[MenuItemDescription] with full paths. EG: “/Window/Viewport/Viewport 1” ```
omni.kit.menu.utils.Classes.md
# omni.kit.menu.utils Classes ## Classes Summary: - **ActionMenuSubscription** - Action menu subscription wrapper to make it scoped (auto unsubscribe on del) (deprecated) - **IconMenuDelegate** - Icon Menu Delegate class. - **LayoutSourceSearch** - Controls how layouts search for the menu item paths, either everywhere or just in the local menu group - **MenuActionControl** - Setting for executing actions. Either NODELAY which is executed instantly or NONE which is async with 1 frame delay - **MenuAlignment** - Menu alignment setting. Either left or right - **MenuHelperExtension** - Simple helper class for adding/removing “Window” menu to your extension. ui.Window creation/show/hide is still down to user to provide functionally. - **MenuHelperExtensionFull** - Advanced helper class for adding/removing “Window” menu to your extension & controlling ui.Window creation/show/hide. Only thing required is function to create ui_window - **MenuHelperWindow** - The Window class represents a window in the underlying windowing system. - **MenuItemDescription** - Class for creation of menu items - **MenuItemOrder** - “appear_after” values. FIRST will be top of list and LAST will be bottom of list. | 奇数行 | 偶数行 | |--------|--------| | MenuLayout | Layout implementation class. See “Layouts and & Hooks” section | | MenuState | Internal state. Invalid is before EVENT_APP_READY event received and Created is after. | | MenuUtilsDebugExtension | Menu debug window. Press “SHIFT+CONTROL+ALT+M” to open. | | MenuUtilsExtension | Menu implementation class. | | PrebuiltItemOrder | Internal flags used by layout for item ordering |
omni.kit.menu.utils.Functions.md
# omni.kit.menu.utils Functions ## Functions Summary - **add_action_to_menu** - Add action to menu path. (deprecated) - **add_hook** - add a menu modification callback hook - **add_layout** - add a menu layout. - **add_menu_items** - add a list of menus items to menu. - **build_submenu_dict** - builds a dictionary of List[MenuItemDescription] with sub_menus from List[MenuItemDescription] with full paths. EG: “/Window/Viewport/Viewport 1” - **get_action_path** - converts menu path into internal path - **get_debug_stats** - gets debug stats as dictionary, info on what functions called and how many times. - **get_instance** - get MenuUtilsExtension class ptr - **get_menu_layout** - get menu layouts. - **get_merged_menus** - get combined menus as dictionary - **rebuild_menus** - force menus to rebuild, triggering hooks | HTML Content | Markdown Content | |--------------|-----------------| | <p><a href="omni.kit.menu.utils/omni.kit.menu.utils.refresh_menu_items.html"><span class="doc">refresh_menu_items</span></a></p> | refresh_menu_items | | <p>update menus enabled state</p> | update menus enabled state | | <p><a href="omni.kit.menu.utils/omni.kit.menu.utils.remove_hook.html"><span class="doc">remove_hook</span></a></p> | remove_hook | | <p>remove a menu modification callback hook</p> | remove a menu modification callback hook | | <p><a href="omni.kit.menu.utils/omni.kit.menu.utils.remove_layout.html"><span class="doc">remove_layout</span></a></p> | remove_layout | | <p>remove a menu layout.</p> | remove a menu layout. | | <p><a href="omni.kit.menu.utils/omni.kit.menu.utils.remove_menu_items.html"><span class="doc">remove_menu_items</span></a></p> | remove_menu_items | | <p>remove a list of menus items to menu.</p> | remove a list of menus items to menu. | | <p><a href="omni.kit.menu.utils/omni.kit.menu.utils.replace_menu_items.html"><span class="doc">replace_menu_items</span></a></p> | replace_menu_items | | <p>replace a existing list of menus items to menu.</p> | replace a existing list of menus items to menu. | | <p><a href="omni.kit.menu.utils/omni.kit.menu.utils.set_default_menu_proirity.html"><span class="doc">set_default_menu_proirity</span></a></p> | set_default_menu_proirity | | <p>set default menu priority</p> | set default menu priority |
omni.kit.menu.utils.get_action_path.md
# get_action_path ## get_action_path ```python omni.kit.menu.utils.get_action_path(action_prefix: str, menu_entry_name: str) ``` - converts menu path into internal path ```
omni.kit.menu.utils.get_debug_stats.md
# get_debug_stats ## get_debug_stats ```python omni.kit.menu.utils.get_debug_stats() -> dict ``` gets debug stats as dictionary, info on what functions called and how many times. ```
omni.kit.menu.utils.get_instance.md
# get_instance ## get_instance ```python omni.kit.menu.utils.get_instance() ``` get MenuUtilsExtension class ptr ```
omni.kit.menu.utils.get_menu_layout.md
# get_menu_layout ## get_menu_layout get menu layouts.
omni.kit.menu.utils.get_merged_menus.md
# get_merged_menus ## get_merged_menus ```python omni.kit.menu.utils.get_merged_menus() ``` - get combined menus as dictionary ```
omni.kit.menu.utils.IconMenuDelegate.md
# IconMenuDelegate ## IconMenuDelegate ```python class omni.kit.menu.utils.IconMenuDelegate(**kwargs) ``` Bases: `IconMenuBaseDelegate` ### Methods | Method | Description | |--------|-------------| | `__init__(self, **kwargs)` | Constructor. | ### Attributes No attributes listed. ### `__init__(self, **kwargs)` Constructor. #### Keyword Arguments: - `kwargs` (dict): See below ``` - `on_build_item` - Called to create a new item. - `on_build_title` - Called to create a new title. - `on_build_status` - Called to create a new widget on the bottom of the window. - `propagate` - Determine if Menu children should use this delegate when they don’t have the own one.
omni.kit.menu.utils.LayoutSourceSearch.md
# LayoutSourceSearch ## LayoutSourceSearch ```python class omni.kit.menu.utils.LayoutSourceSearch ``` Bases: `object` Controls how layouts search for the menu item paths, either everywhere or just in the local menu group ### Methods ### Attributes ```python EVERYWHERE LOCAL_ONLY ``` ```python __init__() ``` ```
omni.kit.menu.utils.md
# omni.kit.menu.utils ## Submodules Summary: - [omni.kit.menu.utils.scripts](omni.kit.menu.utils.scripts.html) - Menu implementation classes. ## Classes Summary: - [ActionMenuSubscription](omni.kit.menu.utils/omni.kit.menu.utils.ActionMenuSubscription.html) - Action menu subscription wrapper to make it scoped (auto unsubscribe on del) (deprecated) - [IconMenuDelegate](omni.kit.menu.utils/omni.kit.menu.utils.IconMenuDelegate.html) - Icon Menu Delegate class. - [LayoutSourceSearch](omni.kit.menu.utils/omni.kit.menu.utils.LayoutSourceSearch.html) - Controls how layouts search for the menu item paths, either everywhere or just in the local menu group - [MenuActionControl](omni.kit.menu.utils/omni.kit.menu.utils.MenuActionControl.html) - Setting for executing actions. Either NODELAY which is executed instantly or NONE which is async with 1 frame delay - [MenuAlignment](omni.kit.menu.utils/omni.kit.menu.utils.MenuAlignment.html) - Menu alignment setting. Either left or right - [MenuHelperExtension](omni.kit.menu.utils/omni.kit.menu.utils.MenuHelperExtension.html) - Simple helper class for adding/removing “Window” menu to your extension. ui.Window creation/show/hide is still down to user to provide functionally. - [MenuHelperExtensionFull](omni.kit.menu.utils/omni.kit.menu.utils.MenuHelperExtensionFull.html) - Advanced helper class for adding/removing “Window” menu to your extension & controlling ui.Window creation/show/hide. Only thing required is function to create ui_window - [MenuHelperWindow](omni.kit.menu.utils/omni.kit.menu.utils.MenuHelperWindow.html) - The Window class represents a window in the underlying windowing system. - [MenuItemDescription](omni.kit.menu.utils/omni.kit.menu.utils.MenuItemDescription.html) - (No description provided) | Class for creation of menu items | | --- | | MenuItemOrder | | “appear_after” values. FIRST will be top of list and LAST will be bottom of list. | | MenuLayout | | Layout implementation class. See “Layouts and & Hooks” section | | MenuState | | Internal state. Invalid is before EVENT_APP_READY event received and Created is after. | | MenuUtilsDebugExtension | | Menu debug window. Press “SHIFT+CONTROL+ALT+M” to open. | | MenuUtilsExtension | | Menu implementation class. | | PrebuiltItemOrder | | Internal flags used by layout for item ordering | | add_action_to_menu | | --- | | Add action to menu path. (deprecated) | | add_hook | | add a menu modification callback hook | | add_layout | | add a menu layout. | | add_menu_items | | add a list of menus items to menu. | | build_submenu_dict | | builds a dictionary of List[MenuItemDescription] with sub_menus from List[MenuItemDescription] with full paths. EG: “/Window/Viewport/Viewport 1” | | get_action_path | | converts menu path into internal path | | get_debug_stats | | gets debug stats as dictionary, info on what functions called and how many times. | | get_instance | | get MenuUtilsExtension class ptr | | get_menu_layout | | get menu layouts. | | get_merged_menus | | get combined menus as dictionary | | rebuild_menus | | force menus to rebuild, triggering hooks | | refresh_menu_items | | update menus enabled state | | remove_hook | | remove a menu modification callback hook | | remove_layout | | remove a menu layout. | | remove_menu_items | | remove a list of menus items from menu. | ### remove_menu_items remove a list of menus items to menu. ### replace_menu_items replace a existing list of menus items to menu. ### set_default_menu_proirity set default menu priority
omni.kit.menu.utils.MenuActionControl.md
# MenuActionControl ## MenuActionControl Bases: `object` Setting for executing actions. Either NODELAY which is executed instantly or NONE which is async with 1 frame delay ### Methods ### Attributes | Attribute | Description | |-----------|-------------| | `NODELAY` | | | `NONE` | | ### `__init__()`
omni.kit.menu.utils.MenuAlignment.md
# MenuAlignment ## MenuAlignment - Bases: `object` - Menu alignment setting. Either left or right ### Methods ### Attributes - `DEFAULT` - `RIGHT` ## __init__
omni.kit.menu.utils.MenuHelperExtension.md
# MenuHelperExtension ## MenuHelperExtension ``` class omni.kit.menu.utils.MenuHelperExtension ``` **Bases:** `object` Simple helper class for adding/removing “Window” menu to your extension. ui.Window creation/show/hide is still down to user to provide functionally. ### Methods - `__init__()` - `menu_refresh()` - `menu_shutdown()` - `menu_startup(window_name, menu_desc, menu_group)` ``` ```markdown --- ```
omni.kit.menu.utils.MenuHelperExtensionFull.md
# MenuHelperExtensionFull ## MenuHelperExtensionFull ### Class: omni.kit.menu.utils.MenuHelperExtensionFull Advanced helper class for adding/removing “Window” menu to your extension & controlling ui.Window creation/show/hide. Only thing required is function to create ui_window #### Methods - `__init__()` - `menu_shutdown()` - `menu_startup(create_window_fn, window_name, ...)` - `show_window(menu, value)`
omni.kit.menu.utils.MenuHelperWindow.md
# MenuHelperWindow ## MenuHelperWindow ```python class omni.kit.menu.utils.MenuHelperWindow(*args, **kwargs) ``` Bases: `Window` ### Methods | Method | Description | |--------|-------------| | `__init__(self, title, dockPreference, **kwargs)` | Construct the window, add it to the underlying windowing system, and makes it appear. | | `destroy(self)` | Removes all the callbacks and circular references. | | `set_visibility_changed_listener(listener)` | | ### Attributes | Attribute | Description | |-----------|-------------| <details> <summary>MenuHelperWindow Class</summary> ### `__init__(self, title: str, dockPreference: DockPreference.DISABLED: 0, **kwargs) -> None` Construct the window, add it to the underlying windowing system, and makes it appear. #### Arguments: - `title :` The window title. It’s also used as an internal window ID. - `dockPrefence :` In the old Kit determines where the window should be docked. In Kit Next it’s unused. - `kwargs` See below #### Keyword Arguments: - `flags` This property set the Flags for the Window. - `visible` This property holds whether the window is visible. - `title` This property holds the window’s title. - `padding_x` This property set the padding to the frame on the X axis. - `padding_y` This property set the padding to the frame on the Y axis. - `width` This property holds the window Width. - `height` This property holds the window Height. - `position_x` This property set/get the position of the window in the X Axis. The default is kWindowFloatInvalid because we send the window position to the underlying system only if the position is explicitly set by the user. Otherwise the underlying system decides the position. - `position_y` This property set/get the position of the window in the Y Axis. The default is kWindowFloatInvalid because we send the window position to the underlying system only if the position is explicitly set by the user. Otherwise the underlying system decides the position. - `auto_resize` setup the window to resize automatically based on its content - `noTabBar` setup the visibility of the TabBar Handle, this is the small triangle at the corner of the view If it is not shown then it is not possible to undock that window and it need to be closed/moved programatically - `tabBarTooltip` This property sets the tooltip when hovering over window’s tabbar. - `raster_policy` Determine how the content of the window should be rastered. - `width_changed_fn` This property holds the window Width. - `height_changed_fn` This property holds the window Height. - `visibility_changed_fn` This property holds whether the window is visible. ### `destroy(self: omni.ui._ui.Window) -> None` Removes all the callbacks and circular references. </details>
omni.kit.menu.utils.MenuItemDescription.md
# MenuItemDescription ## MenuItemDescription - `checked`: bool = True - `ticked`: bool = False - `ticked_value`: Optional[bool] = None - `sub_menu`: Optional[Any] = 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 Bases: ```python 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 | Method | Description | | --- | --- | | `__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 | Attribute | Description | | --- | --- | | `MAX_DEPTH` | | ## Detailed Method Description ### `__init__(name='', glyph='', header=None, appear_after=Union[list, str])` - **name**: str = '' - **glyph**: str = '' - **header**: Optional[str] = None - **appear_after**: Union[list, str] title: 数据转换 ``` # 数据转换 ```python def function_name( label: str = '', enabled: bool = True, ticked: bool = False, ticked_value: Optional[bool] = None, sub_menu: Optional[Any] = 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, ): pass ``` 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 = None
omni.kit.menu.utils.MenuItemOrder.md
# MenuItemOrder ## MenuItemOrder ```python class omni.kit.menu.utils.MenuItemOrder ``` Bases: `object` “appear_after” values. FIRST will be top of list and LAST will be bottom of list. ### Methods ### Attributes ```python FIRST LAST ``` ```python __init__() ``` ```
omni.kit.menu.utils.MenuLayout.md
# MenuLayout ## MenuLayout ``` ```markdown class omni.kit.menu.utils.MenuLayout(debuglog=False) ``` ```markdown Bases: object Layout implementation class. See “Layouts and & Hooks” section ### Methods - `__init__(debuglog=False)` - `add_layout(layout)` - `apply_layout(prebuilt_menus)` - `destroy()` - `find_menu_item(menu_items, menu_items_root, ...)` - `get_layout()` - `menus_created()` - `process_layout(prebuilt_menus, menu_layout, ...)` ```
omni.kit.menu.utils.MenuState.md
# MenuState ## MenuState ### Class: omni.kit.menu.utils.MenuState Internal state. Invalid is before EVENT_APP_READY event received and Created is after. #### Attributes - **Invalid** - **Created** #### `__init__`
omni.kit.menu.utils.MenuUtilsDebugExtension.md
# MenuUtilsDebugExtension ## MenuUtilsDebugExtension ``` class omni.kit.menu.utils.MenuUtilsDebugExtension ``` Bases: `IExt` Menu debug window. Press “SHIFT+CONTROL+ALT+M” to open. ### Methods | Method | Description | |--------|-------------| | `__init__(self)` | | | `on_shutdown()` | | | `on_startup()` | | | `show_menu_debug_debug_window()` | | ```python def __init__(self): pass ``` ```
omni.kit.menu.utils.MenuUtilsExtension.md
# MenuUtilsExtension ## MenuUtilsExtension - Bases: `IExt` - Menu implementation class. ### Methods - `__init__(self)` - `add_hook(callback)` - `add_layout(layout)` - `add_menu_items(menu, name, menu_index, ...)` - `clear_menu_data()` - `get_debug_stats()` - gets debug stats as dictionary, info on what functions called and how many times. - `get_menu_data()` - `get_menu_layout()` | Function Name | Description | |---------------|-------------| | `get_merged_menus()` | | | `on_shutdown()` | | | `on_startup(ext_id)` | | | `rebuild_menus()` | | | `refresh_menu_items(name[, immediately])` | | | `remove_hook(callback)` | | | `remove_layout(layout)` | | | `remove_menu_items(menu, name, can_rebuild_menus)` | | | `replace_menu_items(new_menu, old_menu, name)` | | | `set_default_menu_priority(name, menu_index)` | | ### __init__(self: omni.ext._extensions.IExt) -> None ### get_debug_stats() -> dict gets debug stats as dictionary, info on what functions called and how many times.
omni.kit.menu.utils.PrebuiltItemOrder.md
# PrebuiltItemOrder ## PrebuiltItemOrder Internal flags used by layout for item ordering ### Methods ### Attributes - **LAYOUT_ITEM_SORTED** - **LAYOUT_ORDERED** - **LAYOUT_SUBMENU_SORTED** - **UNORDERED** ## __init__
omni.kit.menu.utils.rebuild_menus.md
# rebuild_menus ## rebuild_menus force menus to rebuild, triggering hooks
omni.kit.menu.utils.refresh_menu_items.md
# refresh_menu_items ## refresh_menu_items ```python omni.kit.menu.utils.refresh_menu_items(name: str, immediately=None) ``` update menus enabled state menu is list of MenuItemDescription() name is name to appear when menu is collapsed immediately is deprecated and not used ```
omni.kit.menu.utils.remove_hook.md
# remove_hook ## remove_hook ```python omni.kit.menu.utils.remove_hook(callback: Callable) ``` remove a menu modification callback hook callback is function to be called when menus are re-generated ``` ```
omni.kit.menu.utils.remove_layout.md
# remove_layout ## remove_layout ```python omni.kit.menu.utils.remove_layout(layout: List[Union[Menu, SubMenu, Item, Seperator, Group]]) ``` remove a menu layout. ```
omni.kit.menu.utils.remove_menu_items.md
# remove_menu_items ## remove_menu_items ```python omni.kit.menu.utils.remove_menu_items(menu: list, name: str, can_rebuild_menus: bool = True) ``` remove a list of menus items to menu. menu is list of MenuItemDescription() name is name to appear when menu is collapsed can_rebuild_menus is flag to call rebuild_menus when True ```
omni.kit.menu.utils.replace_menu_items.md
# replace_menu_items ## replace_menu_items ```python omni.kit.menu.utils.replace_menu_items(new_menu: list, old_menu: list, name: str) ``` replace a existing list of menus items to menu. menu is list of MenuItemDescription() name is name to appear when menu is collapsed ```
omni.kit.menu.utils.scripts.ActionMenuSubscription.md
# ActionMenuSubscription ## ActionMenuSubscription ``` class omni.kit.menu.utils.scripts.ActionMenuSubscription(_on_del: Callable) ``` Bases: `object` Action menu subscription wrapper to make it scoped (auto unsubscribe on del) (deprecated) ### Methods | Method | Description | | --- | --- | | `__init__(_on_del)` | | | `unsubscribe()` | | ``` __init__(_on_del: Callable) ``` ```
omni.kit.menu.utils.scripts.actions.Classes.md
# omni.kit.menu.utils.scripts.actions Classes ## Classes Summary - **ActionMenuSubscription** - Action menu subscription wrapper to make it scoped (auto unsubscribe on del) (deprecated)
omni.kit.menu.utils.scripts.actions.Functions.md
# omni.kit.menu.utils.scripts.actions Functions ## Functions Summary - **add_action_to_menu** - Add action to menu path. (deprecated)
omni.kit.menu.utils.scripts.actions.md
# omni.kit.menu.utils.scripts.actions ## Classes Summary - **ActionMenuSubscription** - Action menu subscription wrapper to make it scoped (auto unsubscribe on del) (deprecated) ## Functions Summary - **add_action_to_menu** - Add action to menu path. (deprecated)
omni.kit.menu.utils.scripts.app_menu.Classes.md
# omni.kit.menu.utils.scripts.app_menu Classes ## Classes Summary - **AppMenu** - **IconMenuBaseDelegate** - Icon Menu Delegate class. - **IconMenuDelegate** - Icon Menu Delegate class. - **IntFlag** - Support for integer-based Flags - **MenuActionControl** - Setting for executing actions. Either NODELAY which is executed instantly or NONE which is async with 1 frame delay - **MenuAlignment** - Menu alignment setting. Either left or right - **MenuItemDescription** - Class for creation of menu items - **MenuItemOrder** - “appear_after” values. FIRST will be top of list and LAST will be bottom of list. - **MenuState** - Internal state. Invalid is before EVENT_APP_READY event received and Created is after. | PrebuiltItemOrder | Internal flags used by layout for item ordering | | --- | --- | | uiMenu | ui.Menu subclass. Has glyph, menu_checkable, menu_hotkey_text, submenu and parent_menu properties | | uiMenuItem | ui.MenuItem subclass. Has glyph, menu_checkable, menu_hotkey_text and parent_menu properties |
omni.kit.menu.utils.scripts.app_menu.Functions.md
# omni.kit.menu.utils.scripts.app_menu Functions ## Functions Summary - **create_prebuild_entry** - internal function that creates a entry in prebuilt_menus dictionary - **get_action_path** - converts menu path into internal path - **get_menu_name** - gets menu name from menu_entry.name_fn or menu_entry.name - **has_delegate_func** - Checks if delegate class has func_name function.
omni.kit.menu.utils.scripts.app_menu.md
# omni.kit.menu.utils.scripts.app_menu ## Classes Summary: - **AppMenu** - **IconMenuBaseDelegate** - Icon Menu Delegate class. - **IconMenuDelegate** - Icon Menu Delegate class. - **IntFlag** - Support for integer-based Flags - **MenuActionControl** - Setting for executing actions. Either NODELAY which is executed instantly or NONE which is async with 1 frame delay - **MenuAlignment** - Menu alignment setting. Either left or right - **MenuItemDescription** - Class for creation of menu items - **MenuItemOrder** - “appear_after” values. FIRST will be top of list and LAST will be bottom of list. - **MenuState** - Internal state. Invalid is before EVENT_APP_READY event received and Created is after. | PrebuiltItemOrder | Internal flags used by layout for item ordering | | --- | --- | | uiMenu | ui.Menu subclass. Has glyph, menu_checkable, menu_hotkey_text, submenu and parent_menu properties | | uiMenuItem | ui.MenuItem subclass. Has glyph, menu_checkable, menu_hotkey_text and parent_menu properties | | create_prebuild_entry | internal function that creates a entry in prebuilt_menus dictionary | | --- | --- | | get_action_path | converts menu path into internal path | | get_menu_name | gets menu name from menu_entry.name_fn or menu_entry.name | | has_delegate_func | Checks if delegate class has func_name function. | Functions Summary:
omni.kit.menu.utils.scripts.builder_utils.Classes.md
# omni.kit.menu.utils.scripts.builder_utils Classes ## Classes Summary - **LayoutSourceSearch** - Controls how layouts search for the menu item paths, either everywhere or just in the local menu group - **MenuAlignment** - Menu alignment setting. Either left or right - **MenuItemDescription** - Class for creation of menu items - **PrebuiltItemOrder** - Internal flags used by layout for item ordering
omni.kit.menu.utils.scripts.builder_utils.md
# omni.kit.menu.utils.scripts.builder_utils ## Classes Summary: | Class | Description | |-------|-------------| | [LayoutSourceSearch](omni.kit.menu.utils.scripts.builder_utils/omni.kit.menu.utils.scripts.builder_utils.LayoutSourceSearch.html) | Controls how layouts search for the menu item paths, either everywhere or just in the local menu group | | [MenuAlignment](omni.kit.menu.utils.scripts.builder_utils/omni.kit.menu.utils.scripts.builder_utils.MenuAlignment.html) | Menu alignment setting. Either left or right | | [MenuItemDescription](omni.kit.menu.utils.scripts.builder_utils/omni.kit.menu.utils.scripts.builder_utils.MenuItemDescription.html) | Class for creation of menu items | | [PrebuiltItemOrder](omni.kit.menu.utils.scripts.builder_utils/omni.kit.menu.utils.scripts.builder_utils.PrebuiltItemOrder.html) | Internal flags used by layout for item ordering | ## Functions Summary: | Function | Description | |----------|-------------| | [create_prebuild_entry](omni.kit.menu.utils.scripts.builder_utils/omni.kit.menu.utils.scripts.builder_utils.create_prebuild_entry.html) | internal function that creates a entry in prebuilt_menus dictionary | | [get_action_path](omni.kit.menu.utils.scripts.builder_utils/omni.kit.menu.utils.scripts.builder_utils.get_action_path.html) | converts menu path into internal path | | [get_menu_name](omni.kit.menu.utils.scripts.builder_utils/omni.kit.menu.utils.scripts.builder_utils.get_menu_name.html) | gets menu name from menu_entry.name_fn or menu_entry.name | | [has_delegate_func](omni.kit.menu.utils.scripts.builder_utils/omni.kit.menu.utils.scripts.builder_utils.has_delegate_func.html) | Checks if delegate class has func_name function. | # 标题 ## 子标题 这里是段落内容。 这里是另一个段落内容。 这里是代码块内容: ``` 代码 ``` 这里是列表: - 列表项1 - 列表项2 这里是引用: > 引用内容 这里是链接文本(无链接): 链接文本 这里是图片文本(无图片): 图片文本
omni.kit.menu.utils.scripts.debug_window.Classes.md
# omni.kit.menu.utils.scripts.debug_window Classes ## Classes Summary: | Class Name | Description | |------------|-------------| | [MenuUtilsDebugExtension](omni.kit.menu.utils.scripts.debug_window/omni.kit.menu.utils.scripts.debug_window.MenuUtilsDebugExtension.html) | Menu debug window. Press “SHIFT+CONTROL+ALT+M” to open. |
omni.kit.menu.utils.scripts.debug_window.md
# omni.kit.menu.utils.scripts.debug_window ## Classes Summary: - **MenuUtilsDebugExtension** - Menu debug window. Press “SHIFT+CONTROL+ALT+M” to open.
omni.kit.menu.utils.scripts.extension_window_helper.Classes.md
# omni.kit.menu.utils.scripts.extension_window_helper Classes ## Classes Summary | Class Name | Description | |------------|-------------| | [MenuHelperExtension](#) | Simple helper class for adding/removing “Window” menu to your extension. ui.Window creation/show/hide is still down to user to provide functionally. | | [MenuItemDescription](#) | Class for creation of menu items |
omni.kit.menu.utils.scripts.extension_window_helper_full.Classes.md
# omni.kit.menu.utils.scripts.extension_window_helper_full Classes ## Classes Summary | Class Name | Description | |------------|-------------| | MenuHelperExtensionFull | Advanced helper class for adding/removing “Window” menu to your extension & controlling ui.Window creation/show/hide. Only thing required is function to create ui_window | | MenuHelperWindow | The Window class represents a window in the underlying windowing system. | | MenuItemDescription | Class for creation of menu items |
omni.kit.menu.utils.scripts.get_action_path.md
# get_action_path ## get_action_path ### omni.kit.menu.utils.scripts.get_action_path ```python def get_action_path(action_prefix: str, menu_entry_name: str): ``` - **Description**: converts menu path into internal path ---
omni.kit.menu.utils.scripts.get_instance.md
# get_instance ## get_instance ``` ```python omni.kit.menu.utils.scripts.get_instance() ``` ```text get MenuUtilsExtension class ptr ```
omni.kit.menu.utils.scripts.IconMenuDelegate.md
# IconMenuDelegate ## IconMenuDelegate ```python class omni.kit.menu.utils.scripts.IconMenuDelegate(**kwargs) ``` **Bases:** `IconMenuBaseDelegate` **Methods:** | Method | Description | |--------|-------------| | `__init__(self, **kwargs)` | Constructor. | **Attributes:** | Attribute | Description | |-----------|-------------| ```python def __init__(self, **kwargs): """ Constructor. """ ``` ``` > ### Keyword Arguments: > > - `on_build_item` > - Called to create a new item. > - `on_build_title` > - Called to create a new title. > - `on_build_status` > - Called to create a new widget on the bottom of the window. > - `propagate` > - Determine if Menu children should use this delegate when they don’t have the own one.
omni.kit.menu.utils.scripts.layout.Classes.md
# omni.kit.menu.utils.scripts.layout Classes ## Classes Summary | Class Name | Description | |------------|-------------| | LayoutSourceSearch | Controls how layouts search for the menu item paths, either everywhere or just in the local menu group | | MenuItemDescription | Class for creation of menu items | | MenuLayout | Layout implementation class. See “Layouts and & Hooks” section | | PrebuiltItemOrder | Internal flags used by layout for item ordering |
omni.kit.menu.utils.scripts.layout.Functions.md
# omni.kit.menu.utils.scripts.layout Functions ## Functions Summary | Function Name | Description | |---------------|-------------| | `create_prebuild_entry` | internal function that creates a entry in prebuilt_menus dictionary | | `get_action_path` | converts menu path into internal path |
omni.kit.menu.utils.scripts.layout.md
# omni.kit.menu.utils.scripts.layout ## Classes Summary - **LayoutSourceSearch** - Controls how layouts search for the menu item paths, either everywhere or just in the local menu group - **MenuItemDescription** - Class for creation of menu items - **MenuLayout** - Layout implementation class. See “Layouts and & Hooks” section - **PrebuiltItemOrder** - Internal flags used by layout for item ordering ## Functions Summary - **create_prebuild_entry** - internal function that creates a entry in prebuilt_menus dictionary - **get_action_path** - converts menu path into internal path
omni.kit.menu.utils.scripts.LayoutSourceSearch.md
# LayoutSourceSearch ## LayoutSourceSearch Bases: `object` Controls how layouts search for the menu item paths, either everywhere or just in the local menu group ### Methods ### Attributes | Attribute | Description | |-----------|-------------| | `EVERYWHERE` | | | `LOCAL_ONLY` | | ### `__init__()`
omni.kit.menu.utils.scripts.MenuHelperExtensionFull.md
# MenuHelperExtensionFull ## MenuHelperExtensionFull **Bases:** `object` Advanced helper class for adding/removing “Window” menu to your extension & controlling ui.Window creation/show/hide. Only thing required is function to create ui_window ### Methods - **`__init__()`** - **`menu_shutdown()`** - **`menu_startup(create_window_fn, window_name, ...)`** - **`show_window(menu, value)`** ---
omni.kit.menu.utils.scripts.MenuItemOrder.md
# MenuItemOrder ## MenuItemOrder Bases: `object` “appear_after” values. FIRST will be top of list and LAST will be bottom of list. ### Methods ### Attributes | Attribute | Description | |-----------|-------------| | `FIRST` | | | `LAST` | | ### `__init__()`
omni.kit.menu.utils.scripts.MenuLayout.md
# MenuLayout ## MenuLayout ### Class: omni.kit.menu.utils.scripts.MenuLayout(debuglog=False) **Bases:** `object` Layout implementation class. See “Layouts and &amp; Hooks” section #### Methods - **__init__(debuglog)** - **add_layout(layout)** - **apply_layout(prebuilt_menus)** - **destroy()** - **find_menu_item(menu_items, menu_items_root, ...)** - **get_layout()** - **menus_created()** | 方法名 | 参数 | |----------------------|---------------| | `process_layout` | (prebuilt_menus, menu_layout, ...) | | `remove_layout` | (layout) | ### __init__ - 参数: `debuglog = False`
omni.kit.menu.utils.scripts.MenuState.md
# MenuState ## MenuState ### Attributes - **Invalid** - **Created** Internal state. Invalid is before EVENT_APP_READY event received and Created is after. ### __init__
omni.kit.menu.utils.scripts.MenuUtilsDebugExtension.md
# MenuUtilsDebugExtension ## MenuUtilsDebugExtension Bases: `IExt` Menu debug window. Press “SHIFT+CONTROL+ALT+M” to open. ### Methods | Method | Description | |--------|-------------| | `__init__(self)` | | | `on_shutdown()` | | | `on_startup()` | | | `show_menu_debug_debug_window()` | | #### `__init__(self)` → `None` ``` SphinxRtdTheme.Navigation.enable(true);
omni.kit.menu.utils.scripts.rebuild_menus.md
# rebuild_menus ## rebuild_menus ```python omni.kit.menu.utils.scripts.rebuild_menus() ``` force menus to rebuild, triggering hooks ```
omni.kit.menu.utils.scripts.remove_layout.md
# remove_layout ## remove_layout remove a menu layout.
omni.kit.menu.utils.scripts.set_default_menu_proirity.md
# set_default_menu_proirity ## set_default_menu_proirity ```python omni.kit.menu.utils.scripts.set_default_menu_proirity(name, menu_index) ``` set default menu priority ```
omni.kit.menu.utils.scripts.Submodules.md
# omni.kit.menu.utils.scripts Submodules ## Submodules Summary | Module | Description | |--------|-------------| | [omni.kit.menu.utils.scripts.actions](omni.kit.menu.utils.scripts.actions.html) | Actions Omniverse Kit API (deprecated) | | [omni.kit.menu.utils.scripts.app_menu](omni.kit.menu.utils.scripts.app_menu.html) | ui.Menu and ui.MenuItem menu libraries | | [omni.kit.menu.utils.scripts.builder_utils](omni.kit.menu.utils.scripts.builder_utils.html) | Definition of MenuItemDescription and other menu classes | | [omni.kit.menu.utils.scripts.debug_window](omni.kit.menu.utils.scripts.debug_window.html) | Menu debug window. Press “SHIFT+CONTROL+ALT+M” to open. | | [omni.kit.menu.utils.scripts.extension_window_helper](omni.kit.menu.utils.scripts.extension_window_helper.html) | Simple helper class for adding/removing “Window” menu to your extension. ui.Window creation/show/hide is still down to user to provide functionally. | | [omni.kit.menu.utils.scripts.extension_window_helper_full](omni.kit.menu.utils.scripts.extension_window_helper_full.html) | Advanced helper class for adding/removing “Window” menu to your extension & controlling ui.Window creation/show/hide. Only thing required is function to create ui_window | | [omni.kit.menu.utils.scripts.layout](omni.kit.menu.utils.scripts.layout.html) | Layout implementation class. See “Layouts and & Hooks” section | | [omni.kit.menu.utils.scripts.utils](omni.kit.menu.utils.scripts.utils.html) | Menu implementation class. |
omni.kit.menu.utils.scripts.utils.Functions.md
# omni.kit.menu.utils.scripts.utils Functions ## Functions Summary - [add_action_to_menu](#add_action_to_menu) - Add action to menu path. (deprecated) - [add_hook](#add_hook) - add a menu modification callback hook - [add_layout](#add_layout) - add a menu layout. - [add_menu_items](#add_menu_items) - add a list of menus items to menu. - [build_submenu_dict](#build_submenu_dict) - builds a dictionary of List[MenuItemDescription] with sub_menus from List[MenuItemDescription] with full paths. EG: “/Window/Viewport/Viewport 1” - [get_action_path](#get_action_path) - converts menu path into internal path - [get_debug_stats](#get_debug_stats) - gets debug stats as dictionary, info on what functions called and how many times. - [get_instance](#get_instance) - get MenuUtilsExtension class ptr - [get_menu_layout](#get_menu_layout) - get menu layouts. ### add_action_to_menu Add action to menu path. (deprecated) ### add_hook add a menu modification callback hook ### add_layout add a menu layout. ### add_menu_items add a list of menus items to menu. ### build_submenu_dict builds a dictionary of List[MenuItemDescription] with sub_menus from List[MenuItemDescription] with full paths. EG: “/Window/Viewport/Viewport 1” ### get_action_path converts menu path into internal path ### get_debug_stats gets debug stats as dictionary, info on what functions called and how many times. ### get_instance get MenuUtilsExtension class ptr ### get_menu_layout get menu layouts. | 功能 | 描述 | | --- | --- | | get_merged_menus | get combined menus as dictionary | | rebuild_menus | force menus to rebuild, triggering hooks | | refresh_menu_items | update menus enabled state | | remove_hook | remove a menu modification callback hook | | remove_layout | remove a menu layout. | | remove_menu_items | remove a list of menus items to menu. | | replace_menu_items | replace a existing list of menus items to menu. | | set_default_menu_proirity | set default menu priority |
omni.kit.menu.utils.Submodules.md
# omni.kit.menu.utils Submodules ## Submodules Summary - **omni.kit.menu.utils.scripts** - Menu implementation classes.
omni.kit.notification_manager.Classes.md
# omni.kit.notification_manager Classes ## Classes Summary - **NotificationButtonInfo** - Represent a button in notification. - **NotificationStatus** - Notification status.
omni.kit.notification_manager.Functions.md
# omni.kit.notification_manager Functions ## Functions Summary - **post_notification** - Description: Post notification.
omni.kit.notification_manager.md
# omni.kit.notification_manager ## Classes Summary - **NotificationButtonInfo** - Represent a button in notification. - **NotificationStatus** - Notification status. ## Functions Summary - **post_notification** - Post notification.
omni.kit.notification_manager.NotificationButtonInfo.md
# NotificationButtonInfo ## NotificationButtonInfo ``` ```markdown Bases: `object` Represent a button in notification. ### Parameters - **text** (str) – The button text. ### Keyword Arguments - **on_complete** (Callable[[None], None]) – The button handler when clicked. ``` ```markdown Methods ``` ```markdown - `__init__` ## Attributes | Attribute | Description | |-----------|-------------| | `handler` | Button handler when clicked | | `text` | Button text | ### `__init__(text, on_complete=None)` - `text`: The text of the button. - `on_complete`: Optional callable that is executed when the button action is completed. Default is `None`. ### `property handler` - Button handler when clicked ### `property text` - Button text
omni.kit.notification_manager.NotificationStatus.md
# NotificationStatus ## NotificationStatus ```python class omni.kit.notification_manager.NotificationStatus: """ Bases: object Notification status. Different status has different icon and background color. Could be: - NotificationStatus.INFO - NotificationStatus.WARNING Methods ------- __init__() Attributes ---------- INFO Information Notification. WARNING Warning Notification. """ ``` ### Attributes | Attribute | Description | |-----------|-------------| | `INFO` | Information Notification. | | `WARNING` | Warning Notification. | ``` ### `__init__()` ```python def __init__(self): pass ``` ### `INFO` ```python INFO = 1 ``` ### `WARNING` ```python WARNING = 2 ``` WARNING = 0 Warning Notification.
omni.kit.notification_manager.post_notification.md
# post_notification ## post_notification ```python omni.kit.notification_manager.post_notification(text, hide_after_timeout=True, duration=3, status=1, button_infos=[]) ``` Post notification. If viewport is visible, it will be docked to the right-bottom of viewport. Otherwise, it will be docked to main window. ### Parameters - **text** (str) – The notification text. ### Keyword Arguments - **hide_after_timeout** (bool) – If the notification will hide after duration. If it’s False, and button_details are not provided, it will display a default dismiss button. - **duration** (int) – The duration (in seconds) after which the notification will be hidden. This duration only works if hide_after_timeout is True. - **status** (NotificationStatus) – The notification type. By default, NotificationStatus.INFO as information. - **button_infos** ([NotificationButtonInfo]) – The details of buttons to be displayed with the notification. * `buttons` – Array of buttons. ### Returns Notification handler. ### Examples ```python import omni.kit.notification_manager as nm ok_button = nm.NotificationButtonInfo("OK", on_complete=None) cancel_button = nm.NotificationButtonInfo("CANCEL", on_complete=None) notification = nm.post_notification( "Notification Example", hide_after_timeout=False, duration=0, status=nm.NotificationStatus.WARNING, button_infos=[ok_button, cancel_button] ) ```
omni.kit.pipapi.add_archive_directory.md
# add_archive_directory ## add_archive_directory ```python omni.kit.pipapi.add_archive_directory(path: str, root: Optional[str] = None) ``` Add pip additional dirs/links (for pip install –find-links). ```
omni.kit.pipapi.call_pip.md
# call_pip ## call_pip ```python omni.kit.pipapi.call_pip(args, surpress_output=False) ``` Call pip with given arguments. ### Parameters - **args** (list) – list of arguments to pass to pip - **surpress_output** (bool) – if True, surpress pip output ### Returns - return code of pip call ### Return type - int ```