file_path
stringlengths 5
148
| content
stringlengths 150
498k
| size
int64 150
498k
|
---|---|---|
omni.kit.window.inspector.inspector_window.InspectorWindow.md | # InspectorWindow
## InspectorWindow
The inspector window
### Methods
| Method | Description |
|--------|-------------|
| `__init__()` | |
| `destroy()` | Called by extension before destroying this object. |
| `set_visibility_changed_fn(func)` | |
#### `__init__()`
#### `destroy()`
Called by extension before destroying this object. It doesn’t happen automatically. Without this hot reloading doesn’t work.
这是一个段落,包含一个[链接]和一张图片。
```
```markdown
`这是代码块的内容` | 466 |
omni.kit.window.inspector.md | # omni.kit.window.inspector
## Submodules
Summary:
| Module | Description |
|--------|-------------|
| [omni.kit.window.inspector.demo_window](omni.kit.window.inspector.demo_window.html) | No submodule docstring provided |
| [omni.kit.window.inspector.extension](omni.kit.window.inspector.extension.html) | No submodule docstring provided |
| [omni.kit.window.inspector.inspector_preview](omni.kit.window.inspector.inspector_preview.html) | No submodule docstring provided |
| [omni.kit.window.inspector.inspector_style](omni.kit.window.inspector.inspector_style.html) | No submodule docstring provided |
| [omni.kit.window.inspector.inspector_tests](omni.kit.window.inspector.inspector_tests.html) | No submodule docstring provided |
| [omni.kit.window.inspector.inspector_widget](omni.kit.window.inspector.inspector_widget.html) | No submodule docstring provided |
| [omni.kit.window.inspector.inspector_window](omni.kit.window.inspector.inspector_window.html) | No submodule docstring provided |
| [omni.kit.window.inspector.property](omni.kit.window.inspector.property.html) | No submodule docstring provided |
| [omni.kit.window.inspector.style](omni.kit.window.inspector.style.html) | No submodule docstring provided |
| [omni.kit.window.inspector.tree](omni.kit.window.inspector.tree.html) | No submodule docstring provided |
## Classes
Summary:
| Class | Description |
|-------|-------------|
| [InspectorExtension](omni.kit.window.inspector/omni.kit.window.inspector.InspectorExtension.html) | No class docstring provided |
The entry point for Inspector Window
--- | 1,578 |
omni.kit.window.inspector.property.base_frame.md | # omni.kit.window.inspector.property.base_frame
## Classes Summary:
- [WidgetCollectionFrame](omni.kit.window.inspector.property.base_frame/omni.kit.window.inspector.property.base_frame.WidgetCollectionFrame.html) | 214 |
omni.kit.window.inspector.property.create_widget.Functions.md | # omni.kit.window.inspector.property.create_widget Functions
## Functions Summary
- **create_property_widget**
- Create a UI widget connected with a setting.
- **get_property_enum_class**
- (No description provided) | 222 |
omni.kit.window.inspector.property.create_widget.md | # omni.kit.window.inspector.property.create_widget
## Classes Summary
- **PropertyType**
- An enumeration.
## Functions Summary
- **create_property_widget**
- Create a UI widget connected with a setting.
- **get_property_enum_class**
- (No description provided) | 269 |
omni.kit.window.inspector.property.md | # omni.kit.window.inspector.property
## Submodules
Summary:
| Submodule | Description |
|-----------|-------------|
| omni.kit.window.inspector.property.base_frame | No submodule docstring provided |
| omni.kit.window.inspector.property.create_widget | No submodule docstring provided |
| omni.kit.window.inspector.property.inspector_property_widget | No submodule docstring provided |
| omni.kit.window.inspector.property.widget_builder | No submodule docstring provided |
| omni.kit.window.inspector.property.widget_model | No submodule docstring provided |
| omni.kit.window.inspector.property.widgets | No submodule docstring provided | | 642 |
omni.kit.window.inspector.property.widgets.md | # omni.kit.window.inspector.property.widgets
## Submodules
Summary:
| Module | Description |
| --- | --- |
| [omni.kit.window.inspector.property.widgets.button](omni.kit.window.inspector.property.widgets.button.html) | No submodule docstring provided |
| [omni.kit.window.inspector.property.widgets.canvas_frame](omni.kit.window.inspector.property.widgets.canvas_frame.html) | No submodule docstring provided |
| [omni.kit.window.inspector.property.widgets.circle](omni.kit.window.inspector.property.widgets.circle.html) | No submodule docstring provided |
| [omni.kit.window.inspector.property.widgets.collapsable_frame](omni.kit.window.inspector.property.widgets.collapsable_frame.html) | No submodule docstring provided |
| [omni.kit.window.inspector.property.widgets.combox_box](omni.kit.window.inspector.property.widgets.combox_box.html) | No submodule docstring provided |
| [omni.kit.window.inspector.property.widgets.frame](omni.kit.window.inspector.property.widgets.frame.html) | No submodule docstring provided |
| [omni.kit.window.inspector.property.widgets.grid](omni.kit.window.inspector.property.widgets.grid.html) | No submodule docstring provided |
| [omni.kit.window.inspector.property.widgets.image](omni.kit.window.inspector.property.widgets.image.html) | No submodule docstring provided |
| [omni.kit.window.inspector.property.widgets.image_with_provider](omni.kit.window.inspector.property.widgets.image_with_provider.html) | No submodule docstring provided |
| omni.kit.window.inspector.property.widgets.label | No submodule docstring provided |
| --- | --- |
| omni.kit.window.inspector.property.widgets.line | No submodule docstring provided |
| omni.kit.window.inspector.property.widgets.placer | No submodule docstring provided |
| omni.kit.window.inspector.property.widgets.scrolling_frame | No submodule docstring provided |
| omni.kit.window.inspector.property.widgets.slider | No submodule docstring provided |
| omni.kit.window.inspector.property.widgets.stack | No submodule docstring provided |
| omni.kit.window.inspector.property.widgets.string_field | No submodule docstring provided |
| omni.kit.window.inspector.property.widgets.tree_view | No submodule docstring provided |
| omni.kit.window.inspector.property.widgets.triangle | No submodule docstring provided |
| omni.kit.window.inspector.property.widgets.widget | No submodule docstring provided | | 2,392 |
omni.kit.window.inspector.property.widget_builder.md | # omni.kit.window.inspector.property.widget_builder
## Classes Summary:
- **PropertyWidgetBuilder**
- [PropertyWidgetBuilder](omni.kit.window.inspector.property.widget_builder/omni.kit.window.inspector.property.widget_builder.PropertyWidgetBuilder.html) | 256 |
omni.kit.window.inspector.property.widget_model.Classes.md | # omni.kit.window.inspector.property.widget_model Classes
## Classes Summary
| Class Name | Description |
|------------|-------------|
| WidgetComboItemModel | Model for a combo box - for each setting we have a dictionary of key, values |
| WidgetComboNameValueItem | The object that is associated with the data entity of the AbstractItemModel. |
| WidgetComboValueModel | Model to store a pair (label, value of arbitrary type) for use in a ComboBox |
| WidgetModel | Model for widget Properties | | 499 |
omni.kit.window.inspector.style.md | # omni.kit.window.inspector.style
## Submodules
Summary:
| Module | Description |
| --- | --- |
| omni.kit.window.inspector.style.resolved_style | No submodule docstring provided |
| omni.kit.window.inspector.style.style_delegate | No submodule docstring provided |
| omni.kit.window.inspector.style.style_model | No submodule docstring provided |
| omni.kit.window.inspector.style.style_tree | No submodule docstring provided |
| omni.kit.window.inspector.style.widget_styles | No submodule docstring provided | | 514 |
omni.kit.window.inspector.style.style_delegate.Classes.md | # omni.kit.window.inspector.style.style_delegate Classes
## Classes Summary:
| Class Name | Description |
|------------|-------------|
| [StyleTreeDelegate](omni.kit.window.inspector.style.style_delegate/omni.kit.window.inspector.style.style_delegate.StyleTreeDelegate.html) | AbstractItemDelegate is used to generate widgets that display and edit data items from a model. | | 376 |
omni.kit.window.inspector.style.style_delegate.md | # omni.kit.window.inspector.style.style_delegate
## Classes Summary
- **StyleTreeDelegate**
- AbstractItemDelegate is used to generate widgets that display and edit data items from a model. | 193 |
omni.kit.window.inspector.style.style_model.Classes.md | # omni.kit.window.inspector.style.style_model Classes
## Classes Summary:
- **StyleColorComponentItem**
- The object that is associated with the data entity of the AbstractItemModel.
- **StyleColorModel**
- define a model for a style color, and enable coversion from int32 etc
- **StyleComboItemModel**
- Model for a combo box - for each setting we have a dictionary of key, values
- **StyleComboNameValueItem**
- The object that is associated with the data entity of the AbstractItemModel.
- **StyleComboValueModel**
- Model to store a pair (label, value of arbitrary type) for use in a ComboBox
- **StyleGroupItem**
- A single AbstractItemModel item that represents a single prim
- **StyleItem**
- A single AbstractItemModel item that represents a single prim
- **StyleModel**
- The item model that watches the stage
StylePropertyType
===============
An enumeration. | 894 |
omni.kit.window.inspector.style.style_tree.Classes.md | # omni.kit.window.inspector.style.style_tree Classes
## Classes Summary:
| Class Name | Description |
|------------|-------------|
| StyleTreeView | The Stage widget | | 169 |
omni.kit.window.inspector.style.Submodules.md | # omni.kit.window.inspector.style Submodules
## Submodules Summary:
| Submodule | Docstring |
|-----------|-----------|
| omni.kit.window.inspector.style.resolved_style | No submodule docstring provided |
| omni.kit.window.inspector.style.style_delegate | No submodule docstring provided |
| omni.kit.window.inspector.style.style_model | No submodule docstring provided |
| omni.kit.window.inspector.style.style_tree | No submodule docstring provided |
| omni.kit.window.inspector.style.widget_styles | No submodule docstring provided | | 538 |
omni.kit.window.inspector.Submodules.md | # omni.kit.window.inspector Submodules
## Submodules Summary
| Submodule | Docstring |
|-----------|-----------|
| omni.kit.window.inspector.demo_window | No submodule docstring provided |
| omni.kit.window.inspector.extension | No submodule docstring provided |
| omni.kit.window.inspector.inspector_preview | No submodule docstring provided |
| omni.kit.window.inspector.inspector_style | No submodule docstring provided |
| omni.kit.window.inspector.inspector_tests | No submodule docstring provided |
| omni.kit.window.inspector.inspector_widget | No submodule docstring provided |
| omni.kit.window.inspector.inspector_window | No submodule docstring provided |
| omni.kit.window.inspector.property | No submodule docstring provided |
| omni.kit.window.inspector.style | No submodule docstring provided |
| omni.kit.window.inspector.tree | No submodule docstring provided | | 880 |
omni.kit.window.inspector.tree.inspector_tree.Classes.md | # omni.kit.window.inspector.tree.inspector_tree Classes
## Classes Summary
- **InspectorTreeView**
- **WindowItem**
- The object that is associated with the data entity of the AbstractItemModel.
- **WindowListModel**
- The central component of the item widget. It is the application’s dynamic data structure, independent of the user interface, and it directly manages the nested data. It follows closely model-view pattern. It’s abstract, and it defines the standard interface to be able to interoperate with the components of the model-view architecture. It is not supposed to be instantiated directly. Instead, the user should subclass it to create a new model. | 669 |
omni.kit.window.inspector.tree.inspector_tree_delegate.Classes.md | # omni.kit.window.inspector.tree.inspector_tree_delegate Classes
## Classes Summary
- **InspectorTreeDelegate**
- AbstractItemDelegate is used to generate widgets that display and edit data items from a model. | 213 |
omni.kit.window.inspector.tree.inspector_tree_model.Classes.md | # omni.kit.window.inspector.tree.inspector_tree_model Classes
## Classes Summary
- **InspectorTreeModel**
- The item model that watches the stage
- **WidgetItem**
- A single AbstractItemModel item that represents a single prim | 232 |
omni.kit.window.inspector.tree.md | # omni.kit.window.inspector.tree
## Submodules Summary
| Submodule | Description |
|-----------|-------------|
| [omni.kit.window.inspector.tree.inspector_tree](omni.kit.window.inspector.tree.inspector_tree.html) | No submodule docstring provided |
| [omni.kit.window.inspector.tree.inspector_tree_delegate](omni.kit.window.inspector.tree.inspector_tree_delegate.html) | No submodule docstring provided |
| [omni.kit.window.inspector.tree.inspector_tree_model](omni.kit.window.inspector.tree.inspector_tree_model.html) | No submodule docstring provided | | 556 |
omni.kit.window.popup_dialog.Classes.md | # omni.kit.window.popup_dialog Classes
## Classes Summary
- **FormDialog**
- A simple popup dialog with a set of input fields and two buttons, OK and Cancel
- **FormWidget**
- A simple form widget with a set of input fields. As opposed to the dialog class, the widget can be combined
- **InputDialog**
- A simple popup dialog with an input field and two buttons, OK and Cancel
- **InputWidget**
- A simple widget with an input field. As opposed to the dialog class, the widget can be combined
- **MessageDialog**
- This simplest of all popup dialogs displays a confirmation message before executing an action.
- **MessageWidget**
- This widget displays a custom message. As opposed to the dialog class, the widget can be combined
- **OptionsDialog**
- A simple checkbox dialog with a set options and two buttons, OK and Cancel
- **OptionsMenu**
- A simple checkbox menu with a set of options
- **OptionsMenuWidget**
- A simple checkbox widget with a set of options. As opposed to the menu class, the widget can be combined
- **OptionsWidget**
- A simple checkbox widget with a set options. As opposed to the dialog class, the widget can be combined
| 奇数行 | 内容 |
|--------|------|
| | PopupDialog |
| | Base class for a simple popup dialog with two primary buttons, OK and Cancel. | | 1,317 |
omni.kit.window.popup_dialog.FormDialog.md | # FormDialog
## FormDialog
```python
class omni.kit.window.popup_dialog.FormDialog:
def __init__(self, width=400, parent=None, message=None, title=None, ok_handler=None):
pass
Bases:
- [PopupDialog](omni.kit.window.popup_dialog.PopupDialog.html#omni.kit.window.popup_dialog.PopupDialog)
A simple popup dialog with a set of input fields and two buttons, OK and Cancel
Keyword Arguments:
- **width** (int) – Width of popup window. Default 400.
- **parent** (obj:'omni.ui.Widget'): OBSOLETE.
- **message** (str) – Message string.
- **title** (str) – Title of popup window. Default None.
- **ok_handler** (Callable[[AbstractDialog], None]) –
- **cancel_handler** (Optional[Callable[[AbstractDialog], None]]) –
- **ok_label** (str) – Default 'Ok'.
- **cancel_label** (str) – Default 'Cancel'.
- **field_defs** (Optional[List[FormDialogFieldDef]]) –
- **input_width** (int) – Default 250.
- **ok_handler** (Callable[[AbstractDialog], None]) – Handler called when click ok button. Default None.
Function signature is: void ok_handler(AbstractDialog)
- **cancel_handler** (Callable[[AbstractDialog], None]) – Handler called when click cancel button. Default None.
Function signature is: void ok_handler(AbstractDialog)
- **ok_label** (str) – Label text for ok button. Default “Ok”.
- **cancel_label** (str) – Label text for cancel button. Default “Cancel”.
- **field_defs** ([FormDialog.FieldDef]) – List of FieldDefs. Default [].
- **input_width** (int) – OBSOLETE.
**Note**
FormDialog.FieldDef:
A namedtuple of (name, label, type, default value) for describing the input field, e.g. FormDialog.FieldDef(“name”, “Name: “, omni.ui.StringField, “Bob”).
**Methods**
- __init__([width, parent, message, title, ...])
Inherited args from the base class.
- destroy()
Destructor.
- get_field(name)
Returns widget corresponding to named field.
- get_value(name)
Returns value of the named field.
- get_values()
Returns all values in a dict.
- reset_values()
Resets all values to their defaults.
- show([offset_x, offset_y, parent])
Shows this dialog, optionally offset from the parent widget, if any.
**Attributes**
:
Optional
[
Widget
]
=
None
,
message
:
Optional
[
str
]
=
None
,
title
:
Optional
[
str
]
=
None
,
ok_handler
:
Optional
[
Callable
[
AbstractDialog
,
None
]
]
=
None
,
cancel_handler
:
Optional
[
Callable
[
AbstractDialog
,
None
]
]
=
None
,
ok_label
:
str
=
'Ok'
,
cancel_label
:
str
=
'Cancel'
,
field_defs
:
Inherits args from the base class.
### Keyword Arguments
- **width** (`int`) – Window width. Default 400.
- **title** (`str`) – Title to display. Default None.
- **ok_handler** (`Callable`) – Function to invoke when Ok button clicked. Function signature: `void okay_handler(dialog: PopupDialog)`
- **cancel_handler** (`Callable`) – Function to invoke when Cancel button clicked. Function signature: `void cancel_handler(dialog: PopupDialog)`
- **ok_label** (`str`) – Alternative text to display on ‘Accept’ button. Default ‘Ok’.
- **cancel_label** (`str`) – Alternative text to display on ‘Cancel’ button. Default ‘Cancel’.
- **warning_message** (`Optional[str]`) – Warning message that will displayed in red with the warning glyph. Default None.
- **parent** (`omni.ui.Widget`) – OBSOLETE.
### FieldDef
alias of `FormDialogFieldDef`
### destroy()
Destructor.
### get_field(name: str) → AbstractField
Returns widget corresponding to named field.
#### Parameters
- **name** (`str`) – Name of the field.
#### Returns
- omni.ui.AbstractField
### get_value(name: str)
### get_value
Returns value of the named field.
#### Parameters
- **name** (str) – Name of the field.
#### Returns
Union[str, int, float, bool]
#### Note
Doesn’t currently return MultiFields correctly.
### get_values
Returns all values in a dict.
#### Parameters
- **name** (str) – Name of the field.
#### Returns
dict
#### Note
Doesn’t currently return MultiFields correctly.
### reset_values
Resets all values to their defaults.
### show
Shows this dialog, optionally offset from the parent widget, if any.
#### Keyword Arguments
- **offset_x** (int) – X offset. Default 0.
- **offset_y** (int) – Y offset. Default 0.
- **parent** (Optional[Widget]) – Parent widget. Default None.
## 参数说明
### 偏移量
- **x** *(int) – X offset. Default 0.*
- **y** *(int) – Y offset. Default 0.*
- **parent** *(ui.Widget) – Offset from this parent widget. Default None.* | 4,389 |
omni.kit.window.popup_dialog.FormWidget.md | # FormWidget
## FormWidget
```python
class omni.kit.window.popup_dialog.FormWidget(message: Optional[str] = None, field_defs: List[FormDialogFieldDef] = [])
```
**Bases:** `object`
A simple form widget with a set of input fields. As opposed to the dialog class, the widget can be combined with other widget types in the same window.
**Keyword Arguments:**
- **message** (`str`) – Message string.
- **field_defs** (`[FormDialog.FieldDef]`) – List of FieldDefs. Default `[]`.
**Note:**
FormDialog.FieldDef:
A namedtuple of (name, label, type, default value) for describing the input field, e.g. FormDialog.FieldDef("name", "Name: ", omni.ui.StringField, "Bob").
**Methods:**
```
| Method Name | Description |
|-------------|-------------|
| `__init__(message, field_defs)` | Initializes the FormWidget with a message and field definitions. |
| `destroy()` | Destructor. |
| `focus()` | Focus fields for the current widget. |
| `get_field(name)` | Returns widget corresponding to named field. |
| `get_value(name)` | Returns value of the named field. |
| `get_values()` | Returns all values in a dict. |
| `reset_values()` | Resets all values to their defaults. |
```
### __init__(message, field_defs)
Initializes the FormWidget with a message and field definitions.
- `message`: Optional[str] = None
- `field_defs`: List[FormDialogFieldDef] = []
### destroy()
Destructor.
### focus()
Focus fields for the current widget.
### get_field(name)
Returns widget corresponding to named field.
### get_value(name)
Returns value of the named field.
### get_values()
Returns all values in a dict.
### reset_values()
Resets all values to their defaults.
### FormWidget Methods
#### get_field
Returns widget corresponding to named field.
**Parameters**
- **name** (str) – Name of the field.
**Returns**
- omni.ui.AbstractField
#### get_value
Returns value of the named field.
**Parameters**
- **name** (str) – Name of the field.
**Returns**
- Union[str, int, float, bool]
**Note**
Doesn’t currently return MultiFields correctly.
#### get_values
Returns all values in a dict.
**Parameters**
- **name** (str) – Name of the field.
**Returns**
- dict
**Note**
Doesn’t currently return MultiFields correctly.
#### reset_values
Resets all values to their defaults. | 2,271 |
omni.kit.window.popup_dialog.InputDialog.md | # InputDialog
## Overview
The `InputDialog` class is a part of the `omni.kit.window.popup_dialog` module. It is used to create a dialog box that prompts the user for input.
### Constructor
```python
class omni.kit.window.popup_dialog.InputDialog(
width: int = 400,
parent: Optional[Widget] = None,
message: Optional[str] = None,
title: Optional[str] = None,
ok_handler: Optional[Callable[[str], None]] = None
)
```
#### Parameters
- `width`: The width of the dialog box. Default is `400`.
- `parent`: The parent widget of the dialog box. Default is `None`.
- `message`: The message to be displayed in the dialog box. Default is `None`.
- `title`: The title of the dialog box. Default is `None`.
- `ok_handler`: A callback function to be executed when the OK button is clicked. Default is `None`.
```
[Callable[..., None], None] = None,
cancel_handler: Optional[Callable[[AbstractDialog], None]] = None,
ok_label: str = 'Ok',
cancel_label: str = 'Cancel',
input_cls: Optional[AbstractField] = None,
pre_label: Optional[str] = None,
post_label: Optional[str] = None,
default_value: Optional[str] = None,
warning_message: Optional[str] = None
## InputDialog
### Description
A simple popup dialog with an input field and two buttons, OK and Cancel.
### Bases
- `PopupDialog`
### Keyword Arguments
- **width** (int) – Width of popup window. Default 400.
- **parent** (obj:'omni.ui.Widget') – OBSOLETE.
- **message** (str) – Message to display.
- **title** (str) – Title of popup window. Default None.
- **ok_handler** (Callable[[AbstractDialog], None]) – Handler called when click ok button. Default None. Function signature is: void ok_handler(AbstractDialog)
- **cancel_handler** (Callable[[AbstractDialog], None]) – Handler called when click cancel button. Default None. Function signature is: void ok_handler(AbstractDialog)
- **ok_label** (str) – Label text for ok button. Default “Ok”.
- **cancel_label** (str) – Label text for cancel button. Default “Cancel”.
- **input_cls** (omni.ui.AbstractField) – Type of input field specified by class name, e.g. omni.ui.StringField, omni.ui.IntField, omni.ui.CheckBox. Default is omni.ui.StringField.
- **pre_label** (str) – Text displayed before input field. Default None.
- **post_label** (str) – Text displayed after input field. Default None.
- **default_value** (str) – Default value of the input field.
- **warning_message** (Optional[str]) – Warning message that will displayed in red with the warning glyph. Default None.
### Methods
- `__init__`([width, parent, message, title, ...]) – Inherited args from the base class.
- `destroy`() – Destructor.
- `get_value`() – Returns field value.
### Attributes
- (No attributes listed)
__init__(
width: int = 400,
parent: Optional[Widget] = None,
message: Optional[str] = None,
title: Optional[str] = None,
ok_handler: Optional[Callable[[AbstractDialog], None]] = None,
cancel_handler: Optional[Callable[[AbstractDialog], None]] = None,
ok_label: str = 'Ok'
)
: str = 'Cancel',
input_cls: Optional[AbstractField] = None,
pre_label: Optional[str] = None,
post_label: Optional[str] = None,
default_value: Optional[str] = None,
warning_message: Optional[str] = None
)
Inherited args from the base class.
**Keyword Arguments**
* **width** (int) – Window width. Default 400.
* **title** (str) – Title to display. Default None.
* **ok_handler** (Callable) – Function to invoke when Ok button clicked. Function signature: void okay_handler(dialog: PopupDialog)
* **cancel_handler** (Callable) – Function to invoke when Cancel button clicked. Function signature: void cancel_handler(dialog: PopupDialog)
* **ok_label** (str) – Alternative text to display on ‘Accept’ button. Default ‘Ok’.
* **cancel_label** (str) – Alternative text to display on ‘Cancel’ button. Default ‘Cancel’.
* **warning_message** (Optional[str]) – Warning message to display. Default None.
### InputDialog Methods
#### WarningMessage
- **warning_message** (str) – Warning message that will displayed in red with the warning glyph. Default None.
#### Parent
- **parent** (omni.ui.Widget) – OBSOLETE.
#### Destroy
- **destroy** () – Destructor.
#### GetValue
- **get_value** () – Returns field value.
- **Returns**: Any, e.g. one of [str, int, float, bool] | 4,282 |
omni.kit.window.popup_dialog.InputWidget.md | # InputWidget
## Class Definition
```python
class omni.kit.window.popup_dialog.InputWidget(message: Optional[str] = None, input_cls: Optional[AbstractField] = None, pre_label: Optional[str] = None, post_label: Optional[str] = None)
```
### Parameters
- `message`: Optional message string. Default is `None`.
- `input_cls`: Optional AbstractField class. Default is `None`.
- `pre_label`: Optional pre-label string. Default is `None`.
- `post_label`: Optional post-label string. Default is `None`.
```
### Description
InputWidget is a class within the `omni.kit.window.popup_dialog` module, designed to handle input dialogs with customizable labels and input fields.
```
### Usage
```python
# Example usage of InputWidget
from omni.kit.window.popup_dialog import InputWidget
# Create an instance of InputWidget
input_widget = InputWidget(message="Enter your name", input_cls=TextInputField, pre_label="Name:", post_label="Please")
```
### Additional Notes
- The `InputWidget` class can be extended or modified to fit specific application requirements.
- Ensure that the `input_cls` parameter is correctly specified to match the desired input field type.
```
### References
- [omni.kit.window.popup_dialog Documentation](https://docs.omniverse.nvidia.com/kit/docs)
```
## InputWidget
### Description
A simple widget with an input field. As opposed to the dialog class, the widget can be combined with other widget types in the same window.
### Bases
- object
### Keyword Arguments
- **message** (str) – Message to display.
- **input_cls** (omni.ui.AbstractField) – Class of the input field, e.g. omni.ui.StringField, omni.ui.IntField, omni.ui.CheckBox. Default is omni.ui.StringField.
- **pre_label** (str) – Text displayed before input field. Default None.
- **post_label** (str) – Text displayed after input field. Default None.
- **default_value** (str) – Default value of the input field.
### Methods
- **__init__(message=None, input_cls=None, pre_label=None, post_label=None, ...)**
- **destroy()** – Destructor.
- **get_value()** – Returns value of input field.
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
Optional
<span class="p">
<span class="pre">
[
<span class="pre">
str
<span class="p">
<span class="pre">
]
<span class="w">
<span class="o">
<span class="pre">
=
<span class="w">
<span class="default_value">
<span class="pre">
None
,
<em class="sig-param">
<span class="n">
<span class="pre">
default_value
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
Optional
<span class="p">
<span class="pre">
[
<span class="pre">
Any
<span class="p">
<span class="pre">
]
<span class="w">
<span class="o">
<span class="pre">
=
<span class="w">
<span class="default_value">
<span class="pre">
None
<span class="sig-paren">
)
<dd>
<dl class="py method">
<dt class="sig sig-object py" id="omni.kit.window.popup_dialog.InputWidget.destroy">
<span class="sig-name descname">
<span class="pre">
destroy
<span class="sig-paren">
(
<span class="sig-paren">
)
<dd>
<p>
Destructor.
<dl class="py method">
<dt class="sig sig-object py" id="omni.kit.window.popup_dialog.InputWidget.get_value">
<span class="sig-name descname">
<span class="pre">
get_value
<span class="sig-paren">
(
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
Any
<dd>
<p>
Returns value of input field.
<dl class="field-list simple">
<dt class="field-odd">
Returns
<dd class="field-odd">
<p>
Any
<footer>
<hr/>
| 3,761 |
omni.kit.window.popup_dialog.MessageDialog.md | # MessageDialog
## MessageDialog
[AbstractDialog], None]
= None
,
cancel_handler: Optional[Callable[[AbstractDialog], None]] = None
,
ok_label: str = 'Ok'
,
cancel_label: str = 'Cancel'
,
disable_okay_button: bool = False
,
disable_cancel_button: bool = False
,
warning_message: Optional[str] = None
)
Bases:
PopupDialog
This simplest of all popup dialogs displays a confirmation message before executing an action.
Keyword Arguments:
- **width** (int) – Width of popup window. Default 400.
- **parent** (obj:'omni.ui.Widget'): OBSOLETE.
- **message** (str) – The displayed message. Default ‘’.
- **title** (str) – Title of popup window. Default None.
- **ok_handler** (Optional[Callable[[AbstractDialog], None]]) – The handler for the OK button.
### Parameters
- **ok_handler** (Callable[[AbstractDialog], None]) – Handler called when click ok button. Default None.
Function signature is: void ok_handler(AbstractDialog)
- **cancel_handler** (Callable[[AbstractDialog], None]) – Handler called when click cancel button. Default None.
Function signature is: void ok_handler(AbstractDialog)
- **ok_label** (str) – Label text for ok button. Default “Ok”.
- **cancel_label** (str) – Label text for cancel button. Default “Cancel”.
- **disable_okay_button** (bool) – If True, then don’t display ‘Ok’ button. Default False.
- **disable_cancel_button** (bool) – If True, then don’t display ‘Cancel’ button. Default False.
- **warning_message** (Optional[str]) – Warning message that will displayed in red with the warning glyph. Default None.
### Methods
- **__init__** ([width: int = 400, parent: Optional[Widget] = None, message: str = '', title: Optional[str] = None, ...])
Inherited args from the base class.
- **destroy** ()
Destructor
- **set_message** (message: str)
Updates the message string.
### Attributes
- (No attributes listed)
Parameters:
- `parent`: Optional[AbstractWindow] = None
- `ok_handler`: Optional[Callable[[AbstractDialog], None]] = None
- `cancel_handler`: Optional[Callable[[AbstractDialog], None]] = None
- `ok_label`: str = 'Ok'
- `cancel_label`: str = 'Cancel'
- `disable_okay_button`: bool = False
- `disable_cancel_button`: bool = False
- `warning_message`: Optional[str] = None
```
Inherited args from the base class.
<dl class="field-list simple">
<dt class="field-odd">
Keyword Arguments
<dd class="field-odd">
<ul class="simple">
<li>
<p>
<strong>
width
(
<em>
int
) – Window width. Default 400.
<li>
<p>
<strong>
title
(
<em>
str
) – Title to display. Default None.
<li>
<p>
<strong>
ok_handler
(
<em>
Callable
) – Function to invoke when Ok button clicked. Function signature: void okay_handler(dialog: PopupDialog)
<li>
<p>
<strong>
cancel_handler
(
<em>
Callable
) – Function to invoke when Cancel button clicked. Function signature: void cancel_handler(dialog: PopupDialog)
<li>
<p>
<strong>
ok_label
(
<em>
str
) – Alternative text to display on ‘Accept’ button. Default ‘Ok’.
<li>
<p>
<strong>
cancel_label
(
<em>
str
) – Alternative text to display on ‘Cancel’ button. Default ‘Cancel’.
<li>
<p>
<strong>
warning_message
(
<em>
Optional
<em>
[
<em>
str
<em>
]
) – Warning message that will displayed in red with the warning glyph. Default None.
<li>
<p>
<strong>
parent
(
<em>
omni.ui.Widget
) – OBSOLETE.
<dl class="py method">
<dt class="sig sig-object py" id="omni.kit.window.popup_dialog.MessageDialog.destroy">
<span class="sig-name descname">
<span class="pre">
destroy
<span class="sig-paren">
(
<span class="sig-paren">
)
<a class="headerlink" href="#omni.kit.window.popup_dialog.MessageDialog.destroy" title="Permalink to this definition">
<dd>
<p>
Destructor
<dl class="py method">
<dt class="sig sig-object py" id="omni.kit.window.popup_dialog.MessageDialog.set_message">
<span class="sig-name descname">
<span class="pre">
set_message
<span class="sig-paren">
(
<em class="sig-param">
<span class="n">
<span class="pre">
message
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
str
<span class="sig-paren">
)
<a class="headerlink" href="#omni.kit.window.popup_dialog.MessageDialog.set_message" title="Permalink to this definition">
<dd>
<p>
Updates the message string.
<dl class="field-list simple">
<dt class="field-odd">
Parameters
<dd class="field-odd">
<p>
<strong>
message
(
<em>
str
) – The message string.
| 5,325 |
omni.kit.window.popup_dialog.MessageWidget.md | # MessageWidget
## MessageWidget
```python
class omni.kit.window.popup_dialog.MessageWidget(message: str = ''):
```
Bases: `object`
This widget displays a custom message. As opposed to the dialog class, the widget can be combined with other widget types in the same window.
### Keyword Arguments
- **message** (`str`) – The message string
### Methods
- `__init__(message)`
- `destroy()` - Destructor.
- `set_message(message)` - Updates the message string.
```
## Methods
### `__init__()`
Initializes the widget.
### `destroy()`
Destructor.
### `set_message(message: str)`
Updates the message string.
#### Parameters
- **message** (str) – The message string. | 665 |
omni.kit.window.popup_dialog.OptionsDialog.md | # OptionsDialog
## OptionsDialog
### Class
```python
class omni.kit.window.popup_dialog.OptionsDialog(width: int = 400, parent: Optional[Widget] = None, message: Optional[str] = None, title: Optional[str] = None, ok_handler: Optional[Callable[[], None]] = None)
[
Callable
[
AbstractDialog
],
,
None
]
=
None
,
cancel_handler: Optional[Callable[[AbstractDialog], None]] = None
,
ok_label: str = 'Ok'
,
cancel_label: str = 'Cancel'
,
field_defs: Optional[List[OptionsDialogFieldDef]] = None
,
value_changed_fn: Optional[Callable[]] = None
,
radio_group: bool = False
)
Bases:
PopupDialog
A simple checkbox dialog with a set options and two buttons, OK and Cancel
Keyword Arguments:
- **width** (int) – Width of popup window. Default 400.
- **obj** (`parent`) – `omni.ui.Widget`: OBSOLETE.
- **message** (`str`) – Message string.
- **title** (`str`) – Title of popup window. Default None.
- **ok_handler** (`Callable[[AbstractDialog], None]`) – Handler called when click ok button. Default None.
Function signature is: void ok_handler(AbstractDialog)
- **cancel_handler** (`Callable[[AbstractDialog], None]`) – Handler called when click cancel button. Default None.
Function signature is: void ok_handler(AbstractDialog)
- **ok_label** (`str`) – Label text for ok button. Default “Ok”.
- **cancel_label** (`str`) – Label text for cancel button. Default “Cancel”.
- **field_defs** (`[OptionsDialog.FieldDef]`) – List of FieldDefs. Default [].
- **value_changed_fn** (`Callable`) – This callback is triggered on any value change.
- **radio_group** (`bool`) – If True, then only one option can be selected at a time.
### Note
OptionsDialog.FieldDef:
A namedtuple of (name, label, default) for describing the options field,
e.g. OptionsDialog.FieldDef(“option”, “Option”, True).
### Methods
- `__init__([width, parent, message, title, ...])` - Inherited args from the base class.
- `destroy()` - Destructor
- `get_choice()` - Returns name of chosen option.
- `get_value(name)` - Returns value of the named field.
- `get_values()` - Returns all values in a dictionary.
### Attributes
parent : Optional[Widget] = None
message : Optional[str] = None
title : Optional[str] = None
ok_handler : Optional[Callable[[AbstractDialog], None]] = None
cancel_handler : Optional[Callable[[AbstractDialog], None]] = None
ok_label : str = 'Ok'
cancel_label : str = 'Cancel'
### OptionsDialog.__init__
**Parameters:**
- **options_def** (Optional[List[OptionsDialogFieldDef]]) = None
- **value_changed_fn** (Optional[Callable]) = None
- **radio_group** (bool) = False
**Keyword Arguments:**
- **width** (int) – Window width. Default 400.
- **title** (str) – Title to display. Default None.
- **ok_handler** (Callable) – Function to invoke when Ok button clicked. Function signature: void okay_handler(dialog: PopupDialog)
- **cancel_handler** (Callable) – Function to invoke when Cancel button clicked. Function signature: void cancel_handler(dialog: PopupDialog)
- **ok_label** (str) – Alternative text to display on ‘Accept’ button. Default ‘Ok’.
- **cancel_label** (str) – Alternative text to display on ‘Cancel’ button. Default ‘Cancel’.
- **warning_message** (Optional[str]) – Warning message that will displayed in red with the warning glyph. Default None.
- **parent** (omni.ui.Widget) – OBSOLETE.
### OptionsDialog.FieldDef
alias of OptionsDialogFieldDef
### OptionsDialog.destroy
Destructor
### OptionsDialog.get_choice
**Returns:**
- str
Returns name of chosen option.
## get_value
### Description
Returns value of the named field.
### Parameters
- **name** (str) – Name of the field.
### Returns
- bool
## get_values
### Description
Returns all values in a dictionary.
### Returns
- Dict | 3,697 |
omni.kit.window.popup_dialog.OptionsMenu.md | # OptionsMenu
## OptionsMenu
### OptionsMenu
,
**cancel_handler** (: Optional[Callable[[AbstractDialog], None]]) = None,
**ok_label** (str) = 'Ok',
**cancel_label** (str) = 'Cancel',
**field_defs** (: Optional[List[OptionsMenuFieldDef]]) = None,
**value_changed_fn** (: Optional[Callable]) = None
)
Bases:
- PopupDialog
A simple checkbox menu with a set of options
Keyword Arguments:
- **title** (str) – Title of this menu. Default None.
- **field_defs** ([OptionsMenu.FieldDef]) – List of FieldDefs. Default [].
- **value_changed_fn** (Callable) – This callback is triggered on any value change.
Note:
- OptionsMenu.FieldDef: A namedtuple of (name, label, glyph, default) for describing the options field, e.g. OptionsDialog.FieldDef("option", "Option", None, True).
Methods:
- __init__
| Method | Description |
| --- | --- |
| `__init__([width=400, parent=None, title=None, ok_handler=None, ...])` | Inherited args from the base class. |
| `destroy()` | Destructor |
| `get_value(name)` | Returns value of the named field. |
| `get_values()` | Returns all values in a dictionary. |
| `reset_values()` | Resets all values to their defaults. |
| `set_value(name, value)` | Sets the value of the named field. |
### Attributes
`__init__(width: int = 400, parent: Optional[Widget] = None, title: Optional[str] = None, ok_handler: Optional[Callable[[AbstractDialog], None]] = None, cancel_handler: Optional[Callable[[AbstractDialog], None]] = None)`
: Optional[Callable[[AbstractDialog], None], None]
ok_label: str = 'Ok'
cancel_label: str = 'Cancel'
field_defs: Optional[List[OptionsMenuFieldDef]] = None
value_changed_fn: Optional[Callable] = None
Inherited args from the base class.
Keyword Arguments
- **width** (int) – Window width. Default 400.
- **title** (str) – Title to display. Default None.
- **ok_handler** (Callable) – Function to invoke when Ok button clicked. Function signature: void okay_handler(dialog: PopupDialog)
- **cancel_handler** (Callable) – Function to invoke when Cancel button clicked. Function signature: void cancel_handler(dialog: PopupDialog)
- **ok_label** (str) – Alternative text to display on ‘Accept’ button. Default ‘Ok’.
- **cancel_label** (str) – Alternative text to display on ‘Cancel’ button. Default ‘Cancel’.
- **warning_message** (Optional[str]) – Warning message that will displayed in red with the warning glyph. Default None.
- **parent** (
<em>
omni.ui.Widget
) – OBSOLETE.
### FieldDef
alias of `OptionsMenuFieldDef`
### destroy
Destructor
### get_value
Returns value of the named field.
**Parameters**
- **name** (`str`) – Name of the field.
**Returns**
- bool
### get_values
Returns all values in a dictionary.
**Returns**
- dict
### reset_values
Resets all values to their defaults.
### set_value
Sets the value of the named field.
**Parameters**
- **name** (`str`) – Name of the field.
- **value** (`bool`) – New value | 2,890 |
omni.kit.window.popup_dialog.OptionsMenuWidget.md | # OptionsMenuWidget
## Class Definition
```python
class omni.kit.window.popup_dialog.OptionsMenuWidget:
def __init__(self, title: Optional[str] = None, field_defs: List[OptionsMenuFieldDef] = [], value_changed_fn: Optional[Callable] = None, build_ui: bool = True):
```
### Description
Bases:
# Object
A simple checkbox widget with a set of options. As opposed to the menu class, the widget can be combined with other widget types in the same window.
## Keyword Arguments
- **title** (`str`) – Title of this menu. Default None.
- **field_defs** (`[OptionsDialog.FieldDef]`) – List of FieldDefs. Default [].
- **value_changed_fn** (`Callable`) – This callback is triggered on any value change.
- **build_ui** (`bool`) – Build ui when created.
## Note
OptionsMenu.FieldDef:
A namedtuple of (name, label, glyph, default) for describing the options field, e.g. OptionsDialog.FieldDef("option", "Option", None, True).
## Methods
- `__init__([title, field_defs, ...])`
- `build_ui()`
- `destroy()` - Destructor.
- `get_value(name)` - Returns value of the named field.
- `get_values()` - Returns all values in a dictionary.
- `reset_values()` - Resets all values to their defaults.
- `set_value(name, value)` - Sets the value of the named field.
### __init__(title: Optional[str] = None, field_defs: List[OptionsMenuFieldDef] = [])
### OptionsMenuWidget Class
#### `__init__(self, title: str = "Options", value_changed_fn: Optional[Callable] = None, build_ui: bool = True)`
- `title` (str): The title of the options menu.
- `value_changed_fn` (Optional[Callable]): A callback function for value changes. Default is `None`.
- `build_ui` (bool): Whether to build the UI. Default is `True`.
#### `destroy(self)`
- Destructor.
#### `get_value(self, name: str)`
- `name` (str): The name of the field.
- Returns: bool
- Description: Returns value of the named field.
#### `get_values(self)`
- Returns: dict
- Description: Returns all values in a dictionary.
#### `reset_values(self)`
- Description: Resets all values to their defaults.
#### `set_value(self, name: str, value: bool)`
- `name` (str): The name of the field.
- `value` (bool): The value to set.
- Description: Sets the value of the named field.
| 2,211 |
omni.kit.window.popup_dialog.OptionsWidget.md | # OptionsWidget
## Class Definition
```python
class omni.kit.window.popup_dialog.OptionsWidget(message: Optional[str] = None, field_defs: List[OptionsDialogFieldDef] = [], value_changed_fn: Optional[Callable] = None, radio_group: bool = False)
```
### Description
Bases: `object`
```
A simple checkbox widget with a set options. As opposed to the dialog class, the widget can be combined with other widget types in the same window.
### Keyword Arguments
- **message** (`str`) – Message string.
- **field_defs** (`[OptionsDialog.FieldDef]`) – List of FieldDefs. Default [].
- **value_changed_fn** (`Callable`) – This callback is triggered on any value change.
- **radio_group** (`bool`) – If True, then only one option can be selected at a time.
### Note
OptionsDialog.FieldDef:
A namedtuple of (name, label, default) for describing the options field, e.g. OptionsDialog.FieldDef("option", "Option", True).
### Methods
- `__init__(message, field_defs, ...)`
- `destroy()`
- `get_choice()`
- `get_value(name)`
- `get_values()`
#### __init__(message=None, field_defs=[], value_changed_fn=None, radio_group=False)
- `message`: Optional[str] = None
- `field_defs`: List[OptionsDialogFieldDef] = []
- `value_changed_fn`: Optional[Callable] = None
- `radio_group`: bool = False
## Methods
### __init__
```python
def __init__(
self,
radio_group: bool = False
)
```
### destroy
```python
def destroy()
```
Destructor.
### get_choice
```python
def get_choice() -> str
```
Returns name of chosen option.
#### Returns
- str
### get_value
```python
def get_value(name: str) -> bool
```
Returns value of the named field.
#### Parameters
- **name** (str) – Name of the field.
#### Returns
- bool
### get_values
```python
def get_values() -> dict
```
Returns all values in a dictionary.
#### Returns
- dict | 1,813 |
omni.kit.window.popup_dialog.PopupDialog.md | # PopupDialog
## PopupDialog
(
width: Optional[int] = None,
cancel_handler: Optional[Callable[[AbstractDialog], None]] = None,
ok_label: str = 'Ok',
cancel_label: str = 'Cancel',
hide_title_bar: bool = False,
modal: bool = False,
warning_message: Optional[str] = None
)
Bases: AbstractDialog
Base class for a simple popup dialog with two primary buttons, OK and Cancel.
Methods
-------
- __init__(width, parent, title, ok_handler, ...)
- Inherited args from the base class.
- destroy()
- Destructor
- hide()
- Hides this dialog.
- set_cancel_clicked_fn()
- Sets the function to be called when the cancel button is clicked.
### Methods
| Description |
|-------------|
| Sets function to invoke when Cancel button is clicked. |
| Sets function to invoke when Okay button is clicked. |
| Shows this dialog, optionally offset from the parent widget, if any. |
### Attributes
| Attribute | Description |
|-----------|-------------|
| WINDOW_FLAGS | |
| position_x | Get position x of the dialog window. |
| position_y | Get position y of the dialog window. |
| window | Get the dialog window widget. |
### Initialization
```python
__init__(width: int = 400, parent: Optional[Widget] = None, title: Optional[str] = None, ok_handler: Optional[Callable[[AbstractDialog], None]] = None)
```
Inherited args from the base class.
**Keyword Arguments**
* **width** (int) – Window width. Default 400.
* **title** (str) – Title to display. Default None.
* **ok_handler** (Callable) – Function to invoke when Ok button clicked. Function signature: void okay_handler(dialog: PopupDialog)
* **cancel_handler** (Callable) – Function to invoke when Cancel button clicked. Function signature: void cancel_handler(dialog: PopupDialog)
* **ok_label** (str) – Alternative text to display on ‘Accept’ button. Default ‘Ok’.
* **cancel_label** (str) – Alternative text to display on ‘Cancel’ button. Default ‘Cancel’.
* **warning_message** (Optional[str]) – Warning message to display. Default None.
- **warning_message** (Optional [str]) – Warning message that will displayed in red with the warning glyph. Default None.
- **parent** (omni.ui.Widget) – OBSOLETE.
### destroy()
Destructor
### hide()
Hides this dialog.
### set_cancel_clicked_fn(cancel_handler: Callable[[AbstractDialog], None])
Sets function to invoke when Cancel button is clicked.
**Parameters**
- **cancel_handler** (Callable) – Callback with signature: void cancel_handler(dialog: PopupDialog)
### set_okay_clicked_fn(ok_handler: Callable[[AbstractDialog], None])
Sets function to invoke when Okay button is clicked.
**Parameters**
- **ok_handler** (Callable) – Callback with signature: void okay_handler(dialog: PopupDialog)
### show(offset_x: int = 0, offset_y: int = 0, parent: omni.ui.Widget)
### PopupDialog.show Method
Shows this dialog, optionally offset from the parent widget, if any.
#### Keyword Arguments
- **offset_x** (int) – X offset. Default 0.
- **offset_y** (int) – Y offset. Default 0.
- **parent** (ui.Widget) – Offset from this parent widget. Default None.
- **recreate_window** (bool) – Recreate popup window. Default False.
### PopupDialog.position_x Property
Get position x of the dialog window.
#### Returns
- int
### PopupDialog.position_y Property
Get position y of the dialog window.
#### Returns
- int
### PopupDialog.window Property
Get the dialog window widget.
#### Returns
- obj:'omni.ui.window' | 3,418 |
omni.kit.window.preferences.Classes.md | # omni.kit.window.preferences Classes
## Classes Summary:
| Class Name | Description |
|------------|-------------|
| PreferenceBuilder | Page building class |
| PreferenceBuilderUI | Preferences “page” display functions. |
| PreferencesExtension | Preference window class. |
| SettingType | Supported setting types for create_setting_widget. | | 346 |
omni.kit.window.preferences.deregister_actions.md | # deregister_actions
## deregister_actions
```python
omni.kit.window.preferences.deregister_actions(extension_id)
```
Deregister actions: show_preferences_window, hide_preferences_window, toggle_preferences_window.
``` | 221 |
omni.kit.window.preferences.Functions.md | # omni.kit.window.preferences Functions
## Functions Summary:
| Function Name | Description |
|---------------|-------------|
| `deregister_actions` | Deregister actions: show_preferences_window, hide_preferences_window, toggle_preferences_window. |
| `get_instance` | Get instance of preference window class. |
| `get_page_list` | Get list of all available pages. |
| `get_shown_page_list` | Gets list of pages that are visible. IE list of pages that PreferenceBuilder.show_page() returned True. |
| `hide_preferences_window` | Hide the Preferences window from the User. |
| `rebuild_pages` | rebuild UI |
| `register_actions` | Register actions: show_preferences_window, hide_preferences_window, toggle_preferences_window. |
| `register_page` | Add new custom page to preference window list. |
| `select_page` | Select page to display and refresh. |
| `show_file_importer` | Shows file importer. |
| `show_preferences_window` | Show the Preferences window to the User. |
| 操作 | 描述 |
| --- | --- |
| show_preferences_window | Show the Preferences window to the User. |
| unregister_page | Remove custom page from preference window list. | | 1,141 |
omni.kit.window.preferences.get_shown_page_list.md | # get_shown_page_list
## get_shown_page_list
### omni.kit.window.preferences.get_shown_page_list
```
```
Gets list of pages that are visible. IE list of pages that PreferenceBuilder.show_page() returned True.
``` | 215 |
omni.kit.window.preferences.hide_preferences_window.md | # hide_preferences_window
## hide_preferences_window
```python
omni.kit.window.preferences.hide_preferences_window()
```
Hide the Preferences window from the User.
``` | 170 |
omni.kit.window.preferences.md | # omni.kit.window.preferences
## Submodules
Summary:
- **omni.kit.window.preferences.scripts**
- Preference window classes.
## Classes
Summary:
- **PreferenceBuilder**
- Page building class
- **PreferenceBuilderUI**
- Preferences “page” display functions.
- **PreferencesExtension**
- Preference window class.
- **SettingType**
- Supported setting types for create_setting_widget.
## Functions
Summary:
- **deregister_actions**
- Deregister actions: show_preferences_window, hide_preferences_window, toggle_preferences_window.
- **get_instance**
- Get instance of preference window class.
- **get_page_list**
- Get list of all available pages.
- **get_shown_page_list**
- Gets list of pages that are visible. IE list of pages that PreferenceBuilder.show_page() returned True.
- **hide_preferences_window**
- Hide the preferences window.
| 操作 | 描述 |
| --- | --- |
| hide_preferences_window | Hide the Preferences window from the User. |
| rebuild_pages | rebuild UI |
| register_actions | Register actions: show_preferences_window, hide_preferences_window, toggle_preferences_window. |
| register_page | Add new custom page to preference window list. |
| select_page | Select page to display and refresh. |
| show_file_importer | Shows file importer. |
| show_preferences_window | Show the Preferences window to the User. |
| unregister_page | Remove custom page from preference window list. | | 1,418 |
omni.kit.window.preferences.PreferenceBuilder.md | # PreferenceBuilder
## Class: omni.kit.window.preferences.PreferenceBuilder
- **Bases:** `object`
- **Methods:**
- `__init__(title)`
- `add_frame(name)` - Create a UI collapsable frame.
- `cleanup_slashes(path[, is_directory])` - Makes path/slashes uniform
- `create_setting_widget(label_name, ...)` - Create a UI widget connected with a setting.
- `create_setting_widget_combo(name, ...[, ...])` - Creating a Combo Setting widget.
### Methods Detail
#### `__init__(title)`
#### `add_frame(name)`
Create a UI collapsable frame.
#### `cleanup_slashes(path[, is_directory])`
Makes path/slashes uniform
#### `create_setting_widget(label_name, ...)`
Create a UI widget connected with a setting.
#### `create_setting_widget_combo(name, ...[, ...])`
Creating a Combo Setting widget.
<code class="xref py py-obj docutils literal notranslate">
<span class="pre">
get_title
()
<td>
<p>
Gets the page title
<tr class="row-odd">
<td>
<p>
<a class="reference internal" href="#omni.kit.window.preferences.PreferenceBuilder.label" title="omni.kit.window.preferences.PreferenceBuilder.label">
<code class="xref py py-obj docutils literal notranslate">
<span class="pre">
label
(name[, tooltip])
<td>
<p>
Create a UI widget label.
<tr class="row-even">
<td>
<p>
<a class="reference internal" href="#omni.kit.window.preferences.PreferenceBuilder.show_page" title="omni.kit.window.preferences.PreferenceBuilder.show_page">
<code class="xref py py-obj docutils literal notranslate">
<span class="pre">
show_page
()
<td>
<p>
Page is visible.
<tr class="row-odd">
<td>
<p>
<a class="reference internal" href="#omni.kit.window.preferences.PreferenceBuilder.spacer" title="omni.kit.window.preferences.PreferenceBuilder.spacer">
<code class="xref py py-obj docutils literal notranslate">
<span class="pre">
spacer
()
<td>
<p>
Create a UI spacer.
<p class="rubric">
Attributes
<table class="autosummary longtable docutils align-default">
<colgroup>
<col style="width: 10%"/>
<col style="width: 90%"/>
<tbody>
<tr class="row-odd">
<td>
<p>
<code class="xref py py-obj docutils literal notranslate">
<span class="pre">
WINDOW_NAME
<td>
<p>
<dl class="py method">
<dt class="sig sig-object py" id="omni.kit.window.preferences.PreferenceBuilder.__init__">
<span class="sig-name descname">
<span class="pre">
__init__
<span class="sig-paren">
(
<em class="sig-param">
<span class="n">
<span class="pre">
title
<span class="sig-paren">
)
<a class="headerlink" href="#omni.kit.window.preferences.PreferenceBuilder.__init__" title="Permalink to this definition">
<dd>
<dl class="py method">
<dt class="sig sig-object py" id="omni.kit.window.preferences.PreferenceBuilder.add_frame">
<span class="sig-name descname">
<span class="pre">
add_frame
<span class="sig-paren">
(
<em class="sig-param">
<span class="n">
<span class="pre">
name
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
str
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
CollapsableFrame
<a class="headerlink" href="#omni.kit.window.preferences.PreferenceBuilder.add_frame" title="Permalink to this definition">
<dd>
<p>
Create a UI collapsable frame.
<dl class="field-list simple">
<dt class="field-odd">
Parameters
<dd class="field-odd">
<p>
<strong>
name
– Name to be in frame
<dt class="field-even">
Returns
<dd class="field-even">
<p>
<code class="xref py py-class docutils literal notranslate">
<span class="pre">
ui.Widget
connected with the setting on the path specified.
<dl class="py method">
<dt class="sig sig-object py" id="omni.kit.window.preferences.PreferenceBuilder.cleanup_slashes">
<span class="sig-name descname">
<span class="pre">
cleanup_slashes
<span class="sig-paren">
(
<em class="sig-param">
<span class="n">
<span class="pre">
path
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
str
,
<em class="sig-param">
<span class="n">
<span class="pre">
is_directory
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
bool
<span class="w">
<span class="o">
<span class="pre">
=
<span class="w">
<span class="default_value">
<span class="pre">
False
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
str
<a class="headerlink" href="#omni.kit.window.preferences.PreferenceBuilder.cleanup_slashes" title="Permalink to this definition">
<dd>
<p>
Makes path/slashes uniform
<dl class="field-list simple">
<dt class="field-odd">
Parameters
<dd class="field-odd">
<ul class="simple">
<li>
<p>
<strong>
path
– path
<li>
<p>
<strong>
directory
(
<em>
is_directory is path a
) –
<li>
<p>
<strong>
added
(
<em>
so final slash can be
) –
<dt class="field-even">
Returns
<dd class="field-even">
<p>
path
## create_setting_widget
```python
create_setting_widget(label_name: str, setting_path: str, setting_type: SettingType, **kwargs) -> Widget
```
- **Parameters**:
- `label_name`: str
- `setting_path`: str
- `setting_type`: SettingType
- `**kwargs`
- **Returns**: Widget
### Description
Create a UI widget connected with a setting.
If `range_from` >= `range_to` there is no limit. Undo/redo operations are also supported, because changing setting goes through the `omni.kit.commands` module, using `:class:`.ChangeSettingCommand`.
#### Parameters
- **setting_path** – Path to the setting to show and edit.
- **setting_type** – Type of the setting to expect.
- **range_from** – Limit setting value lower bound.
- **range_to** – Limit setting value upper bound.
#### Returns
`ui.Widget` connected with the setting on the path specified.
## create_setting_widget_combo
```python
create_setting_widget_combo(name: str, setting_path: str, list: List[str], setting_is_index: Optional[bool] = None, **kwargs) -> Widget
```
- **Parameters**:
- `name`: str
- `setting_path`: str
- `list`: List[str]
- `setting_is_index`: Optional[bool] = None
- `**kwargs`
- **Returns**: Widget
### Description
Creating a Combo Setting widget.
This function creates a combo box that shows a provided list of names and it is connected with setting by path specified. Underlying setting values are used from values of `items` dict.
- **setting_path** – Path to the setting to show and edit.
- **items** – Can be either `dict` or :py:obj:`list`. For :py:obj:`dict` keys are UI displayed names, values are actual values set into settings. If it is a `list` UI displayed names are equal to setting values.
- **setting_is_index** – None - Detect type from setting_path value. If the type is int, set to True. True - setting_path value is index into items list False - setting_path value is string in items list (default)
### get_title()
- **Returns**
- str name of the page
### label(name: str, tooltip: Optional[str] = None)
- **Parameters**
- **name** – Name to be in label
- **tooltip** – The Tooltip string to be displayed when mouse hovers on the label
- **Returns**
- ui.Widget connected with the setting on the path specified.
### show_page()
- **Returns**
- True or False
### spacer()
- **Returns**
- Spacer
**None**–
**Returns**
```
ui.Widget
```
connected with the setting on the path specified.
--- | 7,422 |
omni.kit.window.preferences.PreferenceBuilderUI.md | # PreferenceBuilderUI
## Methods
- `__init__(visibility_changed_fn)`
- `create_window()`
- Create omni.ui.window
- `destroy()`
- Destroy class and cleanup.
- `hide_window()`
- Hides window
- `rebuild_pages()`
- Rebuilds window pages using current page list
| Method Name | Description |
|-------------|-------------|
| `select_page(page)` | If found, display the given Preference page and select its title in the TreeView. |
| `set_active_page(page_index)` | Set the given page index as the active one. |
| `show_window()` | Shows window |
| `update_page_list(page_list)` | Updates page list |
### `__init__(visibility_changed_fn: Callable)`
### `create_window()`
- **Parameters**: None
- **Returns**: None
### `destroy()`
Destroy class and cleanup.
### `hide_window()`
- **Parameters**: None
- **Returns**: None
### `rebuild_pages()`
- **Parameters**: None
- **Returns**: None
### `select_page(page)`
### PreferenceBuilderUI.select_page
```python
def select_page(page) -> bool:
```
If found, display the given Preference page and select its title in the TreeView.
#### Parameters
- **page** – One of the page from the list of pages.
#### Returns
- A flag indicating if the given page was successfully selected.
#### Return type
- bool
### PreferenceBuilderUI.set_active_page
```python
def set_active_page(page_index: Union[int, str]) -> None:
```
Set the given page index as the active one.
#### Parameters
- **page_index** – Index of page of the page list to set as the active one.
#### Returns
- None
### PreferenceBuilderUI.show_window
```python
def show_window() -> None:
```
Shows window
#### Parameters
- **None** –
#### Returns
- None
### PreferenceBuilderUI.update_page_list
```python
def update_page_list(page_list: List[str]) -> None:
```
Updates page list
#### Parameters
- **page_list** – list of pages
#### Returns
- None | 1,863 |
omni.kit.window.preferences.PreferencesExtension.md | # PreferencesExtension
## PreferencesExtension
- **Bases:** `IExt`
- **Description:** Preference window class.
### Methods
- **hide_preferences_window()**
- **Description:** Hide the Preferences window from the User.
- **on_shutdown()**
- **Description:**
- **on_startup(ext_id)**
- **Description:**
- **rebuild_pages()**
- **Description:** Rebuild UI.
- **select_page(page)**
- **Description:** Select page to display and refresh.
- **show_preferences_window()**
- **Description:** Show the Preferences window to the User.
### __init__
<span class="sig-paren">
(
<em class="sig-param">
<span class="n">
<span class="pre">
self
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
omni.ext._extensions.IExt
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<dd>
<dl class="py class">
<dt class="sig sig-object py" id="omni.kit.window.preferences.PreferencesExtension.PreferencesState">
<em class="property">
<span class="pre">
class
<span class="w">
<span class="sig-name descname">
<span class="pre">
PreferencesState
<span class="sig-paren">
(
<em class="sig-param">
<span class="n">
<span class="pre">
value
<span class="sig-paren">
)
<dd>
<p>
Bases:
<code class="xref py py-class docutils literal notranslate">
<span class="pre">
IntFlag
<p>
Preference startup state, either Invalid or Created.
<dl class="py method">
<dt class="sig sig-object py" id="omni.kit.window.preferences.PreferencesExtension.hide_preferences_window">
<span class="sig-name descname">
<span class="pre">
hide_preferences_window
<span class="sig-paren">
(
<span class="sig-paren">
)
<dd>
<p>
Hide the Preferences window from the User.
<dl class="py method">
<dt class="sig sig-object py" id="omni.kit.window.preferences.PreferencesExtension.rebuild_pages">
<span class="sig-name descname">
<span class="pre">
rebuild_pages
<span class="sig-paren">
(
<span class="sig-paren">
)
<dd>
<p>
Rebuild UI.
<dl class="py method">
<dt class="sig sig-object py" id="omni.kit.window.preferences.PreferencesExtension.select_page">
<span class="sig-name descname">
<span class="pre">
select_page
<span class="sig-paren">
(
<em class="sig-param">
<span class="n">
<span class="pre">
page
<span class="sig-paren">
)
<dd>
<p>
Select page to display and refresh.
<dl class="py method">
<dt class="sig sig-object py" id="omni.kit.window.preferences.PreferencesExtension.show_preferences_window">
<span class="sig-name descname">
<span class="pre">
show_preferences_window
<span class="sig-paren">
(
<span class="sig-paren">
)
<dd>
<p>
Show the Preferences window to the User.
| 3,084 |
omni.kit.window.preferences.register_actions.md | # register_actions
## register_actions
```python
omni.kit.window.preferences.register_actions(extension_id, cls, get_self_fn)
```
Register actions: show_preferences_window, hide_preferences_window, toggle_preferences_window. | 226 |
omni.kit.window.preferences.scripts.Classes.md | # omni.kit.window.preferences.scripts Classes
## Classes Summary:
- **PreferenceBuilder**
- Page building class
- [PreferenceBuilder](omni.kit.window.preferences.scripts/omni.kit.window.preferences.scripts.PreferenceBuilder.html)
- **PreferenceBuilderUI**
- Preferences “page” display functions
- [PreferenceBuilderUI](omni.kit.window.preferences.scripts/omni.kit.window.preferences.scripts.PreferenceBuilderUI.html)
- **PreferencesExtension**
- Preference window class
- [PreferencesExtension](omni.kit.window.preferences.scripts/omni.kit.window.preferences.scripts.PreferencesExtension.html) | 609 |
omni.kit.window.preferences.scripts.get_shown_page_list.md | # get_shown_page_list
## get_shown_page_list
Gets list of pages that are visible. IE list of pages that PreferenceBuilder.show_page() returned True. | 150 |
omni.kit.window.preferences.scripts.md | # omni.kit.window.preferences.scripts
## Submodules
Summary:
- [omni.kit.window.preferences.scripts.preference_builder](omni.kit.window.preferences.scripts.preference_builder.html)
- Page building class.
- [omni.kit.window.preferences.scripts.preferences_actions](omni.kit.window.preferences.scripts.preferences_actions.html)
- Register/deregister actions.
- [omni.kit.window.preferences.scripts.preferences_window](omni.kit.window.preferences.scripts.preferences_window.html)
- preference window class
## Classes
Summary:
- [PreferenceBuilder](omni.kit.window.preferences.scripts/omni.kit.window.preferences.scripts.PreferenceBuilder.html)
- Page building class
- [PreferenceBuilderUI](omni.kit.window.preferences.scripts/omni.kit.window.preferences.scripts.PreferenceBuilderUI.html)
- Preferences “page” display functions.
- [PreferencesExtension](omni.kit.window.preferences.scripts/omni.kit.window.preferences.scripts.PreferencesExtension.html)
- Preference window class.
## Functions
Summary:
- [deregister_actions](omni.kit.window.preferences.scripts/omni.kit.window.preferences.scripts.deregister_actions.html)
- Deregister actions: show_preferences_window, hide_preferences_window, toggle_preferences_window.
- [get_instance](omni.kit.window.preferences.scripts/omni.kit.window.preferences.scripts.get_instance.html)
- Get instance of preference window class.
- [get_page_list](omni.kit.window.preferences.scripts/omni.kit.window.preferences.scripts.get_page_list.html)
- Get list of preference pages.
| 方法名 | 描述 |
| --- | --- |
| get_page_list | Get list of all available pages. |
| get_shown_page_list | Gets list of pages that are visible. IE list of pages that PreferenceBuilder.show_page() returned True. |
| hide_preferences_window | Hide the Preferences window from the User. |
| rebuild_pages | rebuild UI |
| register_actions | Register actions: show_preferences_window, hide_preferences_window, toggle_preferences_window. |
| register_page | Add new custom page to preference window list. |
| select_page | Select page to display and refresh. |
| show_file_importer | Shows file importer. |
| show_preferences_window | Show the Preferences window to the User. |
| unregister_page | Remove custom page from preference window list. | | 2,273 |
omni.kit.window.preferences.scripts.PreferenceBuilder.md | # PreferenceBuilder
## PreferenceBuilder
```python
class omni.kit.window.preferences.scripts.PreferenceBuilder(title)
```
Bases: `object`
Page building class
### Methods
- `__init__(title)`
- `add_frame(name)`
- Create a UI collapsable frame.
- `cleanup_slashes(path[, is_directory])`
- Makes path/slashes uniform
- `create_setting_widget(label_name, ...)`
- Create a UI widget connected with a setting.
- `create_setting_widget_combo(label_name, ...)`
- Create a UI widget connected with a setting.
```
| Method | Description |
| ------ | ----------- |
| (name, ...[, ...]) | Creating a Combo Setting widget. |
| get_title() | Gets the page title |
| label(name[, tooltip]) | Create a UI widget label. |
| show_page() | Page is visible. |
| spacer() | Create a UI spacer. |
### Attributes
| Attribute | Description |
| --------- | ----------- |
| WINDOW_NAME | |
### Methods
#### __init__(title)
- Initialize the PreferenceBuilder with a title.
#### add_frame(name: str) -> CollapsableFrame
- Create a UI collapsable frame.
- **Parameters**
- **name** – Name to be in frame
- **Returns**
- `ui.Widget` connected with the setting on the path specified.
#### cleanup_slashes(path: str, is_directory: bool = False) -> str
- Makes path/slashes uniform
- **Parameters**
- **path** – path
- **is_directory** – is path a directory, default is False
- **Returns**
- str
### create_setting_widget
```python
create_setting_widget(label_name: str, setting_path: str, setting_type: SettingType, **kwargs) -> Widget
```
- **Parameters**:
- `label_name`: str
- `setting_path`: str
- `setting_type`: SettingType
- `**kwargs`
- **Returns**: Widget
### create_setting_widget_combo
```python
create_setting_widget_combo(name: str, setting_path: str, list: List[str], setting_is_index: Optional[bool] = None, **kwargs)
```
- **Parameters**:
- `name`: str
- `setting_path`: str
- `list`: List[str]
- `setting_is_index`: Optional[bool] = None
- `**kwargs`
- **Returns**: Widget
```
)
→
Widget
Creating a Combo Setting widget.
This function creates a combo box that shows a provided list of names and it is connected with setting by path specified. Underlying setting values are used from values of `items` dict.
**Parameters**
- **setting_path** – Path to the setting to show and edit.
- **items** – Can be either `dict` or :py:obj:`list`. For :py:obj:`dict` keys are UI displayed names, values are actual values set into settings. If it is a `list` UI displayed names are equal to setting values.
- **setting_is_index** – None - Detect type from setting_path value. If the type is int, set to True. True - setting_path value is index into items list False - setting_path value is string in items list (default)
```
get_title
()
→
str
Gets the page title
**Parameters**
- **None** –
**Returns**
- str name of the page
```
label
(name: str, tooltip: Optional[str] = None)
Create a UI widget label.
**Parameters**
- **name** – Name to be in label
- **tooltip** – The Tooltip string to be displayed when mouse hovers on the label
**Returns**
- ui.Widget connected with the setting on the path specified.
```
show_page
()
→
bool
Page is visible. Function can be overridden in subclasses to hide pages.
**Returns**
- True or False
```
spacer
()
→ Spacer
Create a UI spacer.
Parameters
----------
None –
Returns
-------
ui.Widget connected with the setting on the path specified. | 3,440 |
omni.kit.window.preferences.scripts.PreferencesExtension.md | # PreferencesExtension
## PreferencesExtension
Bases: `IExt`
Preference window class.
### Methods
- `hide_preferences_window()`
- Hide the Preferences window from the User.
- `on_shutdown()`
- (No description provided)
- `on_startup(ext_id)`
- (No description provided)
- `rebuild_pages()`
- Rebuild UI.
- `select_page(page)`
- Select page to display and refresh.
- `show_preferences_window()`
- (Description not provided in the HTML snippet)
<p>Show the Preferences window to the User.
<dt class="sig sig-object py" id="omni.kit.window.preferences.scripts.PreferencesExtension.__init__">
<span class="sig-name descname">
<span class="pre">__init__
<span class="sig-paren">(
<em class="sig-param">
<span class="n">
<span class="pre">self
<span class="p">
<span class="pre">:
<span class="w">
<span class="n">
<span class="pre">omni.ext._extensions.IExt
<span class="sig-paren">)
<span class="sig-return">
<span class="sig-return-icon">→
<span class="sig-return-typehint">
<span class="pre">None
<dt class="sig sig-object py" id="omni.kit.window.preferences.scripts.PreferencesExtension.PreferencesState">
<em class="property">
<span class="pre">class
<span class="w">
<span class="sig-name descname">
<span class="pre">PreferencesState
<span class="sig-paren">(
<em class="sig-param">
<span class="n">
<span class="pre">value
<span class="sig-paren">)
<dd>
<p>Bases:
<code class="xref py py-class docutils literal notranslate">
<span class="pre">IntFlag
<p>Preference startup state, either Invalid or Created.
<dt class="sig sig-object py" id="omni.kit.window.preferences.scripts.PreferencesExtension.hide_preferences_window">
<span class="sig-name descname">
<span class="pre">hide_preferences_window
<span class="sig-paren">(
<span class="sig-paren">)
<dd>
<p>Hide the Preferences window from the User.
<dt class="sig sig-object py" id="omni.kit.window.preferences.scripts.PreferencesExtension.rebuild_pages">
<span class="sig-name descname">
<span class="pre">rebuild_pages
<span class="sig-paren">(
<span class="sig-paren">)
<dd>
<p>Rebuild UI.
<dt class="sig sig-object py" id="omni.kit.window.preferences.scripts.PreferencesExtension.select_page">
<span class="sig-name descname">
<span class="pre">select_page
<span class="sig-paren">(
<em class="sig-param">
<span class="n">
<span class="pre">page
<span class="sig-paren">)
<dd>
<p>Select page to display and refresh.
<dt class="sig sig-object py" id="omni.kit.window.preferences.scripts.PreferencesExtension.show_preferences_window">
<span class="sig-name descname">
<span class="pre">show_preferences_window
<span class="sig-paren">(
<span class="sig-paren">)
<dd>
<p>Show the Preferences window to the User.
| 2,726 |
omni.kit.window.preferences.scripts.preferences_actions.Functions.md | # omni.kit.window.preferences.scripts.preferences_actions Functions
## Functions Summary
- **deregister_actions**
- Deregister actions: show_preferences_window, hide_preferences_window, toggle_preferences_window.
- **register_actions**
- Register actions: show_preferences_window, hide_preferences_window, toggle_preferences_window. | 339 |
omni.kit.window.preferences.scripts.preferences_window.Functions.md | # omni.kit.window.preferences.scripts.preferences_window Functions
## Functions Summary
### deregister_actions
Deregister actions: show_preferences_window, hide_preferences_window, toggle_preferences_window.
### get_instance
Get instance of preference window class.
### get_page_list
Get list of all available pages.
### get_shown_page_list
Gets list of pages that are visible. IE list of pages that PreferenceBuilder.show_page() returned True.
### hide_preferences_window
Hide the Preferences window from the User.
### rebuild_pages
rebuild UI
### register_actions
Register actions: show_preferences_window, hide_preferences_window, toggle_preferences_window.
### register_page
| 功能 | 描述 |
| --- | --- |
| register_page | Add new custom page to preference window list. |
| select_page | Select page to display and refresh. |
| show_file_importer | Shows file importer. |
| show_preferences_window | Show the Preferences window to the User. |
| unregister_page | Remove custom page from preference window list. | | 1,021 |
omni.kit.window.preferences.scripts.preferences_window.md | # omni.kit.window.preferences.scripts.preferences_window
## Classes
Summary:
| Class | Description |
| --- | --- |
| [PreferenceBuilder](omni.kit.window.preferences.scripts.preferences_window/omni.kit.window.preferences.scripts.preferences_window.PreferenceBuilder.html) | Page building class |
| [PreferenceBuilderUI](omni.kit.window.preferences.scripts.preferences_window/omni.kit.window.preferences.scripts.preferences_window.PreferenceBuilderUI.html) | Preferences “page” display functions. |
| [PreferencesExtension](omni.kit.window.preferences.scripts.preferences_window/omni.kit.window.preferences.scripts.preferences_window.PreferencesExtension.html) | Preference window class. |
## Functions
Summary:
| Function | Description |
| --- | --- |
| [deregister_actions](omni.kit.window.preferences.scripts.preferences_window/omni.kit.window.preferences.scripts.preferences_window.deregister_actions.html) | Deregister actions: show_preferences_window, hide_preferences_window, toggle_preferences_window. |
| [get_instance](omni.kit.window.preferences.scripts.preferences_window/omni.kit.window.preferences.scripts.preferences_window.get_instance.html) | Get instance of preference window class. |
| [get_page_list](omni.kit.window.preferences.scripts.preferences_window/omni.kit.window.preferences.scripts.preferences_window.get_page_list.html) | Get list of all available pages. |
| [get_shown_page_list](omni.kit.window.preferences.scripts.preferences_window/omni.kit.window.preferences.scripts.preferences_window.get_shown_page_list.html) | Gets list of pages that are visible. IE list of pages that PreferenceBuilder.show_page() returned True. |
<p>
hide_preferences_window
<p>
Hide the Preferences window from the User.
<p>
rebuild_pages
<p>
rebuild UI
<p>
register_actions
<p>
Register actions: show_preferences_window, hide_preferences_window, toggle_preferences_window.
<p>
register_page
<p>
Add new custom page to preference window list.
<p>
select_page
<p>
Select page to display and refresh.
<p>
show_file_importer
<p>
Shows file importer.
<p>
show_preferences_window
<p>
Show the Preferences window to the User.
<p>
unregister_page
<p>
Remove custom page from preference window list.
| 2,226 |
omni.kit.window.preferences.scripts.preference_builder.Classes.md | # omni.kit.window.preferences.scripts.preference_builder Classes
## Classes Summary
| Class Name | Description |
|------------|-------------|
| [PageItem](omni.kit.window.preferences.scripts.preference_builder/omni.kit.window.preferences.scripts.preference_builder.PageItem.html) | Single item of the model |
| [PageModel](omni.kit.window.preferences.scripts.preference_builder/omni.kit.window.preferences.scripts.preference_builder.PageModel.html) | The central component of the item widget. It is the application’s dynamic data structure, independent of the user interface, and it directly manages the nested data. It follows closely model-view pattern. It’s abstract, and it defines the standard interface to be able to interoperate with the components of the model-view architecture. It is not supposed to be instantiated directly. Instead, the user should subclass it to create a new model. |
| [PreferenceBuilder](omni.kit.window.preferences.scripts.preference_builder/omni.kit.window.preferences.scripts.preference_builder.PreferenceBuilder.html) | Page building class |
| [PreferenceBuilderUI](omni.kit.window.preferences.scripts.preference_builder/omni.kit.window.preferences.scripts.preference_builder.PreferenceBuilderUI.html) | Preferences “page” display functions. | | 1,281 |
omni.kit.window.preferences.scripts.preference_builder.Functions.md | # omni.kit.window.preferences.scripts.preference_builder Functions
## Functions Summary
Functions Summary:
| Function Name | Description |
|---------------|-------------|
| create_setting_widget | Create a UI widget connected with a setting. |
| create_setting_widget_combo | Create a Combo Setting widget. |
| get_style | Get default style. |
| get_ui_style_name | Gets which light/dark theme kit is using. Not wildly supported. | | 435 |
omni.kit.window.preferences.scripts.preference_builder.md | # omni.kit.window.preferences.scripts.preference_builder
## Classes
Summary:
- **PageItem**
- Single item of the model
- **PageModel**
- The central component of the item widget. It is the application’s dynamic data structure, independent of the user interface, and it directly manages the nested data. It follows closely model-view pattern. It’s abstract, and it defines the standard interface to be able to interoperate with the components of the model-view architecture. It is not supposed to be instantiated directly. Instead, the user should subclass it to create a new model.
- **PreferenceBuilder**
- Page building class
- **PreferenceBuilderUI**
- Preferences “page” display functions.
## Functions
Summary:
- **create_setting_widget**
- Create a UI widget connected with a setting.
- **create_setting_widget_combo**
- Create a Combo Setting widget.
- **get_style**
- Get the style of the widget.
| | |
| --- | --- |
| | Get default style. |
| | Gets which light/dark theme kit is using. Not wildly supported. | | 1,046 |
omni.kit.window.preferences.scripts.show_file_importer.md | # show_file_importer
## Overview
`show_file_importer` is a function within the `omni.kit.window.preferences.scripts` module. It is used to display a file importer dialog with specified parameters.
## Function Definition
```python
def show_file_importer(title: str, file_exts: list = [('All Files(*)', '')], filename_url: Optional[str] = None, click_apply_fn: Optional[Callable] = None, show_only_folders: bool = False)
```
### Parameters
- **title** (`str`): The title of the file importer dialog.
- **file_exts** (`list`): A list of tuples specifying the file extensions to be shown in the dialog. Default is `[('All Files(*)', '')]`.
- **filename_url** (`Optional[str]`): An optional URL associated with the filename. Default is `None`.
- **click_apply_fn** (`Optional[Callable]`): An optional callback function to be called when the "Apply" button is clicked. Default is `None`.
- **show_only_folders** (`bool`): A boolean indicating whether to show only folders in the dialog. Default is `False`.
<span class="default_value">
<span class="pre">
False
<span class="sig-paren">
)
<a class="headerlink" href="#omni.kit.window.preferences.scripts.show_file_importer" title="Permalink to this definition">
<dd>
<p>
Shows file importer.
<footer>
<hr/>
| 1,284 |
omni.kit.window.preferences.scripts.Submodules.md | # omni.kit.window.preferences.scripts Submodules
## Submodules Summary
- **omni.kit.window.preferences.scripts.preference_builder**
- Page building class.
- **omni.kit.window.preferences.scripts.preferences_actions**
- Register/deregister actions.
- **omni.kit.window.preferences.scripts.preferences_window**
- preference window class | 342 |
omni.kit.window.preferences.scripts.unregister_page.md | # unregister_page
## unregister_page
```python
omni.kit.window.preferences.scripts.unregister_page(page, rebuild: bool = True)
```
Remove custom page from preference window list.
``` | 184 |
omni.kit.window.preferences.SettingType.md | # SettingType
## SettingType
```
```markdown
class omni.kit.window.preferences.SettingType(value)
```
```markdown
Bases: Enum
Supported setting types for create_setting_widget.
### Attributes
| Attribute | Description |
|-----------|-------------|
| FLOAT | Setting is a floating-point number. |
| INT | Setting is a integer number. |
| COLOR3 | Setting is a three color floating-point numbers (0.0-1.0). |
| BOOL | Setting is a boolean. |
| STRING | Setting is a string. |
| DOUBLE3 | Setting is a three double-precision floating-point numbers. |
| Setting Type | Description |
| --- | --- |
| `INT2` | Setting is a two integer numbers. |
| `DOUBLE2` | Setting is a two double-precision floating-point numbers. |
| `ASSET` | Setting is a asset path. |
### __init__
### ASSET
Setting is a asset path.
### BOOL
Setting is a boolean.
### COLOR3
Setting is a three color floating-point numbers (0.0-1.0).
### DOUBLE2
Setting is a two double-precision floating-point numbers.
### DOUBLE3
Setting is a three double-precision floating-point numbers.
### FLOAT
Setting is a floating-point number.
### INT
Setting is a integer number.
### INT2
Setting is a two integer numbers.
<dl class="py attribute">
<dt class="sig sig-object py" id="omni.kit.window.preferences.SettingType.INT">
<span class="sig-name descname">
<span class="pre">
INT
<em class="property">
<span class="w">
<span class="p">
<span class="pre">
=
<span class="w">
<span class="pre">
3
<a class="headerlink" href="#omni.kit.window.preferences.SettingType.INT" title="Permalink to this definition">
<dd>
<p>
Setting is a two integer numbers.
<dl class="py attribute">
<dt class="sig sig-object py" id="omni.kit.window.preferences.SettingType.STRING">
<span class="sig-name descname">
<span class="pre">
STRING
<em class="property">
<span class="w">
<span class="p">
<span class="pre">
=
<span class="w">
<span class="pre">
4
<a class="headerlink" href="#omni.kit.window.preferences.SettingType.STRING" title="Permalink to this definition">
<dd>
<p>
Setting is a string.
| 2,405 |
omni.kit.window.preferences.show_preferences_window.md | # show_preferences_window
## show_preferences_window
```python
omni.kit.window.preferences.show_preferences_window()
```
Show the Preferences window to the User.
``` | 168 |
omni.kit.window.preferences.Submodules.md | # omni.kit.window.preferences Submodules
## Submodules Summary
- [omni.kit.window.preferences.scripts](omni.kit.window.preferences.scripts.html)
- Preference window classes. | 177 |
omni.kit.window.property.Classes.md | # omni.kit.window.property Classes
## Classes Summary
| Class | Description |
|-------|-------------|
| [PropertyExtension](omni.kit.window.property/omni.kit.window.property.PropertyExtension.html) | Property window extension class. | | 236 |
omni.kit.window.property.extension.Functions.md | # omni.kit.window.property.extension Functions
## Functions Summary:
| Function | Description |
|----------|-------------|
| [get_window](#get_window) | Get property window. |
### get_window
Get property window. | 214 |
omni.kit.window.property.extension.md | # omni.kit.window.property.extension
## Classes Summary
- **PropertyExtension**
- Property window extension class.
## Functions Summary
- **get_window**
- Get property window. | 183 |
omni.kit.window.property.extension.PropertyExtension.md | # PropertyExtension
## PropertyExtension
```python
class omni.kit.window.property.extension.PropertyExtension
```
Bases: `IExt`, `MenuHelperExtension`
Property window extension class.
### Methods
| Method | Description |
|--------|-------------|
| `__init__()` | Initialize PropertyExtension |
| `on_shutdown()` | Shutdown function |
| `on_startup(ext_id)` | Startup function |
| `show_window(value)` | Show/hide property window function |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `MENU_GROUP` | [Description] |
| Property menu group |
| --- |
| MENU_GROUP |
| Property menu group |
| --- |
| WINDOW_NAME |
| Property window name |
### __init__()
Initialize PropertyExtension
### on_shutdown()
Shutdown function
### on_startup(ext_id)
Startup function
- **Parameters**
- **ext_id** (str) – Extension id.
### show_window(value: bool)
Show/hide property window function
- **Parameters**
- **value** (bool) – True if window will be shown or False if window will be hidden.
### MENU_GROUP = 'Window'
Property menu group
### WINDOW_NAME = 'Property'
Property window name | 1,113 |
omni.kit.window.property.managed_frame.Functions.md | # omni.kit.window.property.managed_frame Functions
## Functions Summary
- **get_collapsed_state**
- Get current collapsed state for `index_name`.
- **prep**
- Update ui.CollapsableFrame and insert hooks so collapsed state can be tracked.
- **reset_collapsed_state**
- Reset collapsed state data, so default will be used.
- **set_collapsed_state**
- Set new collapsed state. | 386 |
omni.kit.window.property.managed_frame.get_collapsed_state.md | # get_collapsed_state
## get_collapsed_state
```python
omni.kit.window.property.managed_frame.get_collapsed_state(index_name: Optional[str] = None)
```
Get current collapsed state for `index_name`.
**Parameters:**
- **index_name** (str) – group name of the frame.
**Returns:**
- collapsed settings dictionary.
**Return type:**
- dict
``` | 342 |
omni.kit.window.property.managed_frame.prep.md | # prep
## prep
```python
omni.kit.window.property.managed_frame.prep(frame: CollapsableFrame, type: str)
```
Update ui.CollapsableFrame and insert hooks so collapsed state can be tracked.
### Parameters
- **frame** (`ui.CollapsableFrame`) – frame to be prepared.
- **type** (`str`) – group name of the frame.
``` | 315 |
omni.kit.window.property.managed_frame.set_collapsed_state.md | # set_collapsed_state
## set_collapsed_state
```python
omni.kit.window.property.managed_frame.set_collapsed_state(index_name: str, state: bool)
```
Set new collapsed state.
### Parameters
- **index_name** (str) – group name of the frame.
- **state** (bool) – new collapsed state of the frame. | 295 |
omni.kit.window.property.md | # omni.kit.window.property
## Submodules
Summary:
- **omni.kit.window.property.extension**
- omni.kit.window.property PropertyExtension class.
- **omni.kit.window.property.managed_frame**
- omni.kit.window.property managed_frame functions. This provides persistent open/closed states for ui.CollapsableFrames
- **omni.kit.window.property.property_filter**
- omni.kit.window.property PropertyFilter base class.
- **omni.kit.window.property.property_scheme_delegate**
- omni.kit.window.property PropertySchemeDelegate base class
- **omni.kit.window.property.property_widget**
- omni.kit.window.property PropertyWidget base class
- **omni.kit.window.property.style**
- omni.kit.window.property style functions
- **omni.kit.window.property.templates**
- omni.kit.window.property template classes
- **omni.kit.window.property.window**
- omni.kit.window.property PropertyWindow class
## Classes
Summary:
- **PropertyExtension**
- Property window extension class.
## Functions
Summary:
- **get_window**
-
# 文档标题
## 目录
### 子标题
- 列表项1
- 列表项2
## 正文内容
这里是正文内容,包含一些文本信息。
## 表格
| 列1 | 列2 |
| --- | --- |
| 内容1 | 内容2 |
| 内容3 | 内容4 |
## 代码块
```javascript
// 这是一个JavaScript代码示例
console.log("Hello, World!");
```
## 脚注
这里是脚注信息。 | 1,248 |
omni.kit.window.property.property_filter.Classes.md | # omni.kit.window.property.property_filter Classes
## Classes Summary:
| Class | Description |
|-------|-------------|
| [PropertyFilter](omni.kit.window.property.property_filter/omni.kit.window.property.property_filter.PropertyFilter.html) | User defined filters for properties. For now, just a substring filter on property names. | | 335 |
omni.kit.window.property.property_filter.PropertyFilter.md | # PropertyFilter
## PropertyFilter
User defined filters for properties. For now, just a substring filter on property names.
### Methods
| Method | Description |
|--------|-------------|
| `__init__()` | Initialize class function. |
| `matches(name)` | Returns True if name matches filter, so property should be visible. |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `name` | Name getter function. |
| `name_model` | Model name getter function. |
## Initialize class function.
## matches
Returns True if name matches filter, so property should be visible.
### Parameters
**name** – name to match.
### Returns
True if matched
### Return type
bool
## name
Name getter function.
### Returns
name
### Return type
str
## name_model
Model name getter function.
### Returns
name model.
### Return type
str | 842 |
omni.kit.window.property.property_scheme_delegate.Classes.md | # omni.kit.window.property.property_scheme_delegate Classes
## Classes Summary:
| Class Name | Description |
|------------|-------------|
| [PropertySchemeDelegate](omni.kit.window.property.property_scheme_delegate/omni.kit.window.property.property_scheme_delegate.PropertySchemeDelegate.html) | PropertySchemeDelegate is a class to test given payload and determine what widgets to be drawn in what order. | | 409 |
omni.kit.window.property.property_scheme_delegate.PropertySchemeDelegate.md | # PropertySchemeDelegate
## PropertySchemeDelegate
```
```markdown
PropertySchemeDelegate is a class to test given payload and determine what widgets to be drawn in what order.
```
```markdown
### Methods
- `get_unwanted_widgets(payload)`
- Tests the payload and returns a list of widget names which this delegate does not want to include.
- `get_widgets(payload)`
- Tests the payload and gathers widgets in interest to be drawn in specific order.
```
```markdown
- `__init__()`
```
```markdown
- `get_unwanted_widgets(payload)`
- Returns a list of widget names which this delegate does not want to include.
- `get_widgets(payload)`
- Gathers widgets in interest to be drawn in specific order.
```
### get_unwanted_widgets
Tests the payload and returns a list of widget names which this delegate does not want to include.
Note that if there is another PropertySchemeDelegate returning widget in its get_widgets that conflicts with
names in get_unwanted_widgets, get_widgets always wins (i.e. the Widget will be drawn).
This function is optional.
#### Parameters
- **payload** (`PrimSelectionPayload`) – payload.
#### Returns
- list of unwanted widgets.
#### Return type
- list
### get_widgets
Tests the payload and gathers widgets in interest to be drawn in specific order.
#### Parameters
- **payload** (`PrimSelectionPayload`) – payload.
#### Returns
- list of widgets to build.
#### Return type
- list | 1,428 |
omni.kit.window.property.property_widget.Classes.md | # omni.kit.window.property.property_widget Classes
## Classes Summary:
| Class | Description |
|-------|-------------|
| [PropertyWidget](omni.kit.window.property.property_widget/omni.kit.window.property.property_widget.PropertyWidget.html) | Base class to create a group of widgets in Property Window | | 305 |
omni.kit.window.property.property_widget.PropertyWidget.md | # PropertyWidget
## PropertyWidget
```
class omni.kit.window.property.property_widget.PropertyWidget(title: str)
```
Bases: `object`
Base class to create a group of widgets in Property Window
### Methods
- **__init__(title)**
- Initialize class function
- **build([filter])**
- UI builder function.
- **build_impl()**
- Main function to creates the UI elements.
- **clean()**
- Clean up function to be called before destroying the object.
- **on_new_payload()**
- Function to handle new payloads.
```
| Method | Description |
| ------ | ----------- |
| `on_new_payload(payload)` | Called when a new payload is delivered. |
| `reset()` | Clean up function to be called when previously built widget is no longer visible given new scheme/payload. |
| `__init__(title: str)` | Initialize class function |
| `build(filter: Optional[PropertyFilter] = None)` | UI builder function. |
| `build_impl()` | Main function to creates the UI elements. |
| `clean()` | Clean up function to be called before destroying the object. |
| `on_new_payload(payload)` | Called when a new payload is delivered. PropertyWidget can take this opportunity to update its ui models, or schedule full UI rebuild. |
### reset()
Clean up function to be called when previously built widget is no longer visible given new scheme/payload. | 1,323 |
omni.kit.window.property.style.Functions.md | # omni.kit.window.property.style Functions
## Functions Summary:
| Function | Description |
|----------|-------------|
| [get_style](omni.kit.window.property.style/omni.kit.window.property.style.get_style.html) | Get UI default style. | | 238 |
omni.kit.window.property.Submodules.md | # omni.kit.window.property Submodules
## Submodules Summary:
| Module | Description |
|--------|-------------|
| [omni.kit.window.property.extension](omni.kit.window.property.extension.html) | omni.kit.window.property PropertyExtension class. |
| [omni.kit.window.property.managed_frame](omni.kit.window.property.managed_frame.html) | omni.kit.window.property managed_frame functions. This provides persistent open/closed states for ui.CollapsableFrames |
| [omni.kit.window.property.property_filter](omni.kit.window.property.property_filter.html) | omni.kit.window.property PropertyFilter base class. |
| [omni.kit.window.property.property_scheme_delegate](omni.kit.window.property.property_scheme_delegate.html) | omni.kit.window.property PropertySchemeDelegate base class |
| [omni.kit.window.property.property_widget](omni.kit.window.property.property_widget.html) | omni.kit.window.property PropertyWidget base class |
| [omni.kit.window.property.style](omni.kit.window.property.style.html) | omni.kit.window.property style functions |
| [omni.kit.window.property.templates](omni.kit.window.property.templates.html) | omni.kit.window.property template classes |
| [omni.kit.window.property.window](omni.kit.window.property.window.html) | omni.kit.window.property PropertyWindow class | | 1,292 |
omni.kit.window.property.templates.build_frame_header.md | # build_frame_header
## build_frame_header
```python
omni.kit.window.property.templates.build_frame_header(collapsed, text: str, id: Optional[str] = None)
```
Custom header for CollapsibleFrame
### Parameters
- **collapsed** (bool) – Default collapsed state.
- **text** (str) – Name of CollapsibleFrame.
- **id** (str) – Group identifier, which is passed to GroupHeaderContextMenuEvent.
``` | 393 |
omni.kit.window.property.templates.Classes.md | # omni.kit.window.property.templates Classes
## Classes Summary
- **GroupHeaderContextMenu**
- Context menu for group headers.
- **GroupHeaderContextMenuEvent**
- Right mouse click event sent by SimplePropertyWidget
- **PropertyWidget**
- Base class to create a group of widgets in Property Window
- **SimplePropertyWidget**
- SimplePropertyWidget provides a simple vertical list of “Label” -> “Value widget” pair layout. | 431 |
omni.kit.window.property.templates.Functions.md | # omni.kit.window.property.templates Functions
## Functions Summary:
| Function Name | Description |
|---------------|-------------|
| build_frame_header | Custom header for CollapsibleFrame | | 194 |
omni.kit.window.property.templates.GroupHeaderContextMenu.md | # GroupHeaderContextMenu
## GroupHeaderContextMenu
Context menu for group headers.
### Methods
| Method | Description |
| --- | --- |
| `__init__()` | Initialize function. |
| `destroy()` | Destroy function. |
| `on_mouse_event(event)` | Mouse event received. |
#### `__init__()`
Initialize function.
#### `destroy()`
Destroy function.
## on_mouse_event
### Description
Mouse event received. Used to show context menu.
### Parameters
- **event** (GroupHeaderContextMenuEvent): Mouse event | 498 |
omni.kit.window.property.templates.GroupHeaderContextMenuEvent.md | # GroupHeaderContextMenuEvent
## GroupHeaderContextMenuEvent
```python
class omni.kit.window.property.templates.GroupHeaderContextMenuEvent(group_id: str, payload: Any)
```
Bases: `object`
Right mouse click event sent by SimplePropertyWidget
### Methods
| Method | Description |
|--------|-------------|
| `__init__(group_id: str, payload: Any)` | Initialize class function. |
```python
def __init__(group_id: str, payload: Any):
# Initialize class function
```
Initialize class function.
**Parameters**
- **group_id** (`str`) – Group identifier for event.
- **payload** (`Any`) – payload for event | 609 |
omni.kit.window.property.templates.header_context_menu.Classes.md | # omni.kit.window.property.templates.header_context_menu Classes
## Classes Summary
- **GroupHeaderContextMenu**
- Context menu for group headers.
- **GroupHeaderContextMenuEvent**
- Right mouse click event sent by SimplePropertyWidget | 241 |
omni.kit.window.property.templates.header_context_menu.md | # omni.kit.window.property.templates.header_context_menu
## Classes
Summary:
| Class | Description |
|-------|-------------|
| [GroupHeaderContextMenu](omni.kit.window.property.templates.header_context_menu/omni.kit.window.property.templates.header_context_menu.GroupHeaderContextMenu.html) | Context menu for group headers. |
| [GroupHeaderContextMenuEvent](omni.kit.window.property.templates.header_context_menu/omni.kit.window.property.templates.header_context_menu.GroupHeaderContextMenuEvent.html) | Right mouse click event sent by SimplePropertyWidget | | 561 |
omni.kit.window.property.templates.md | # omni.kit.window.property.templates
## Submodules
Summary:
| Module | Description |
| --- | --- |
| [omni.kit.window.property.templates.header_context_menu](omni.kit.window.property.templates.header_context_menu.html) | Context menu for group header classes. |
| [omni.kit.window.property.templates.simple_property_widget](omni.kit.window.property.templates.simple_property_widget.html) | SimplePropertyWidget class. |
## Classes
Summary:
| Class | Description |
| --- | --- |
| [GroupHeaderContextMenu](omni.kit.window.property.templates/omni.kit.window.property.templates.GroupHeaderContextMenu.html) | Context menu for group headers. |
| [GroupHeaderContextMenuEvent](omni.kit.window.property.templates/omni.kit.window.property.templates.GroupHeaderContextMenuEvent.html) | Right mouse click event sent by SimplePropertyWidget |
| [PropertyWidget](omni.kit.window.property.templates/omni.kit.window.property.templates.PropertyWidget.html) | Base class to create a group of widgets in Property Window |
| [SimplePropertyWidget](omni.kit.window.property.templates/omni.kit.window.property.templates.SimplePropertyWidget.html) | SimplePropertyWidget provides a simple vertical list of “Label” -> “Value widget” pair layout. |
## Functions
Summary:
| Function | Description |
| --- | --- |
| [build_frame_header](omni.kit.window.property.templates/omni.kit.window.property.templates.build_frame_header.html) | Custom header for CollapsibleFrame | | 1,452 |
omni.kit.window.property.templates.PropertyWidget.md | # PropertyWidget
## Class: omni.kit.window.property.templates.PropertyWidget
Base class to create a group of widgets in Property Window
### Methods
- **__init__(title)**
- Initialize class function
- **build([filter])**
- UI builder function.
- **build_impl()**
- Main function to creates the UI elements.
- **clean()**
- Clean up function to be called before destroying the object.
- **on_new_payload()**
- (Method description not provided in the HTML)
| Method | Description |
|--------|-------------|
| `on_new_payload(payload)` | Called when a new payload is delivered. |
| `reset()` | Clean up function to be called when previously built widget is no longer visible given new scheme/payload. |
| `__init__(title: str)` | Initialize class function |
| `build(filter: Optional[PropertyFilter] = None)` | UI builder function. |
| `build_impl()` | Main function to creates the UI elements. |
| `clean()` | Clean up function to be called before destroying the object. |
| `on_new_payload(payload)` | Called when a new payload is delivered. PropertyWidget can take this opportunity to update its ui models, or schedule full UI rebuild. |
| `reset()` | Clean up function to be called when previously built widget is no longer visible given new scheme/payload. |
## 函数定义
### reset()
Clean up function to be called when previously built widget is no longer visible given new scheme/payload. | 1,406 |
omni.kit.window.property.templates.SimplePropertyWidget.md | # SimplePropertyWidget
## SimplePropertyWidget
```python
class omni.kit.window.property.templates.SimplePropertyWidget(title: str, collapsed: bool = False, collapsable: bool = True)
```
Bases: [PropertyWidget](../omni.kit.window.property.property_widget/omni.kit.window.property.property_widget.PropertyWidget.html#omni.kit.window.property.property_widget.PropertyWidget)
SimplePropertyWidget provides a simple vertical list of “Label” -> “Value widget” pair layout.
### Methods
| Method | Description |
|--------|-------------|
| `__init__(title[, collapsed, collapsable])` | Initialize class function |
| `add_item()` | |
| Function Name | Description |
|------------------------------|-----------------------------------------------------------------------------|
| add_item | This function is supposed to be called inside of build_items function. |
| add_item_with_model | This function is supposed to be called inside of build_items function. |
| add_label | Add a Label with a highlight text based on current filter |
| build_impl | See PropertyWidget.build_impl. |
| build_items | When derived from SimplePropertyWidget, override this function to build your items. |
| clean | See PropertyWidget.clean |
| on_collapsed_changed | Update collapsed state. |
| on_new_payload | See PropertyWidget.on_new_payload |
| request_rebuild | Request the widget to rebuild. |
| reset | See PropertyWidget.reset |
### __init__(title: str, collapsed: bool = False, collapsable: bool = True)
Initialize class function
- `title`: str
- `collapsed`: bool, default is False
- `collapsable`: bool, default is True
### Parameters
- **collapsed** (`bool`) – Default Collapsed state of frame.
- **collapsable** (`collapsable`) – Created frame is CollapsibleFrame/Frame.
### add_item
```python
add_item(label: str, value)
```
This function is supposed to be called inside of build_items function.
Adds a “Label” -> “Value widget” pair item to the widget. “value” will be an uneditable string in a StringField.
#### Parameters
- **label** (`str`) – The label text of the entry.
- **value** – The value to be stringified and displayed in a StringField.
### add_item_with_model
```python
add_item_with_model(label: str, model, editable: bool = False, identifier: Optional[str] = None)
```
This function is supposed to be called inside of build_items function.
Adds a “Label” -> “Value widget with model” pair item to the widget. “value” will be an editable string in a StringField backed by supplied model.
#### Parameters
- **label** (`str`) – The label text of the entry.
- **model** – The model to be used by the string field.
- **editable** – If the StringField generated from model should be editable. Default is False.
### add_label
```python
add_label(label: str)
```
Add a Label with a highlight text based on current filter
#### Parameters
- **label** (`str`) – Name of label.
<span class="sig-name descname">
<span class="pre">
build_impl
<span class="sig-paren">
(
<span class="sig-paren">
)
<dd>
<p>
See PropertyWidget.build_impl.
<dl class="py method">
<dt class="sig sig-object py" id="omni.kit.window.property.templates.SimplePropertyWidget.build_items">
<span class="sig-name descname">
<span class="pre">
build_items
<span class="sig-paren">
(
<span class="sig-paren">
)
<dd>
<p>
When derived from SimplePropertyWidget, override this function to build your items.
<dl class="py method">
<dt class="sig sig-object py" id="omni.kit.window.property.templates.SimplePropertyWidget.clean">
<span class="sig-name descname">
<span class="pre">
clean
<span class="sig-paren">
(
<span class="sig-paren">
)
<dd>
<p>
See PropertyWidget.clean
<dl class="py method">
<dt class="sig sig-object py" id="omni.kit.window.property.templates.SimplePropertyWidget.on_collapsed_changed">
<span class="sig-name descname">
<span class="pre">
on_collapsed_changed
<span class="sig-paren">
(
<em class="sig-param">
<span class="n">
<span class="pre">
collapsed
<span class="sig-paren">
)
<dd>
<p>
Update collapsed state.
<dl class="field-list simple">
<dt class="field-odd">
Parameters
<dd class="field-odd">
<p>
<strong>
collapsed
(
<em>
bool
) – New state of collapsed frame.
<dl class="py method">
<dt class="sig sig-object py" id="omni.kit.window.property.templates.SimplePropertyWidget.on_new_payload">
<span class="sig-name descname">
<span class="pre">
on_new_payload
<span class="sig-paren">
(
<em class="sig-param">
<span class="n">
<span class="pre">
payload
,
<em class="sig-param">
<span class="n">
<span class="pre">
ignore_large_selection
<span class="o">
<span class="pre">
=
<span class="default_value">
<span class="pre">
False
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
bool
<dd>
<p>
See PropertyWidget.on_new_payload
<dl class="py method">
<dt class="sig sig-object py" id="omni.kit.window.property.templates.SimplePropertyWidget.request_rebuild">
<span class="sig-name descname">
<span class="pre">
request_rebuild
<span class="sig-paren">
(
<span class="sig-paren">
)
<dd>
<p>
Request the widget to rebuild.
It will be rebuilt on next frame.
<dl class="py method">
<dt class="sig sig-object py" id="omni.kit.window.property.templates.SimplePropertyWidget.reset">
<span class="sig-name descname">
<span class="pre">
reset
<span class="sig-paren">
(
<span class="sig-paren">
)
<dd>
<p>
See PropertyWidget.reset
<footer>
<hr/>
| 6,085 |
omni.kit.window.property.templates.simple_property_widget.Functions.md | # omni.kit.window.property.templates.simple_property_widget Functions
## Functions Summary
- **build_frame_header**
- Custom header for CollapsibleFrame | 156 |
omni.kit.window.property.templates.simple_property_widget.md | # omni.kit.window.property.templates.simple_property_widget
## Classes Summary:
- **GroupHeaderContextMenu**
- Context menu for group headers.
- **GroupHeaderContextMenuEvent**
- Right mouse click event sent by SimplePropertyWidget
- **PropertyWidget**
- Base class to create a group of widgets in Property Window
- **SimplePropertyWidget**
- SimplePropertyWidget provides a simple vertical list of “Label” -> “Value widget” pair layout.
## Functions Summary:
- **build_frame_header**
- Custom header for CollapsibleFrame | 533 |
omni.kit.window.property.templates.Submodules.md | # omni.kit.window.property.templates Submodules
## Submodules Summary
- **omni.kit.window.property.templates.header_context_menu**
- Context menu for group header classes.
- **omni.kit.window.property.templates.simple_property_widget**
- SimplePropertyWidget class. | 271 |
omni.kit.window.property.window.PropertyWindow.md | # PropertyWindow
## PropertyWindow
```python
class omni.kit.window.property.window.PropertyWindow(window_kwargs=None, properties_frame_kwargs=None)
```
Bases: `object`
Property Window framework.
### Methods
- **`__init__(window_kwargs, properties_frame_kwargs)`**
- Create a PropertyWindow.
- **`destroy()`**
- Destroy function.
- **`get_scheme()`**
- Gets the current scheme being displayed in Property Window.
- **`notify(scheme, payload)`**
- Notify Property Window of a scheme and/or payload change.
```
| Method | Description |
| --- | --- |
| `register_scheme_delegate(scheme, name, delegate)` | Register a PropertySchemeDelegate for a given scheme. |
| `register_widget(scheme, name, property_widget)` | Registers a PropertyWidget to PropertyWindow. |
| `request_rebuild()` | Requests the entire property window to be rebuilt. |
| `reset_scheme_delegate_layout(scheme)` | Reset the order so PropertySchemeDelegate will be processed in the order of registration when building UI. |
| `restore_scroll_pos()` | Restore scroll position from previous position. |
| `save_scroll_pos([reset])` | Save scroll position to previous position. |
| `set_scheme_delegate_layout(scheme, layout)` | Register a list of PropertySchemeDelegate's names to finalize the order and visibility of all registered PropertySchemeDelegate. |
| `set_visibility_changed_listener(listener)` | Adds callback function for when window visibility is changed. |
| `set_visible(visible)` | Set window visibility state. |
| `unregister_scheme_delegate(scheme, name)` | Unregister a PropertySchemeDelegate from PropertyWindow by name. |
| `unregister_widget(scheme, name[, top_stack])` | Unregister a PropertyWidget from PropertyWindow. |
### Attributes
| Attribute | Description |
| --- | --- |
| `paused` | Gets if property window refresh is paused. |
| `properties_frame` | Gets the ui.ScrollingFrame container of PropertyWidgets |
__init__(window_kwargs=None, properties_frame_kwargs=None)
Create a PropertyWindow.
Parameters
----------
window_kwargs (dict) – Additional kwargs to pass to ui.Window.
properties_frame_kwargs (dict) – Additional kwargs to pass to ui.ScrollingFrame.
destroy()
Destroy function. Class cleanup function
get_scheme()
Gets the current scheme being displayed in Property Window.
notify(scheme: str, payload: Any)
Notify Property Window of a scheme and/or payload change.
This is the function to trigger refresh of PropertyWindow.
Parameters
----------
scheme (str) – Scheme of this notification.
payload – Payload to refresh the widgets.
register_scheme_delegate(scheme: str, name: str, delegate: PropertySchemeDelegate)
Register a PropertySchemeDelegate for a given scheme. A PropertySchemeDelegate tests the payload and determines
what widgets to be drawn in what order. A scheme can have multiple PropertySchemeDelegate and their result will
be merged to display all relevant widgets.
PropertySchemeDelegate does not hide widgets that are not returned from its get_widgets function. If you want to
hide certain widget, return them in PropertySchemeDelegate.get_unwanted_widgets. See PropertySchemeDelegate’s
documentation for details.
### PropertySchemeDelegate Registration
- **scheme** (`str`) – Scheme of the PropertySchemeDelegate to be added to.
- **name** (`str`) – A unique name to identify the PropertySchemeDelegate under. Delegate with existing name will be overridden.
- **delegate** (`PropertySchemeDelegate`) – A PropertySchemeDelegate instance to be added.
### PropertyWidget Registration
- **scheme** (`str`) – Scheme of the PropertyWidget will work with.
- **name** (`str`) – A unique name to identify the PropertyWidget under. Widget with existing name will be overridden.
- **property_widget** (`PropertyWidget`) – A PropertyWidget instance to be added.
- **top_stack** (`bool`) – Widgets are managed in double stack:
- `True` to register the widget to “Top” stack which layouts widgets from top to bottom.
- `False` to register the widget to “Button” stack which layouts widgets from bottom to top and always below the “Top” stack.
### PropertyWindow Methods
- **register_widget** (`scheme: str`, `name: str`, `property_widget: PropertyWidget`, `top_stack: bool = True`) – Registers a PropertyWidget to PropertyWindow.
- **request_rebuild** () – Requests the entire property window to be rebuilt.
- **reset_scheme_delegate_layout** (`scheme: str`) – Reset the order so PropertySchemeDelegate will be processed in the order of registration when building UI.
### restore_scroll_pos()
Restore scroll position from previous position. Used when trying to keep scroll position when selecting attributes of same type.
### save_scroll_pos(reset=False)
Save scroll position to previous position. Used when trying to keep scroll position when selecting attributes of same type.
#### Parameters
- **reset** (bool) – If True clear old scroll position.
### set_scheme_delegate_layout(scheme: str, layout: List[str])
Register a list of PropertySchemeDelegate’s names to finalize the order and visibility of all registered PropertySchemeDelegate. Useful if you need a fixed layout of Property Widgets for your Kit experience.
#### Remark:
If you’re a Property Widget writer, DO NOT call this function. It should only be called by Kit Experience to tune the final look and layout of the Property Window.
#### Parameters
- **scheme** (str) – Scheme of the PropertySchemeDelegate order to be added to.
- **layout** (List[str]) – a list of PropertySchemeDelegate’s name, in the order of being processed when building UI. Scheme delegate not in this will be skipped.
### set_visibility_changed_listener(listener: callable)
Adds callback function for when window visibility is changed.
#### Parameters
- **listener** (callable) – visibility changed callback.
### set_visible(visible: bool)
Set window visibility state.
#### Parameters
- **visible** (bool) – Visible state of the window.
### unregister_scheme_delegate
**Parameters**
- **scheme** (`str`) – Scheme of the PropertySchemeDelegate to be removed from.
- **name** (`str`) – The name to find the PropertySchemeDelegate and remove.
### unregister_widget
**Parameters**
- **scheme** (`str`) – Scheme of the PropertyWidget to be removed from.
- **name** (`str`) – The name to find the PropertyWidget and remove.
- **top_stack** (`bool`) – see @register_widget
### paused
Gets if property window refresh is paused.
### properties_frame
Gets the ui.ScrollingFrame container of PropertyWidgets | 6,492 |
omni.kit.window.stage.Classes.md | # omni.kit.window.stage Classes
## Classes Summary:
| Class | Description |
|-------|-------------|
| [StageExtension](omni.kit.window.stage/omni.kit.window.stage.StageExtension.html) | The entry point for Stage Window | | 222 |
omni.kit.window.stage.md | # omni.kit.window.stage
## Submodules Summary
| Module | Description |
|--------|-------------|
| omni.kit.window.stage.external_drag_drop_helper | No submodule docstring provided |
| omni.kit.window.stage.selection_watch | No submodule docstring provided |
| omni.kit.window.stage.singleton | No submodule docstring provided |
| omni.kit.window.stage.stage_extension | No submodule docstring provided |
| omni.kit.window.stage.stage_settings | No submodule docstring provided |
| omni.kit.window.stage.stage_window | No submodule docstring provided |
## Classes Summary
| Class | Description |
|-------|-------------|
| StageExtension | The entry point for Stage Window | | 676 |
omni.kit.window.stage.selection_watch.Classes.md | # omni.kit.window.stage.selection_watch Classes
## Classes Summary
| Class Name | Description |
|------------|-------------|
| [SelectionWatch](omni.kit.window.stage.selection_watch/omni.kit.window.stage.selection_watch.SelectionWatch.html) | A watcher object that updates selections in TreeView when scene selections are updated, and vice versa. | | 350 |
omni.kit.window.stage.selection_watch.md | # omni.kit.window.stage.selection_watch
## Classes Summary:
- **SelectionWatch**
- A watcher object that updates selections in TreeView when scene selections are updated, and vice versa. | 190 |
omni.kit.window.stage.StageExtension.md | # StageExtension
## StageExtension
The entry point for Stage Window
### Methods
| Method | Description |
|--------|-------------|
| `on_shutdown()` | |
| `on_startup()` | |
| `show_window(value)` | |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `MENU_GROUP` | |
| `WINDOW_NAME` | |
### `__init__(self: omni.ext._extensions.IExt) -> None`
# 标题1
这是一个段落,包含一个[链接]和一张图片。 | 405 |
omni.kit.window.stage.stage_extension.StageExtension.md | # StageExtension
## StageExtension
The entry point for Stage Window
### Methods
| Method | Description |
|--------|-------------|
| `on_shutdown()` | |
| `on_startup()` | |
| `show_window(value)` | |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `MENU_GROUP` | |
| `WINDOW_NAME` | |
→
None
| 324 |
omni.kit.window.stage.stage_window.Classes.md | # omni.kit.window.stage.stage_window Classes
## Classes Summary:
| Class | Description |
|-------|-------------|
| [StageWindow](omni.kit.window.stage.stage_window/omni.kit.window.stage.stage_window.StageWindow.html) | The Stage window | | 239 |
omni.kit.window.stage.stage_window.StageWindow.md | # StageWindow
## StageWindow
```python
class omni.kit.window.stage.stage_window.StageWindow:
def __init__(self, usd_context_name: str = ''):
"""
Bases: Window
The Stage window
"""
```
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self, title, dockPreference, **kwargs)` | Construct the window, add it to the underlying windowing system, and makes it appear. |
| `destroy()` | Called by extension before destroying this object. |
| `get_widget()` | |
| `set_visibility_changed_listener(listener)` | |
### Attributes
| Attribute | Description |
|-----------|-------------|
__init__
(
self: omni.ui._ui.Window,
title: str,
dockPreference: omni.ui._ui.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.
- `dockPreference :`
- 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
()
Called by extension before destroying this object. It doesn’t happen automatically. Without this hot reloading doesn’t work.
---
title: "My First Post"
date: 2023-03-01
---
# My First Post
This is my first post on this blog. I'm excited to share my thoughts and ideas with you all.
## Introduction
In this post, I will talk about the importance of learning new skills.
### Importance of Learning New Skills
Learning new skills is important for personal and professional growth. It helps us stay relevant in a constantly changing world.
#### Benefits of Learning New Skills
There are many benefits to learning new skills, including:
- Increased job opportunities
- Higher earning potential
- Improved self-confidence
## Conclusion
In conclusion, learning new skills is essential for success in today's world. I encourage everyone to take the time to learn something new every day.
---
## Another Section
This is another section of the blog post.
### Sub-section
This is a sub-section of the blog post.
#### Code Block
Here is a code block:
```python
print("Hello, world!")
```
## Footer
--- | 3,944 |
omni.kit.window.stage.Submodules.md | # omni.kit.window.stage Submodules
## Submodules Summary
| Module Name | Description |
|--------------------------------------|-------------------|
| omni.kit.window.stage.external_drag_drop_helper | No submodule docstring provided |
| omni.kit.window.stage.selection_watch | No submodule docstring provided |
| omni.kit.window.stage.singleton | No submodule docstring provided |
| omni.kit.window.stage.stage_extension | No submodule docstring provided |
| omni.kit.window.stage.stage_settings | No submodule docstring provided |
| omni.kit.window.stage.stage_window | No submodule docstring provided | | 636 |
omni.kit.xr.openxr.ext.hand_tracking.tests.md | # omni.kit.xr.openxr.ext.hand_tracking.tests
## Module Overview
### Navigation
- [Home](https://docs.omniverse.nvidia.com/kit/docs)
- [API (python)](API.html)
- [Modules](Modules.html)
### Module Details
- **omni.kit.xr.openxr.ext.hand_tracking.tests**
### Footer
--- | 271 |
Subsets and Splits