file_path
stringlengths 5
148
| content
stringlengths 150
498k
| size
int64 150
498k
|
---|---|---|
omni.ui.MenuBar.md | # MenuBar
## MenuBar
The MenuBar class provides a MenuBar at the top of the Window, could also be the MainMenuBar of the MainWindow.
It can only contain Menu, at the moment there is no way to remove item apart from clearing it all together.
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self, **kwargs)` | Construct MenuBar. |
### Attributes
No attributes listed.
### `__init__(self, **kwargs)`
Construct MenuBar.
#### Keyword Arguments:
| Argument | Type | Description |
|----------|------|-------------|
| `tearable` | bool | The ability to tear the window off. |
<dt>
`shown_changed_fn
<span class="classifier">
`
<dd>
<p>
If the pulldown menu is shown on the screen.
<dt>
`teared_changed_fn
<span class="classifier">
`
<dd>
<p>
If the window is teared off.
<dt>
`on_build_fn
<span class="classifier">
`
<dd>
<p>
Called to re-create new children.
<dt>
`text
<span class="classifier">
str`
<dd>
<p>
This property holds the menu’s text.
<dt>
`hotkey_text
<span class="classifier">
str`
<dd>
<p>
This property holds the menu’s hotkey text.
<dt>
`checkable
<span class="classifier">
bool`
<dd>
<p>
This property holds whether this menu item is checkable. A checkable item is one which has an on/off state.
<dt>
`hide_on_click
<span class="classifier">
bool`
<dd>
<p>
Hide or keep the window when the user clicked this item.
<dt>
`delegate
<span class="classifier">
MenuDelegate`
<dd>
<p>
The delegate that generates a widget per menu item.
<dt>
`triggered_fn
<span class="classifier">
void`
<dd>
<p>
Sets the function that is called when an action is activated by the user; for example, when the user clicks a menu option, or presses an action’s shortcut key combination.
<dt>
`direction
<span class="classifier">
`
<dd>
<p>
This type is used to determine the direction of the layout. If the Stack’s orientation is eLeftToRight the widgets are placed in a horizontal row, from left to right. If the Stack’s orientation is eRightToLeft the widgets are placed in a horizontal row, from right to left. If the Stack’s orientation is eTopToBottom, the widgets are placed in a vertical column, from top to bottom. If the Stack’s orientation is eBottomToTop, the widgets are placed in a vertical column, from bottom to top. If the Stack’s orientation is eBackToFront, the widgets are placed sorted in a Z-order in top right corner. If the Stack’s orientation is eFrontToBack, the widgets are placed sorted in a Z-order in top right corner, the first widget goes to front.
<dt>
`content_clipping
<span class="classifier">
`
<dd>
<p>
Determines if the child widgets should be clipped by the rectangle of this Stack.
<dt>
`spacing
<span class="classifier">
`
<dd>
<p>
Sets a non-stretchable space in pixels between child items of this layout.
<dt>
`send_mouse_events_to_back
<span class="classifier">
`
<dd>
<p>
When children of a Z-based stack overlap mouse events are normally sent to the topmost one. Setting this property true will invert that behavior, sending mouse events to the bottom-most child.
<dt>
`width
<span class="classifier">
ui.Length`
<dd>
<p>
This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
<dt>
`height
<span class="classifier">
ui.Length`
<dd>
<p>
This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
<dt>
`name
<span class="classifier">
str`
<dd>
<p>
The name of the widget that user can set.
<dt>
`style_type_name_override
<span class="classifier">
str`
<dd>
<p>
By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
<dt>
`identifier
<span class="classifier">
str`
<dd>
<p>
An optional identifier of the widget we can use to refer to it in queries.
<dt>
`visible
<span class="classifier">
bool`
<dd>
<p>
This property holds whether the widget is visible.
<dt>
`visibleMin
<span class="classifier">
float`
<dd>
<p>
If the current zoom factor and DPI is less than this value, the widget is not visible.
<dt>
`visibleMax
<span class="classifier">
float`
<dd>
<p>
If the current zoom factor and DPI is bigger than this value, the widget is not visible.
<dt>
`tooltip
<span class="classifier">
str`
<dd>
<p>
Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
<dt>
`tooltip_fn
<span class="classifier">
Callable`
<dd>
<p>
Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
<dt>
`tooltip_offset_x
<span class="classifier">
float`
<dd>
<p>
Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
<dt>
`tooltip_offset_y
<span class="classifier">
float`
<dd>
<p>
Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
<dl>
<dt>
`enabled
<span class="classifier">
bool`
<dd>
<p>
This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
<dt>
`selected
<span class="classifier">
bool`
<dd>
<p>
This property holds a flag that specifies the widget has to use eSelected state of the style.
<dt>
`checked
<span class="classifier">
bool`
<dd>
<p>
This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
<dt>
`dragging
<span class="classifier">
bool`
<dd>
<p>
This property holds if the widget is being dragged.
<dt>
`opaque_for_mouse_events
<span class="classifier">
bool`
<dd>
<p>
If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
<dt>
`skip_draw_when_clipped
<span class="classifier">
bool`
<dd>
<p>
The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
<dt>
`mouse_moved_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
<dt>
`mouse_pressed_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
<dt>
`mouse_released_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_double_clicked_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_wheel_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_hovered_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
<dt>
`drag_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
<dt>
`accept_drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
<dt>
`drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget accepts drops and set the callback to the drop operation.
<dt>
`computed_content_size_changed_fn
<span class="classifier">
Callable`
<dd>
<p>
Called when the size of the widget is changed.
| 10,072 |
omni.ui.MenuDelegate.md | # MenuDelegate
## MenuDelegate
MenuDelegate is used to generate widgets that represent the menu item.
### Methods
- **__init__(self, **kwargs)**
- Constructor.
- **build_item(self, item)**
- This method must be reimplemented to generate custom item.
- **build_status(self, item)**
- This method must be reimplemented to generate custom widgets on the bottom of the window.
- **build_title(self, item)**
- This method must be reimplemented to generate custom title.
- **call_on_build_item_fn(self, arg0)**
- Called to create a new item.
- **call_on_build_status_fn(self, arg0)**
- Called to create a new widget on the bottom of the window.
| Method | Description |
| --- | --- |
| `call_on_build_title_fn(self, arg0)` | Called to create a new title. |
| `has_on_build_item_fn(self)` | Called to create a new item. |
| `has_on_build_status_fn(self)` | Called to create a new widget on the bottom of the window. |
| `has_on_build_title_fn(self)` | Called to create a new title. |
| `set_default_delegate(delegate)` | Set the default delegate to use it when the item doesn't have a delegate. |
| `set_on_build_item_fn(self, fn, None])` | Called to create a new item. |
| `set_on_build_status_fn(self, fn, None])` | Called to create a new widget on the bottom of the window. |
| `set_on_build_title_fn(self, fn, None])` | Called to create a new title. |
### Attributes
| Attribute | Description |
| --- | --- |
| `propagate` | |
### omni.ui.MenuDelegate.__init__
Constructor.
#### Keyword Arguments:
- `on_build_item`: Called to create a new item.
- `on_build_title`: Called to create a new title.
- `on_build_status`: Called to create a new widget on the bottom of the window.
- `propagate`: Determine if Menu children should use this delegate when they don’t have the own one.
## build_item
```python
build_item(self: omni.ui._ui.MenuDelegate, item: omni::ui::MenuHelper) -> None
```
This method must be reimplemented to generate custom item.
## build_status
```python
build_status(self: omni.ui._ui.MenuDelegate, item: omni::ui::MenuHelper) -> None
```
This method must be reimplemented to generate custom widgets on the bottom of the window.
## build_title
```python
build_title(self: omni.ui._ui.MenuDelegate, item: omni::ui::MenuHelper) -> None
```
This method must be reimplemented to generate custom title.
## call_on_build_item_fn
```python
call_on_build_item_fn(self: omni.ui._ui.MenuDelegate, arg0: omni::ui::MenuHelper) -> None
```
Called to create a new item.
## call_on_build_status_fn
```python
call_on_build_status_fn(self: omni.ui._ui.MenuDelegate, arg0: omni::ui::MenuHelper) -> None
```
Called to create a new widget on the bottom of the window.
## call_on_build_title_fn
```python
call_on_build_title_fn(self: omni.ui._ui.MenuDelegate, arg0: omni::ui::MenuHelper) -> None
```
Called to create a new title.
## has_on_build_item_fn
```python
has_on_build_item_fn(self: omni.ui._ui.MenuDelegate) -> bool
```
This method checks if there is a function to build an item.
### has_on_build_item_fn
- **Parameters**:
- `self`
- `omni.ui._ui.MenuDelegate`
- **Returns**: `bool`
- **Description**: Called to create a new item.
### has_on_build_status_fn
- **Parameters**:
- `self`
- `omni.ui._ui.MenuDelegate`
- **Returns**: `bool`
- **Description**: Called to create a new widget on the bottom of the window.
### has_on_build_title_fn
- **Parameters**:
- `self`
- `omni.ui._ui.MenuDelegate`
- **Returns**: `bool`
- **Description**: Called to create a new title.
### set_default_delegate
- **Parameters**:
- `delegate: MenuDelegate`
- **Returns**: `None`
- **Description**: Set the default delegate to use it when the item doesn’t have a delegate.
### set_on_build_item_fn
- **Parameters**:
- `self: omni.ui._ui.MenuDelegate`
- `fn: Callable[[omni::ui::MenuHelper], None]`
- **Returns**: `None`
- **Description**: Called to create a new item.
### set_on_build_status_fn
- **Parameters**:
- `self: omni.ui._ui.MenuDelegate`
- `fn: Callable[[omni::ui::MenuHelper], None]`
- **Returns**: `None`
- **Description**: Called to create a new widget on the bottom of the window.
### set_on_build_title_fn
- **Parameters**:
- `self: omni.ui._ui.MenuDelegate`
- `fn: Callable[[omni::ui::MenuHelper], None]`
- **Returns**: `None`
- **Description**: Called to create a new title.
<dl>
<dt>
set_on_build_title_fn
<dd>
<p>
Called to create a new title.
| 4,434 |
omni.ui.MenuHelper.md | # MenuHelper
## MenuHelper
The helper class for the menu that draws the menu line.
### Methods
- `__init__(*args, **kwargs)`
- `call_triggered_fn(self)`
- Sets the function that is called when an action is activated by the user; for example, when the user clicks a menu option, or presses an action's shortcut key combination.
- `has_triggered_fn(self)`
- Sets the function that is called when an action is activated by the user; for example, when the user clicks a menu option, or presses an action's shortcut key combination.
- `set_triggered_fn(self, fn)`
- Sets the function that is called when an action is activated by the user; for example, when the user clicks a menu option, or presses an action's shortcut key combination.
### Attributes
- `checkable`
- This property holds whether this menu item is checkable.
<code class="xref py py-obj docutils literal notranslate">
<span class="pre">
delegate
<tr class="row-odd">
<td>
<p>
<a class="reference internal" href="#omni.ui.MenuHelper.hide_on_click" title="omni.ui.MenuHelper.hide_on_click">
<code class="xref py py-obj docutils literal notranslate">
<span class="pre">
hide_on_click
<td>
<p>
Hide or keep the window when the user clicked this item.
<tr class="row-even">
<td>
<p>
<a class="reference internal" href="#omni.ui.MenuHelper.hotkey_text" title="omni.ui.MenuHelper.hotkey_text">
<code class="xref py py-obj docutils literal notranslate">
<span class="pre">
hotkey_text
<td>
<p>
This property holds the menu's hotkey text.
<tr class="row-odd">
<td>
<p>
<code class="xref py py-obj docutils literal notranslate">
<span class="pre">
menu_compatibility
<tr class="row-even">
<td>
<p>
<a class="reference internal" href="#omni.ui.MenuHelper.text" title="omni.ui.MenuHelper.text">
<code class="xref py py-obj docutils literal notranslate">
<span class="pre">
text
<td>
<p>
This property holds the menu's text.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.MenuHelper.__init__">
<span class="sig-name descname">
<span class="pre">
__init__
<span class="sig-paren">
(
<em class="sig-param">
<span class="o">
<span class="pre">
*
<span class="n">
<span class="pre">
args
,
<em class="sig-param">
<span class="o">
<span class="pre">
**
<span class="n">
<span class="pre">
kwargs
<span class="sig-paren">
)
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.MenuHelper.call_triggered_fn">
<span class="sig-name descname">
<span class="pre">
call_triggered_fn
<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">
<a class="reference internal" href="#omni.ui.MenuHelper" title="omni.ui._ui.MenuHelper">
<span class="pre">
omni.ui._ui.MenuHelper
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<dd>
<p>
Sets the function that is called when an action is activated by the user; for example, when the user clicks a menu option, or presses an action’s shortcut key combination.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.MenuHelper.has_triggered_fn">
<span class="sig-name descname">
<span class="pre">
has_triggered_fn
<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">
<a class="reference internal" href="#omni.ui.MenuHelper" title="omni.ui._ui.MenuHelper">
<span class="pre">
omni.ui._ui.MenuHelper
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
bool
<dd>
<p>
Sets the function that is called when an action is activated by the user; for example, when the user clicks a menu option, or presses an action’s shortcut key combination.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.MenuHelper.set_triggered_fn">
<span class="sig-name descname">
<span class="pre">
set_triggered_fn
<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">
<a class="reference internal" href="#omni.ui.MenuHelper" title="omni.ui._ui.MenuHelper">
<span class="pre">
omni.ui._ui.MenuHelper
,
<em class="sig-param">
<span class="n">
<span class="pre">
fn
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
Callable
<span class="p">
<span class="pre">
[
<span class="p">
<span class="pre">
[
<span class="p">
<span class="pre">
]
<span class="p">
<span class="pre">
,
<span class="w">
<span class="pre">
None
<span class="p">
<span class="pre">
]
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
## omni.ui.MenuHelper.set_triggered_fn
Sets the function that is called when an action is activated by the user; for example, when the user clicks a menu option, or presses an action’s shortcut key combination.
## omni.ui.MenuHelper.checkable
This property holds whether this menu item is checkable. A checkable item is one which has an on/off state.
## omni.ui.MenuHelper.hide_on_click
Hide or keep the window when the user clicked this item.
## omni.ui.MenuHelper.hotkey_text
This property holds the menu’s hotkey text.
## omni.ui.MenuHelper.text
This property holds the menu’s text. | 5,564 |
omni.ui.MenuItem.md | # MenuItem
## MenuItem
Bases: `Widget`, `MenuHelper`
A MenuItem represents the items the Menu consists of. MenuItem can be inserted only once in the menu.
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self, arg0, **kwargs)` | Construct MenuItem. |
### Attributes
| Attribute | Description |
|-----------|-------------|
```
```markdown
### `__init__(self, arg0, **kwargs)`
Construct MenuItem.
Parameters:
- `self`: Instance of `omni.ui._ui.MenuItem`
- `arg0`: str
- `**kwargs`: Additional keyword arguments
Returns:
- None
```
### Keyword Arguments:
- `kwargs`
- dict
- See below
- `text`
- str
- This property holds the menu’s text.
- `hotkey_text`
- str
- This property holds the menu’s hotkey text.
- `checkable`
- bool
- This property holds whether this menu item is checkable. A checkable item is one which has an on/off state.
- `hide_on_click`
- bool
- Hide or keep the window when the user clicked this item.
- `delegate`
- MenuDelegate
- The delegate that generates a widget per menu item.
- `triggered_fn`
- void
- Sets the function that is called when an action is activated by the user; for example, when the user clicks a menu option, or presses an action’s shortcut key combination.
- `width`
- ui.Length
- This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
- `height`
- ui.Length
- This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
- `name`
- str
- The name of the widget that user can set.
- `style_type_name_override`
- str
- By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
- `identifier`
- str
- An optional identifier of the widget we can use to refer to it in queries.
- `visible`
- bool
- This property holds whether the widget is visible.
- `visibleMin`
- float
- If the current zoom factor and DPI is less than this value, the widget is not visible.
- `visibleMax`
- float
- If the current zoom factor and DPI is bigger than this value, the widget is not visible.
- `tooltip`
- str
- Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
- `tooltip_fn`
- Callable
- Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
- `tooltip_offset_x`
- float
- Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
- `tooltip_offset_y`
- float
- Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
- `enabled`
- bool
- This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
- `selected`
- bool
- This property holds a flag that specifies the widget has to use eSelected state of the style.
- `checked`
- bool
- This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
- `dragging`
- bool
- This property holds if the widget is being dragged.
- `opaque_for_mouse_events`
- bool
- If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
- `skip_draw_when_clipped`
- bool
- The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
<dl>
<dt>
`mouse_moved_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
<dt>
`mouse_pressed_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
<dt>
`mouse_released_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_double_clicked_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_wheel_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_hovered_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
<dt>
`drag_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
<dt>
`accept_drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
<dt>
`drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget accepts drops and set the callback to the drop operation.
<dt>
`computed_content_size_changed_fn
<span class="classifier">
Callable`
<dd>
<p>
Called when the size of the widget is changed.
| 7,435 |
omni.ui.MultiFloatDragField.md | # MultiFloatDragField
MultiFloatDragField is the widget that has a sub widget (FloatDrag) per model item. It’s handy to use it for multi-component data, like for example, float3 or color.
## Methods
- `__init__(*args, **kwargs)`
- Overloaded function.
## Attributes
- `max`
- This property holds the drag's maximum value.
- `min`
- This property holds the drag's minimum value.
- `step`
- This property controls the stepping speed on the drag.
**`__init__(self: omni.ui._ui.MultiFloatDragField, **kwargs)`**
Overloaded function.
1. `__init__(self: omni.ui._ui.MultiFloatDragField, **kwargs) -> None`
2. `__init__(self: omni.ui._ui.MultiFloatDragField, arg0: omni.ui._ui.AbstractItemModel, **kwargs) -> None`
3. `__init__(self: omni.ui._ui.MultiFloatDragField, *args, **kwargs) -> None`
Constructs MultiFloatDragField.
### Arguments:
- `model :`
- The widget’s model. If the model is not assigned, the default model is created.
- `kwargs`
- See below
### Keyword Arguments:
- `min`
- This property holds the drag’s minimum value.
- `max`
- This property holds the drag’s maximum value.
- `step`
- This property controls the stepping speed on the drag.
- `column_count`
- The max number of fields in a line.
- `h_spacing`
- Sets a non-stretchable horizontal space in pixels between child fields.
- `v_spacing`
- Sets a non-stretchable vertical space in pixels between child fields.
- `width`
- This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
- `height`
- This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
- `name`
- The name of the widget that user can set.
- `style_type_name_override`
- By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
- `identifier`
- An optional identifier of the widget we can use to refer to it in queries.
- `visible`
- This property holds whether the widget is visible.
- `visibleMin`
- If the current zoom factor and DPI is less than this value, the widget is not visible.
- `visibleMax`
- If the current zoom factor and DPI is bigger than this value, the widget is not visible.
- `tooltip`
- Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
- `tooltip_fn`
- Set dynamic tooltip that will be created dynamically the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
- `tooltip_offset_x`
- Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
- `tooltip_offset_y`
- Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
- `enabled`
- This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
- `selected`
- This property holds a flag that specifies the widget has to use eSelected state of the style.
- `checked`
- This property holds a flag that specifies the widget has to use eChecked state of the style.
<dd>
<p>
This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
<dt>
`dragging
<span class="classifier">
bool`
<dd>
<p>
This property holds if the widget is being dragged.
<dt>
`opaque_for_mouse_events
<span class="classifier">
bool`
<dd>
<p>
If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
<dt>
`skip_draw_when_clipped
<span class="classifier">
bool`
<dd>
<p>
The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
<dt>
`mouse_moved_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
<dt>
`mouse_pressed_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
<dt>
`mouse_released_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_double_clicked_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_wheel_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_hovered_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
<dt>
`drag_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
<dt>
`accept_drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
<dt>
`drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget accepts drops and set the callback to the drop operation.
<dt>
`computed_content_size_changed_fn
<span class="classifier">
Callable`
<dd>
<p>
Called when the size of the widget is changed.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.MultiFloatDragField.max">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
max
<a class="headerlink" href="#omni.ui.MultiFloatDragField.max" title="Permalink to this definition">
<dd>
<p>
This property holds the drag’s maximum value.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.MultiFloatDragField.min">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
min
<a class="headerlink" href="#omni.ui.MultiFloatDragField.min" title="Permalink to this definition">
<dd>
<p>
This property holds the drag’s minimum value.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.MultiFloatDragField.step">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
step
<a class="headerlink" href="#omni.ui.MultiFloatDragField.step" title="Permalink to this definition">
<dd>
<p>
This property controls the steping speed on the drag.
<footer>
<hr/>
| 8,704 |
omni.ui.MultiFloatField.md | # MultiFloatField
## Overview
MultiFloatField is the widget that has a sub widget (FloatField) per model item. It’s handy to use it for multi-component data, like for example, float3 or color.
### Methods
- `__init__(*args, **kwargs)`
- Overloaded function.
### Attributes
- None listed.
## Detailed Description
### `__init__(*args, **kwargs)`
- Overloaded function.
- `__init__(self: omni.ui._ui.MultiFloatField, **kwargs) -> None`
- `__init__(self: omni.ui._ui.MultiFloatField, arg0: omni.ui._ui.AbstractItemModel, **kwargs) -> None`
- `__init__(self: omni.ui._ui.MultiFloatField, *args, **kwargs) -> None`
Constructor.
**Keyword Arguments:**
- `column_count`
### max_fields_in_line
The max number of fields in a line.
### h_spacing
Sets a non-stretchable horizontal space in pixels between child fields.
### v_spacing
Sets a non-stretchable vertical space in pixels between child fields.
### width
This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
### height
This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
### name
The name of the widget that user can set.
### style_type_name_override
By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
### identifier
An optional identifier of the widget we can use to refer to it in queries.
### visible
This property holds whether the widget is visible.
### visibleMin
If the current zoom factor and DPI is less than this value, the widget is not visible.
### visibleMax
If the current zoom factor and DPI is bigger than this value, the widget is not visible.
### tooltip
Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
### tooltip_fn
Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
### tooltip_offset_x
Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
### tooltip_offset_y
Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
### enabled
This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
### selected
This property holds a flag that specifies the widget has to use eSelected state of the style.
### checked
This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
### dragging
This property holds if the widget is being dragged.
### opaque_for_mouse_events
If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
### skip_draw_when_clipped
The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
### mouse_moved_fn
Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
### mouse_pressed_fn
Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
### mouse_released_fn
Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dl>
<dt>
`mouse_double_clicked_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_wheel_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_hovered_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
<dt>
`drag_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
<dt>
`accept_drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
<dt>
`drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget accepts drops and set the callback to the drop operation.
<dt>
`computed_content_size_changed_fn
<span class="classifier">
Callable`
<dd>
<p>
Called when the size of the widget is changed.
| 6,567 |
omni.ui.OffsetLine.md | # OffsetLine
## OffsetLine
```python
class omni.ui.OffsetLine
```
Bases:
```python
omni.ui._ui.FreeLine
```
The free widget is the widget that is independent of the layout. It draws the line stuck to the bounds of other widgets.
### Methods
```python
__init__(self, arg0, arg1, **kwargs)
```
### Attributes
```python
bound_offset
```
The offset from the bounds of the widgets this line is stuck to.
```python
offset
```
The offset to the direction of the line normal.
```python
__init__(self: omni.ui._ui.OffsetLine, arg0: omni.ui._ui.Widget)
```
## omni.ui.OffsetLine.__init__(self, arg0: omni.ui._ui.Widget, arg1: omni.ui._ui.Widget, **kwargs) -> None
- **Description:**
- Initializes a new instance of the OffsetLine class.
- `arg0` and `arg1` are instances of `omni.ui._ui.Widget`.
- `**kwargs` allows additional keyword arguments.
## property bound_offset
- **Description:**
- The offset from the bounds of the widgets this line is stuck to.
## property offset
- **Description:**
- The offset to the direction of the line normal. | 1,049 |
omni.ui.Percent.md | # Percent
## Overview
Percent is a class that represents a length in percents from the parent widget. It is derived from the `Length` class.
### Methods
- `__init__(self, value)`
- **Description**: Constructs a Percent instance.
- **Parameters**:
- `self`: The instance of the Percent class.
- `value`: The float value representing the percentage.
- **Returns**: None
### Attributes
- None specified
## Detailed Method Description
### `__init__(self, value)`
**Description**: Initializes a new instance of the Percent class.
**Parameters**:
- `self`: The instance of the Percent class.
- `value`: A float representing the percentage value.
**Returns**: None
**Keyword Arguments**:
- `kwargs`: A dictionary containing additional keyword arguments.
### Example Usage:
```python
# Example code here if available
``` | 838 |
omni.ui.Placer.md | # Placer
## Class
```python
class omni.ui.Placer
```
Bases: [Container](omni.ui.Container.html#omni.ui.Container)
The Placer class place a single widget to a particular position based on the offet.
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self, **kwargs)` | Construct Placer. |
| `invalidate_raster(self)` | This method regenerates the raster image of the widget, even if the widget's content has not changed. |
| `set_offset_x_changed_fn(self, arg0)` | offsetX defines the offset placement for the child widget relative to the Placer |
| `set_offset_y_changed_fn(self, arg0)` | offsetY defines the offset placement for the child widget relative to the Placer |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `drag_axis` | Sets if dragging can be horizontally or vertically. |
| Property | Description |
|----------|-------------|
| `draggable` | Provides a convenient way to make an item draggable. |
| `frames_to_start_drag` | The placer size depends on the position of the child when false. |
| `offset_x` | offsetX defines the offset placement for the child widget relative to the Placer |
| `offset_y` | offsetY defines the offset placement for the child widget relative to the Placer |
| `raster_policy` | Determine how the content of the frame should be rasterized. |
| `stable_size` | The placer size depends on the position of the child when false. |
### omni.ui.Placer.__init__
Construct Placer.
#### Keyword Arguments:
- `offset_x` (toLength): offsetX defines the offset placement for the child widget relative to the Placer
- `offset_y` (toLength): offsetY defines the offset placement for the child widget relative to the Placer
- `draggable` (bool): Provides a convenient way to make an item draggable.
- `drag_axis` (Axis): Sets if dragging can be horizontally or vertically.
- `stable_size` (bool): The placer size depends on the position of the child when false.
- `raster_policy`: Determine how the content of the frame should be rasterized.
- `offset_x_changed_fn` (Callable[[ui.Length], None]): offsetX defines the offset placement for the child widget relative to the Placer
- `offset_y_changed_fn` (Callable[[ui.Length], None]): offsetY defines the offset placement for the child widget relative to the Placer
- `width` (ui.Length): This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
- `height` (ui.Length): This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
- `name` (str): The name of the widget that user can set.
- `style_type_name_override`
<span class="classifier">
str`
<dd>
<p>
By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
<dt>
`identifier
<span class="classifier">
str`
<dd>
<p>
An optional identifier of the widget we can use to refer to it in queries.
<dt>
`visible
<span class="classifier">
bool`
<dd>
<p>
This property holds whether the widget is visible.
<dt>
`visibleMin
<span class="classifier">
float`
<dd>
<p>
If the current zoom factor and DPI is less than this value, the widget is not visible.
<dt>
`visibleMax
<span class="classifier">
float`
<dd>
<p>
If the current zoom factor and DPI is bigger than this value, the widget is not visible.
<dt>
`tooltip
<span class="classifier">
str`
<dd>
<p>
Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
<dt>
`tooltip_fn
<span class="classifier">
Callable`
<dd>
<p>
Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
<dt>
`tooltip_offset_x
<span class="classifier">
float`
<dd>
<p>
Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
<dt>
`tooltip_offset_y
<span class="classifier">
float`
<dd>
<p>
Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
<dt>
`enabled
<span class="classifier">
bool`
<dd>
<p>
This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
<dt>
`selected
<span class="classifier">
bool`
<dd>
<p>
This property holds a flag that specifies the widget has to use eSelected state of the style.
<dt>
`checked
<span class="classifier">
bool`
<dd>
<p>
This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
<dt>
`dragging
<span class="classifier">
bool`
<dd>
<p>
This property holds if the widget is being dragged.
<dt>
`opaque_for_mouse_events
<span class="classifier">
bool`
<dd>
<p>
If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
<dt>
`skip_draw_when_clipped
<span class="classifier">
bool`
<dd>
<p>
The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
<dt>
`mouse_moved_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
<dt>
`mouse_pressed_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
<dt>
`mouse_released_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_double_clicked_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_wheel_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_hovered_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
<dt>
`drag_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
<dt>
`accept_drop_fn
<span class="classifier">
Callable`
<dl>
<dt>
`can_accept_drops_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
<dt>
`drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget accepts drops and set the callback to the drop operation.
<dt>
`computed_content_size_changed_fn
<span class="classifier">
Callable`
<dd>
<p>
Called when the size of the widget is changed.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.Placer.invalidate_raster">
<span class="sig-name descname">
<span class="pre">
invalidate_raster
<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.ui._ui.Placer
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<dd>
<p>
This method regenerates the raster image of the widget, even if the widget’s content has not changed. This can be used with both the eOnDemand and eAuto raster policies, and is used to update the content displayed in the widget. Note that this operation may be resource-intensive, and should be used sparingly.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.Placer.set_offset_x_changed_fn">
<span class="sig-name descname">
<span class="pre">
set_offset_x_changed_fn
<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.ui._ui.Placer
,
<em class="sig-param">
<span class="n">
<span class="pre">
arg0
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
Callable
<span class="p">
<span class="pre">
[
<span class="p">
<span class="pre">
[
<span class="pre">
omni.ui._ui.Length
<span class="p">
<span class="pre">
]
<span class="p">
<span class="pre">
,
<span class="w">
<span class="pre">
None
<span class="p">
<span class="pre">
]
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<dd>
<p>
offsetX defines the offset placement for the child widget relative to the Placer
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.Placer.set_offset_y_changed_fn">
<span class="sig-name descname">
<span class="pre">
set_offset_y_changed_fn
<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.ui._ui.Placer
,
<em class="sig-param">
<span class="n">
<span class="pre">
arg0
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
Callable
<span class="p">
<span class="pre">
[
<span class="p">
<span class="pre">
[
<span class="pre">
omni.ui._ui.Length
<span class="p">
<span class="pre">
]
<span class="p">
<span class="pre">
,
<span class="w">
<span class="pre">
None
<span class="p">
<span class="pre">
]
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<dd>
<p>
offsetY defines the offset placement for the child widget relative to the Placer
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.Placer.drag_axis">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
drag_axis
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.Placer.draggable">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
draggable
<a class="headerlink" href="#omni.ui.Placer.draggable" title="Permalink to this definition">
<dd>
<p>
Provides a convenient way to make an item draggable.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.Placer.frames_to_start_drag">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
frames_to_start_drag
<a class="headerlink" href="#omni.ui.Placer.frames_to_start_drag" title="Permalink to this definition">
<dd>
<p>
The placer size depends on the position of the child when false.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.Placer.offset_x">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
offset_x
<a class="headerlink" href="#omni.ui.Placer.offset_x" title="Permalink to this definition">
<dd>
<p>
offsetX defines the offset placement for the child widget relative to the Placer
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.Placer.offset_y">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
offset_y
<a class="headerlink" href="#omni.ui.Placer.offset_y" title="Permalink to this definition">
<dd>
<p>
offsetY defines the offset placement for the child widget relative to the Placer
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.Placer.raster_policy">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
raster_policy
<a class="headerlink" href="#omni.ui.Placer.raster_policy" title="Permalink to this definition">
<dd>
<p>
Determine how the content of the frame should be rasterized.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.Placer.stable_size">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
stable_size
<a class="headerlink" href="#omni.ui.Placer.stable_size" title="Permalink to this definition">
<dd>
<p>
The placer size depends on the position of the child when false.
| 16,434 |
omni.ui.Plot.md | # Plot
## Methods
- `__init__(self, type, scale_min, scale_max, ...)`
- Construct Plot.
- `set_data(self, *args)`
- Sets the image data value.
- `set_data_provider_fn(self, arg0, arg1)`
- Sets the function that will be called when when data required.
- `set_xy_data(self, arg0)`
- (No description provided)
## Attributes
- `scale_max`
- This property holds the max scale values.
- `scale_min`
- (No description provided)
| Property | Description |
|------------------------|-----------------------------------------------------------------------------|
| title | This property holds the title of the image. |
| type | This property holds the type of the image, can only be line or histogram. |
| value_offset | This property holds the value offset. |
| value_stride | This property holds the stride to get value list. |
### omni.ui.Plot.__init__
__init__(self: omni.ui._ui.Plot, type: omni.ui._ui.Type = <Type.LINE: 0>, scale_min: float = 3.4028234663852886e+38, scale_max: float = 3.4028234663852886e+38, *args, **kwargs) → None
Construct Plot.
#### Arguments:
- `type :` The type of the image, can be line or histogram.
- `scaleMin :` The minimal scale value.
- `scaleMax :` The maximum scale value.
- `valueList :` The list of values to draw the image.
- `kwargs : dict` See below
#### Keyword Arguments:
- `value_offset : int` This property holds the value offset. By default, the value is 0.
- `value_stride : int` This property holds the stride to get value list. By default, the value is 1.
- `title : str` This property holds the title of the image.
- `width : ui.Length` This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
- `height : ui.Length` This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
- `name : str` The name of the widget that user can set.
- `style_type_name_override : str` By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
- `identifier : str` An optional identifier of the widget we can use to refer to it in queries.
<dt>
`visible
<span class="classifier">
bool`
<dd>
<p>
This property holds whether the widget is visible.
<dt>
`visibleMin
<span class="classifier">
float`
<dd>
<p>
If the current zoom factor and DPI is less than this value, the widget is not visible.
<dt>
`visibleMax
<span class="classifier">
float`
<dd>
<p>
If the current zoom factor and DPI is bigger than this value, the widget is not visible.
<dt>
`tooltip
<span class="classifier">
str`
<dd>
<p>
Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
<dt>
`tooltip_fn
<span class="classifier">
Callable`
<dd>
<p>
Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
<dt>
`tooltip_offset_x
<span class="classifier">
float`
<dd>
<p>
Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
<dt>
`tooltip_offset_y
<span class="classifier">
float`
<dd>
<p>
Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
<dt>
`enabled
<span class="classifier">
bool`
<dd>
<p>
This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
<dt>
`selected
<span class="classifier">
bool`
<dd>
<p>
This property holds a flag that specifies the widget has to use eSelected state of the style.
<dt>
`checked
<span class="classifier">
bool`
<dd>
<p>
This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
<dt>
`dragging
<span class="classifier">
bool`
<dd>
<p>
This property holds if the widget is being dragged.
<dt>
`opaque_for_mouse_events
<span class="classifier">
bool`
<dd>
<p>
If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
<dt>
`skip_draw_when_clipped
<span class="classifier">
bool`
<dd>
<p>
The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
<dt>
`mouse_moved_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
<dt>
`mouse_pressed_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
<dt>
`mouse_released_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_double_clicked_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_wheel_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_hovered_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
<dt>
`drag_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
<dt>
`accept_drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
<dt>
`drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget accepts drops and set the callback to the drop operation.
<dt>
`computed_content_size_changed_fn
<span class="classifier">
Callable`
## Methods
### set_data
```python
def set_data(self, *args) -> None
```
Sets the image data value.
### set_data_provider_fn
```python
def set_data_provider_fn(self, arg0: Callable[[int], float], arg1: int) -> None
```
Sets the function that will be called when data is required.
### set_xy_data
```python
def set_xy_data(self, arg0: List[Tuple[float, float]]) -> None
```
## Properties
### scale_max
```python
property scale_max
```
This property holds the max scale values. By default, the value is FLT_MAX.
### scale_min
```python
property scale_min
```
## Properties
### scale_min
This property holds the min scale values. By default, the value is FLT_MAX.
### title
This property holds the title of the image.
### type
This property holds the type of the image, can only be line or histogram. By default, the type is line.
### value_offset
This property holds the value offset. By default, the value is 0.
### value_stride
This property holds the stride to get value list. By default, the value is 1. | 8,939 |
omni.ui.ProgressBar.md | # ProgressBar
## ProgressBar
### Class: omni.ui.ProgressBar
**Bases:**
- [Widget](omni.ui.Widget.html#omni.ui.Widget)
- [ValueModelHelper](omni.ui.ValueModelHelper.html#omni.ui.ValueModelHelper)
A progressbar is a classic widget for showing the progress of an operation.
#### Methods
| Method | Description |
|--------|-------------|
| `__init__(self[, model])` | Construct ProgressBar. |
#### Attributes
No attributes listed.
#### `__init__` Method
```python
__init__(self, model=None, **kwargs)
```
Construct ProgressBar.
```
<dl class="simple">
<dt>
`model :`
<dd>
<p>
The model that determines if the button is checked.
<dt>
`kwargs
<span class="classifier">
dict`
<dd>
<p>
See below
<p>
### Keyword Arguments:
<blockquote>
<div>
<dl class="simple">
<dt>
`width
<span class="classifier">
ui.Length`
<dd>
<p>
This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
<dt>
`height
<span class="classifier">
ui.Length`
<dd>
<p>
This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
<dt>
`name
<span class="classifier">
str`
<dd>
<p>
The name of the widget that user can set.
<dt>
`style_type_name_override
<span class="classifier">
str`
<dd>
<p>
By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
<dt>
`identifier
<span class="classifier">
str`
<dd>
<p>
An optional identifier of the widget we can use to refer to it in queries.
<dt>
`visible
<span class="classifier">
bool`
<dd>
<p>
This property holds whether the widget is visible.
<dt>
`visibleMin
<span class="classifier">
float`
<dd>
<p>
If the current zoom factor and DPI is less than this value, the widget is not visible.
<dt>
`visibleMax
<span class="classifier">
float`
<dd>
<p>
If the current zoom factor and DPI is bigger than this value, the widget is not visible.
<dt>
`tooltip
<span class="classifier">
str`
<dd>
<p>
Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
<dt>
`tooltip_fn
<span class="classifier">
Callable`
<dd>
<p>
Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
<dt>
`tooltip_offset_x
<span class="classifier">
float`
<dd>
<p>
Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
<dt>
`tooltip_offset_y
<span class="classifier">
float`
<dd>
<p>
Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
<dt>
`enabled
<span class="classifier">
bool`
<dd>
<p>
This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
<dt>
`selected
<span class="classifier">
bool`
<dd>
<p>
This property holds a flag that specifies the widget has to use eSelected state of the style.
<dt>
`checked
<span class="classifier">
bool`
<dd>
<p>
This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
<dt>
`dragging
<span class="classifier">
bool`
<dd>
<p>
This property holds if the widget is being dragged.
<dt>
`opaque_for_mouse_events
<span class="classifier">
bool`
<dd>
<p>
If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
<dt>
`skip_draw_when_clipped
<span class="classifier">
bool`
<dd>
<p>
The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
<dt>
`mouse_moved_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
<dt>
`mouse_pressed_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
<dl>
<dt>
`mouse_released_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_double_clicked_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_wheel_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_hovered_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
<dt>
`drag_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
<dt>
`accept_drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
<dt>
`drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget accepts drops and set the callback to the drop operation.
<dt>
`computed_content_size_changed_fn
<span class="classifier">
Callable`
<dd>
<p>
Called when the size of the widget is changed.
| 9,165 |
omni.ui.RadioButton.md | # RadioButton
## RadioButton
RadioButton is the widget that allows the user to choose only one of a predefined set of mutually exclusive options.
RadioButtons are arranged in collections of two or more with the class RadioCollection, which is the central component of the system and controls the behavior of all the RadioButtons in the collection.
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self, **kwargs)` | Constructs RadioButton. |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `radio_collection` | This property holds the button's text. |
#### `__init__(self, **kwargs)`
Constructs RadioButton.
> `kwargs
> <span class="classifier">
> dict`
>
>
> See below
### Keyword Arguments:
> `radio_collection
> <span class="classifier">
> `
>
>
> This property holds the button’s text.
> `text
> <span class="classifier">
> str`
>
>
> This property holds the button’s text.
> `image_url
> <span class="classifier">
> str`
>
>
> This property holds the button’s optional image URL.
> `image_width
> <span class="classifier">
> float`
>
>
> This property holds the width of the image widget. Do not use this function to find the width of the image.
> `image_height
> <span class="classifier">
> float`
>
>
> This property holds the height of the image widget. Do not use this function to find the height of the image.
> `spacing
> <span class="classifier">
> float`
>
>
> Sets a non-stretchable space in points between image and text.
> `clicked_fn
> <span class="classifier">
> Callable[[], None]`
>
>
> Sets the function that will be called when when the button is activated (i.e., pressed down then released while the mouse cursor is inside the button).
> `width
> <span class="classifier">
> ui.Length`
>
>
> This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
> `height
> <span class="classifier">
> ui.Length`
>
>
> This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
> `name
> <span class="classifier">
> str`
>
>
> The name of the widget that user can set.
> `style_type_name_override
> <span class="classifier">
> str`
>
>
> By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
> `identifier
> <span class="classifier">
> str`
>
>
> An optional identifier of the widget we can use to refer to it in queries.
> `visible
> <span class="classifier">
> bool`
>
>
> This property holds whether the widget is visible.
> `visibleMin
> <span class="classifier">
> float`
>
>
> If the current zoom factor and DPI is less than this value, the widget is not visible.
> `visibleMax
> <span class="classifier">
> float`
>
>
> If the current zoom factor and DPI is bigger than this value, the widget is not visible.
> `tooltip
> <span class="classifier">
> str`
>
>
> Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
> `tooltip_fn
> <span class="classifier">
> Callable`
>
>
> Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
> `tooltip_offset_x
> <span class="classifier">
> float`
>
>
> Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
> `tooltip_offset_y
> <span class="classifier">
> float`
>
>
> Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
> `enabled
> <span class="classifier">
> bool`
>
>
> This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
> `selected
> <span class="classifier">
> bool`
>
>
> This property holds a flag that specifies the widget has to use eSelected state of the style.
> `checked
> <span class="classifier">
> bool`
>
>
> This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
> `dragging
> <span class="classifier">
> bool`
>
>
> This property holds if the widget is being dragged.
> `opaque_for_mouse_events
> <span class="classifier">
> bool`
>
>
> If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
<dl>
<dt>
`skip_draw_when_clipped
<span class="classifier">
bool`
<dd>
<p>
The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
<dt>
`mouse_moved_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
<dt>
`mouse_pressed_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
<dt>
`mouse_released_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_double_clicked_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_wheel_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_hovered_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
<dt>
`drag_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
<dt>
`accept_drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
<dt>
`drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget accepts drops and set the callback to the drop operation.
<dt>
`computed_content_size_changed_fn
<span class="classifier">
Callable`
<dd>
<p>
Called when the size of the widget is changed.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.RadioButton.radio_collection">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
radio_collection
<a class="headerlink" href="#omni.ui.RadioButton.radio_collection" title="Permalink to this definition">
<dd>
<p>
This property holds the button’s text.
| 8,909 |
omni.ui.RadioCollection.md | # RadioCollection
Radio Collection is a class that groups RadioButtons and coordinates their state. It makes sure that the choice is mutually exclusive, it means when the user selects a radio button, any previously selected radio button in the same collection becomes deselected.
## Methods
- `__init__(self[, model])`
- Constructs RadioCollection.
## Attributes
(No attributes listed)
## `__init__` Method
- **Parameters:**
- `self` : `omni.ui._ui.RadioCollection`
- `model` : `omni.ui._ui.AbstractValueModel` = None
- `**kwargs`
→ None
Constructs RadioCollection.
> ```
> `kwargs
> dict`
> ```
> See below
### Keyword Arguments:
``` | 654 |
omni.ui.RasterImageProvider.md | # RasterImageProvider
## Class
```python
class omni.ui.RasterImageProvider
```
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self, [source_url])` | doc |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `max_mip_levels` | Maximum number of mip map levels allowed |
| `source_url` | Sets byte data that the image provider will turn into an image. |
### `__init__` Method
```python
__init__(self, source_url: str)
### omni.ui.RasterImageProvider.__init__(self, max_mip_levels=None, **kwargs)
- **doc**
### omni.ui.RasterImageProvider.max_mip_levels
- **Description**: Maximum number of mip map levels allowed
### omni.ui.RasterImageProvider.source_url
- **Description**: Sets byte data that the image provider will turn into an image. | 792 |
omni.ui.RasterPolicy.md | # RasterPolicy
## RasterPolicy
Used to set the rasterization behaviour.
Members:
- NEVER : Do not rasterize the widget at any time.
- ON_DEMAND : Rasterize the widget as soon as possible and always use the rasterized version. This means that the widget will only be updated when the user called invalidateRaster.
- AUTO : Automatically determine whether to rasterize the widget based on performance considerations. If necessary, the widget will be rasterized and updated when its content changes.
### Methods
- `__init__` (self, value)
### Attributes
- `AUTO`
- `NEVER`
- `ON_DEMAND`
- `name`
- `value`
__init__
(
self: omni.ui._ui.RasterPolicy,
value: int
) -> None
property
name | 693 |
omni.ui.scene.AbstractContainer.md | # AbstractContainer
## AbstractContainer
```
```
class omni.ui.scene.AbstractContainer
```
```
Bases: AbstractItem
```
```
Base class for all the items that have children.
```
### Methods
```
__init__(*args, **kwargs)
```
```
clear(self)
```
- **clear(self)**: Removes the container items from the container.
### Attributes
```
None
```
```
__init__(self, *args, **kwargs)
```
```
clear(self)
```
- **clear(self)**: Removes the container items from the container.
### AbstractContainer.clear
Removes the container items from the container. | 553 |
omni.ui.scene.AbstractGesture.md | # AbstractGesture
## AbstractGesture
The base class for the gestures to provides a way to capture mouse events in 3d scene.
### Methods
- `__init__(*args, **kwargs)`
- `get_gesture_payload(*args, **kwargs)`
- `process(self)`
### Attributes
- `gesture_payload`
- `manager`
- `name`
<table>
<tbody>
<tr class="row-even">
<td>
<p>
<code>state
<td>
<p>Get the internal state of the gesture.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.scene.AbstractGesture.__init__">
<span class="sig-name descname">
<span class="__init__">
<span class="sig-paren">(
<em class="sig-param">
<span class="o">*
<span class="n">args
,
<em class="sig-param">
<span class="o">**
<span class="n">kwargs
<span class="sig-paren">)
<dd>
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.scene.AbstractGesture.get_gesture_payload">
<span class="sig-name descname">
<span class="get_gesture_payload">
<span class="sig-paren">(
<em class="sig-param">
<span class="o">*
<span class="n">args
,
<em class="sig-param">
<span class="o">**
<span class="n">kwargs
<span class="sig-paren">)
<dd>
<p>Overloaded function.
<ol class="arabic simple">
<li>
<p>get_gesture_payload(self: omni.ui_scene._scene.AbstractGesture) -> omni.ui_scene._scene.AbstractGesture.GesturePayload
<p>Shortcut for sender.get_gesturePayload.
OMNIUI_SCENE_API const*
<ol class="arabic simple" start="2">
<li>
<p>get_gesture_payload(self: omni.ui_scene._scene.AbstractGesture, arg0: omni.ui_scene._scene.GestureState) -> omni.ui_scene._scene.AbstractGesture.GesturePayload
<p>Shortcut for sender.get_gesturePayload.
OMNIUI_SCENE_API const*
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.scene.AbstractGesture.process">
<span class="sig-name descname">
<span class="process">
<span class="sig-paren">(
<em class="sig-param">
<span class="n">self
<span class="p">:
<span class="n">omni.ui_scene._scene.AbstractGesture
<span class="sig-paren">)
<span class="sig-return">
<span class="sig-return-typehint">None
<dd>
<p>Process the gesture and call callbacks if necessary.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.AbstractGesture.gesture_payload">
<em class="property">
<span class="property">
<span class="sig-name descname">
<span class="gesture_payload">
<dd>
<p>Shortcut for sender.get_gesturePayload.
OMNIUI_SCENE_API const*
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.AbstractGesture.manager">
<em class="property">
<span class="property">
<span class="sig-name descname">
<span class="manager">
<dd>
<p>The Manager that controls this gesture.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.AbstractGesture.name">
<em class="property">
<span class="property">
<span class="sig-name descname">
<span class="name">
<dd>
<p>The name of the object. It’s used for debugging.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.AbstractGesture.state">
<em class="property">
<span class="property">
<span class="sig-name descname">
<span class="state">
<dd>
<p>Get the internal state of the gesture.
| 3,661 |
omni.ui.scene.AbstractItem.md | # AbstractItem
## Methods
- `__init__(*args, **kwargs)`
- `compute_visibility(self)`
- Calculate the effective visibility of this prim, as defined by its most ancestral invisible opinion, if any.
- `transform_space(self, arg0, arg1, arg2)`
- Transform the given point from the coordinate system fromspace to the coordinate system tospace.
## Attributes
- `scene_view`
- The current SceneView this item is parented to.
- `visible`
- This property holds whether the item is visible.
<span class="pre">
args
,
<span class="pre">
**
<span class="pre">
kwargs
)
<span class="pre">
compute_visibility
(
<span class="pre">
self
:
<span class="pre">
omni.ui_scene._scene.AbstractItem
)
→
<span class="pre">
bool
Calculate the effective visibility of this prim, as defined by its most ancestral invisible opinion, if any.
<span class="pre">
transform_space
(
<span class="pre">
self
:
<span class="pre">
omni.ui_scene._scene.AbstractItem
,
<span class="pre">
arg0
:
<span class="pre">
omni.ui_scene._scene.Space
,
<span class="pre">
arg1
:
<span class="pre">
omni.ui_scene._scene.Space
,
<span class="pre">
arg2
:
<span class="pre">
handle
)
→
<span class="pre">
object
Transform the given point from the coordinate system fromspace to the coordinate system tospace.
<span class="pre">
property
<span class="pre">
scene_view
The current SceneView this item is parented to.
<span class="pre">
property
<span class="pre">
visible
This property holds whether the item is visible. | 1,508 |
omni.ui.scene.AbstractManipulatorItem.md | # AbstractManipulatorItem
## AbstractManipulatorItem
```python
class omni.ui.scene.AbstractManipulatorItem
```
Bases: `pybind11_object`
### Methods
```python
__init__(self)
```
```python
def __init__(self: omni.ui_scene._scene.AbstractManipulatorItem) -> None
```
``` | 269 |
omni.ui.scene.AbstractManipulatorModel.md | # AbstractManipulatorModel
## AbstractManipulatorModel
Bridge to data. Operates with double and int arrays. No strings. No tree, it’s a flat list of items. Manipulator requires the model has specific items.
### Methods
- `__init__(self)`
- `add_item_changed_fn(self, arg0)` - Adds the function that will be called every time the value changes.
- `get_as_bool(self, arg0)` - Shortcut for `get_as_ints` that returns the first item of the list.
- `get_as_float(self, arg0)` - Shortcut for `get_as_floats` that returns the first item of the list.
- `get_as_floats(self, arg0)` - Returns the Float values of the item.
- `get_as_int(self, arg0)` - Returns the Int values of the item.
| Method | Description |
|--------|-------------|
| `get_as_ints` (self, arg0) | Shortcut for `get_as_ints` that returns the first item of the list. |
| `get_as_ints` (self, arg0) | Returns the int values of the item. |
| `get_item` (self, arg0) | Returns the items that represents the identifier. |
| `remove_item_changed_fn` (self, arg0) | Remove the callback by its id. |
| `set_bool` (self, arg0, arg1) | Shortcut for `set_ints` that sets an array with the size of one. |
| `set_float` (self, arg0, arg1) | Shortcut for `set_floats` that sets an array with the size of one. |
| `set_floats` (self, arg0, arg1) | Sets the Float values of the item. |
| `set_int` (self, arg0, arg1) | Shortcut for `set_ints` that sets an array with the size of one. |
| `set_ints` (self, arg0, arg1) | Sets the int values of the item. |
| `subscribe_item_changed_fn` (self, arg0) | Adds the function that will be called every time the value changes. |
### `__init__` (self)
- Returns: None
### `add_item_changed_fn` (self, arg0)
- arg0: Callable[[omni.ui_scene._scene.AbstractManipulatorModel]]
<span class="pre">
omni.ui_scene._scene.AbstractManipulatorModel
,
<span class="pre">
omni.ui_scene._scene.AbstractManipulatorItem
]
,
None
]
)
→
int
Adds the function that will be called every time the value changes.
The id of the callback that is used to remove the callback.
get_as_bool
(
self : omni.ui_scene._scene.AbstractManipulatorModel,
arg0 : handle
)
→
bool
Shortcut for `get_as_ints` that returns the first item of the list.
get_as_float
(
self : omni.ui_scene._scene.AbstractManipulatorModel,
arg0 : handle
)
→
float
Shortcut for `get_as_floats` that returns the first item of the list.
get_as_floats
(
self : omni.ui_scene._scene.AbstractManipulatorModel,
arg0 : handle
)
→
List[float]
Returns the Float values of the item.
get_as_int
(
self : omni.ui_scene._scene.AbstractManipulatorModel,
arg0 : handle
)
→
int
### omni.ui.scene.AbstractManipulatorModel.get_as_int
- **Method**: `get_as_int(arg0: handle)`
- **Return**: `int`
- **Description**: Shortcut for `get_as_ints` that returns the first item of the list.
### omni.ui.scene.AbstractManipulatorModel.get_as_ints
- **Method**: `get_as_ints(arg0: handle)`
- **Return**: `List[int]`
- **Description**: Returns the int values of the item.
### omni.ui.scene.AbstractManipulatorModel.get_item
- **Method**: `get_item(arg0: str)`
- **Return**: `omni.ui_scene._scene.AbstractManipulatorItem`
- **Description**: Returns the items that represents the identifier.
### omni.ui.scene.AbstractManipulatorModel.remove_item_changed_fn
- **Method**: `remove_item_changed_fn(arg0: int)`
- **Return**: `None`
- **Description**: Remove the callback by its id.
- **Arguments**:
- `id :` The id that addValueChangedFn returns.
omni.ui_scene._scene.AbstractManipulatorModel
arg0 : handle, arg1 : bool
None
Shortcut for `set_ints` that sets an array with the size of one.
set_float
(
self : omni.ui_scene._scene.AbstractManipulatorModel,
arg0 : handle,
arg1 : float
)
None
Shortcut for `set_floats` that sets an array with the size of one.
set_floats
(
self : omni.ui_scene._scene.AbstractManipulatorModel,
arg0 : handle,
arg1 : List[float]
)
None
Sets the Float values of the item.
set_int
(
self : omni.ui_scene._scene.AbstractManipulatorModel,
arg0 : handle,
arg1 : int
)
None
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.scene.AbstractManipulatorModel.set_int">
<span class="sig-name descname">
<span class="pre">
set_int
<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.ui.scene.AbstractManipulatorModel
,
<em class="sig-param">
<span class="n">
<span class="pre">
arg0
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
int
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<a class="headerlink" href="#omni.ui.scene.AbstractManipulatorModel.set_int" title="Permalink to this definition">
<dd>
<p>
Shortcut for `set_ints` that sets an array with the size of one.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.scene.AbstractManipulatorModel.set_ints">
<span class="sig-name descname">
<span class="pre">
set_ints
<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.ui_scene._scene.AbstractManipulatorModel
,
<em class="sig-param">
<span class="n">
<span class="pre">
arg0
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
handle
,
<em class="sig-param">
<span class="n">
<span class="pre">
arg1
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
List
<span class="p">
<span class="pre">
[
<span class="pre">
int
<span class="p">
<span class="pre">
]
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<a class="headerlink" href="#omni.ui.scene.AbstractManipulatorModel.set_ints" title="Permalink to this definition">
<dd>
<p>
Sets the int values of the item.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.scene.AbstractManipulatorModel.subscribe_item_changed_fn">
<span class="sig-name descname">
<span class="pre">
subscribe_item_changed_fn
<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">
AbstractManipulatorModel
,
<em class="sig-param">
<span class="n">
<span class="pre">
arg0
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
Callable
<span class="p">
<span class="pre">
[
<span class="p">
<span class="pre">
[
<span class="pre">
omni.ui_scene._scene.AbstractManipulatorModel
<span class="p">
<span class="pre">
,
<span class="w">
<span class="pre">
omni.ui_scene._scene.AbstractManipulatorItem
<span class="p">
<span class="pre">
]
<span class="p">
<span class="pre">
,
<span class="w">
<span class="pre">
None
<span class="p">
<span class="pre">
]
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
carb._carb.Subscription
<a class="headerlink" href="#omni.ui.scene.AbstractManipulatorModel.subscribe_item_changed_fn" title="Permalink to this definition">
<dd>
<p>
Adds the function that will be called every time the value changes.
The id of the callback that is used to remove the callback.
| 9,159 |
omni.ui.scene.AbstractShape.md | # AbstractShape
## 概述
AbstractShape 是所有可绘制并可与鼠标指针相交的项目的基类。
### 方法
- `__init__(*args, **kwargs)`
- `get_gesture_payload(*args, **kwargs)`
### 属性
- `gesture_payload`: 包含所有关于交点的信息。
- `gestures`: 所有分配给此形状的手势。
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.scene.AbstractShape.get_gesture_payload">
<span class="sig-name descname">
<span class="pre">
get_gesture_payload
<span class="sig-paren">
(
<em class="sig-param">
<span class="o">
<span class="pre">
*
<span class="n">
<span class="pre">
args
,
<em class="sig-param">
<span class="o">
<span class="pre">
**
<span class="n">
<span class="pre">
kwargs
<span class="sig-paren">
)
<dd>
<p>
Overloaded function.
<ol class="arabic simple">
<li>
<p>
get_gesture_payload(self: omni.ui_scene._scene.AbstractShape) -> omni.ui_scene._scene.AbstractGesture.GesturePayload
<p>
Contains all the information about the intersection.
<ol class="arabic simple" start="2">
<li>
<p>
get_gesture_payload(self: omni.ui_scene._scene.AbstractShape, arg0: omni.ui_scene._scene.GestureState) -> omni.ui_scene._scene.AbstractGesture.GesturePayload
<p>
Contains all the information about the intersection at the specific state.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.AbstractShape.gesture_payload">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
gesture_payload
<dd>
<p>
Contains all the information about the intersection.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.AbstractShape.gestures">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
gestures
<dd>
<p>
All the gestures assigned to this shape.
| 2,350 |
omni.ui.scene.Arc.md | # Arc
## Methods
- `__init__(self, radius, **kwargs)`
- Constructs Arc.
- `get_gesture_payload(*args, **kwargs)`
- Overloaded function.
## Attributes
- `axis`
- The axis the circle plane is perpendicular to.
- `begin`
- Y to Z, Z to X, X to Y
- `color`
- The color of the line.
- `culling`
- Draw two radii of the circle.
| Property | Description |
|----------|-------------|
| Y to Z, Z to X, X to Y | Description of the property. |
| gesture_payload | Contains all the information about the intersection. |
| intersection_thickness | The thickness of the line for the intersection. |
| radius | Description of the property. |
| sector | Draw two radii of the circle. |
| tesselation | Number of points on the curve. |
| thickness | The thickness of the line. |
| wireframe | When true, it's a line. |
### omni.ui.scene.Arc.__init__(self, radius: float, **kwargs) -> None
- Constructs Arc.
- **kwargs: dict**
- See below
#### Keyword Arguments:
- **begin**: The start angle of the arc. Angle placement and directions are (0 to 90): Y to Z, Z to X, X to Y
- **end**: The end angle of the arc. Angle placement and directions are (0 to 90): Y to Z, Z to X, X to Y
- **thickness**: The thickness of the line.
- **intersection_thickness**: The thickness of the line for the intersection.
- **color**: The color of the line.
- **tesselation**: Number of points on the curve.
- **axis**: The axis the circle plane is perpendicular to.
- **sector**: Draw two radii of the circle.
- **culling**: Description of the property.
<dd>
<p>
Draw two radii of the circle.
<dt>
`wireframe
<span class="classifier">
`
<dd>
<p>
When true, it’s a line. When false it’s a mesh.
<dt>
`gesture
<span class="classifier">
`
<dd>
<p>
All the gestures assigned to this shape.
<dt>
`gestures
<span class="classifier">
`
<dd>
<p>
All the gestures assigned to this shape.
<dt>
`visible
<span class="classifier">
`
<dd>
<p>
This property holds whether the item is visible.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.scene.Arc.get_gesture_payload">
<span class="sig-name descname">
<span class="pre">
get_gesture_payload
<span class="sig-paren">
(
<em class="sig-param">
<span class="o">
<span class="pre">
*
<span class="n">
<span class="pre">
args
,
<em class="sig-param">
<span class="o">
<span class="pre">
**
<span class="n">
<span class="pre">
kwargs
<span class="sig-paren">
)
<a class="headerlink" href="#omni.ui.scene.Arc.get_gesture_payload" title="Permalink to this definition">
<dd>
<p>
Overloaded function.
<ol class="arabic simple">
<li>
<p>
get_gesture_payload(self: omni.ui_scene._scene.Arc) -> omni.ui_scene._scene.ArcGesturePayload
<p>
Contains all the information about the intersection.
<ol class="arabic simple" start="2">
<li>
<p>
get_gesture_payload(self: omni.ui_scene._scene.Arc, arg0: omni.ui_scene._scene.GestureState) -> omni.ui_scene._scene.ArcGesturePayload
<p>
Contains all the information about the intersection at the specific state.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.Arc.axis">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
axis
<a class="headerlink" href="#omni.ui.scene.Arc.axis" title="Permalink to this definition">
<dd>
<p>
The axis the circle plane is perpendicular to.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.Arc.begin">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
begin
<a class="headerlink" href="#omni.ui.scene.Arc.begin" title="Permalink to this definition">
<dd>
<p>
Y to Z, Z to X, X to Y
<dl class="field-list simple">
<dt class="field-odd">
Type
<dd class="field-odd">
<p>
The start angle of the arc. Angle placement and directions are (0 to 90)
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.Arc.color">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
color
<a class="headerlink" href="#omni.ui.scene.Arc.color" title="Permalink to this definition">
<dd>
<p>
The color of the line.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.Arc.culling">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
culling
<a class="headerlink" href="#omni.ui.scene.Arc.culling" title="Permalink to this definition">
<dd>
<p>
Draw two radii of the circle.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.Arc.end">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
end
<a class="headerlink" href="#omni.ui.scene.Arc.end" title="Permalink to this definition">
<dd>
<p>
Y to Z, Z to X, X to Y
<dl class="field-list simple">
<dt class="field-odd">
Type
<dd class="field-odd">
<p>
The end angle of the arc. Angle placement and directions are (0 to 90)
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.Arc.gesture_payload">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
gesture_payload
<a class="headerlink" href="#omni.ui.scene.Arc.gesture_payload" title="Permalink to this definition">
<dd>
<p>
Contains all the information about the intersection.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.Arc.intersection_thickness">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
intersection_thickness
<a class="headerlink" href="#omni.ui.scene.Arc.intersection_thickness" title="Permalink to this definition">
<dd>
<p>
The thickness of the line for the intersection.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.Arc.sector">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
sector
<a class="headerlink" href="#omni.ui.scene.Arc.sector" title="Permalink to this definition">
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.Arc.radius">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
radius
<dd>
<p>
The radius of the circle.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.Arc.startAngle">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
startAngle
<dd>
<p>
The starting angle of the arc.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.Arc.endAngle">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
endAngle
<dd>
<p>
The ending angle of the arc.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.Arc.tesselation">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
tesselation
<dd>
<p>
Number of points on the curve.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.Arc.thickness">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
thickness
<dd>
<p>
The thickness of the line.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.Arc.wireframe">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
wireframe
<dd>
<p>
When true, it’s a line. When false it’s a mesh.
| 9,182 |
omni.ui.scene.ArcGesturePayload.md | # ArcGesturePayload
## ArcGesturePayload
```python
class omni.ui.scene.ArcGesturePayload
```
Bases: `GesturePayload`
### Methods
```python
__init__(*args, **kwargs)
```
### Attributes
```python
angle
culled
distance_to_center
moved
moved_angle
moved_distance_to_center
```
```python
__init__(*args, **kwargs)
```
kwargs | 323 |
omni.ui.scene.AspectRatioPolicy.md | # AspectRatioPolicy
## Overview
AspectRatioPolicy is a class in the omni.ui.scene module. It is based on `pybind11_object`.
### Members
- STRETCH
- PRESERVE_ASPECT_FIT
- PRESERVE_ASPECT_CROP
- PRESERVE_ASPECT_VERTICAL
- PRESERVE_ASPECT_HORIZONTAL
### Methods
- `__init__(self, value)`
### Attributes
- `PRESERVE_ASPECT_CROP`
- `PRESERVE_ASPECT_FIT`
- `PRESERVE_ASPECT_HORIZONTAL`
- `PRESERVE_ASPECT_VERTICAL`
- `STRETCH`
- `name`
| value |
|-------|
__init__(self: omni.ui_scene._scene.AspectRatioPolicy, value: int) → None
property name | 543 |
omni.ui.scene.CameraModel.md | # CameraModel
## Overview
CameraModel is a class that holds projection and view matrices. It is derived from `AbstractManipulatorModel`.
### Methods
- **`__init__(self, arg0, arg1)`**
- Initialize the camera with the given projection/view matrices.
### Attributes
- **`projection`**
- The camera projection matrix.
- **`view`**
- The camera projection matrix.
## Detailed Description
The `__init__` method initializes the CameraModel with the necessary matrices.
<details>
<summary>CameraModel Class
<dl>
<dt>
<em>
<span class="pre">: object
<span class="sig-paren">)
<span class="sig-return">
<span class="sig-return-icon">→
<span class="sig-return-typehint"><span class="pre">None
<dd>
<p>Initialize the camera with the given projection/view matrices.
<blockquote>
<div>
<dl class="simple">
<dt>
`kwargs
<span class="classifier">dict`
<dd>
<p>See below
<p>### Keyword Arguments:
<blockquote>
<div>
<dl class="simple">
<dt>
`projection
<span class="classifier">`
<dd>
<p>The camera projection matrix.
<dt>
`view
<span class="classifier">`
<dd>
<p>The camera view matrix.
<dl>
<dt>
<em>
<span class="pre">property
<span class="w">
<span class="sig-name descname"><span class="pre">projection
<dd>
<p>The camera projection matrix.
<dl>
<dt>
<em>
<span class="pre">property
<span class="w">
<span class="sig-name descname"><span class="pre">view
<dd>
<p>The camera projection matrix.
| 1,844 |
omni.ui.scene.Classes.md | # omni.ui.scene Classes
## Classes Summary:
- **AbstractContainer**
- Base class for all the items that have children.
- **AbstractGesture**
- The base class for the gestures to provides a way to capture mouse events in 3d scene.
- **AbstractItem**
- **AbstractManipulatorItem**
- **AbstractManipulatorModel**
- Bridge to data.
- **AbstractShape**
- Base class for all the items that can be drawn and intersected with mouse pointer.
- **Arc**
- **ArcGesturePayload**
- **AspectRatioPolicy**
- Members:
- **CameraModel**
- A model that holds projection and view matrices
- **ClickGesture**
- The gesture that provides a way to capture click mouse event.
- **Color4**
- **Culling**
Members:
- Curve: Represents the curve.
- CurveGesturePayload
- DoubleClickGesture: The gesture that provides a way to capture double clicks.
- DragGesture: The gesture that provides a way to capture click-and-drag mouse event.
- GestureManager: The object that controls batch processing and preventing of gestures. Typically each scene has a default manager and if the user wants to have own prevention logic, he can reimplement it.
- GestureState: Members:
- HoverGesture: The gesture that provides a way to capture event when mouse enters/leaves the item.
- Image
- Label: Defines a standard label for user interface items
- Line
- LineGesturePayload
- Manipulator: The base object for the custom manipulators.
- ManipulatorGesture: The base class for the gestures to provides a way to capture events of the manipulator objects.
- Matrix44: Stores a 4x4 matrix of float elements. A basic type.
- MouseInput
- Points: Represents the point cloud.
- PointsGesturePayload
- PolygonMesh: Encodes a mesh.
- PolygonMeshGesturePayload
- Rectangle
- RectangleGesturePayload
- Scene: Top level module string
- SceneView: The widget to render omni.ui.scene.
- Screen
## Table of Contents
| Class Name | Description |
|---------------------------|-----------------------------------------------------------------------------|
| Screen | The empty shape that triggers all the gestures at any place. Is used to track gestures when the user clicked the empty space. For example for cameras. |
| ScreenGesturePayload | |
| ScrollGesture | The gesture that provides a way to capture mouse scroll event. |
| ShapeGesture | The base class for the gestures to provides a way to capture mouse events in 3d scene. |
| Space | Members: |
| TexturedMesh | Encodes a polygonal mesh with free-form textures. |
| TexturedMeshGesturePayload| |
| Transform | Transforms children with component affine transformations. |
| TransformBasis | |
| Vector2 | |
| Vector3 | |
| Vector4 | |
| Widget | The shape that contains the omni.ui widgets. It automatically creates IAppWindow and transfers its content to the texture of the rectangle. It interacts with the mouse and sends the mouse events to the underlying window, so interacting with the UI on this rectangle is smooth for the user. | | 3,797 |
omni.ui.scene.ClickGesture.md | # ClickGesture
## ClickGesture
- **Bases:** [ShapeGesture](omni.ui.scene.ShapeGesture.html#omni.ui.scene.ShapeGesture)
- **Description:** The gesture that provides a way to capture click mouse event.
### Methods
- **__init__(self, _on_ended=None, **kwargs)**
- Constructs an gesture to track when the user clicked the mouse.
- **call_on_ended_fn(self, arg0)**
- Called when the user releases the button.
- **has_on_ended_fn(self)**
- Called when the user releases the button.
- **set_on_ended_fn(self, fn=None)**
- Called when the user releases the button.
### Attributes
- **modifiers**
- The modifier that should be pressed to trigger this gesture.
- **mouse_button**
- The mouse button that should be pressed to trigger this gesture.
| 名称 | 描述 |
|---------------|--------------------------------|
| `mouse_button` | The mouse button this gesture is watching. |
### Arguments:
#### `onEnded :`
Function that is called when the user clicked the mouse button.
#### `kwargs`
See below
### Keyword Arguments:
#### `mouse_button`
The mouse button this gesture is watching.
#### `modifiers`
The modifier that should be pressed to trigger this gesture.
#### `on_ended_fn`
Called when the user releases the button.
#### `name`
The name of the object. It’s used for debugging.
#### `manager`
The Manager that controls this gesture.
### `__init__`
```python
def __init__(self: omni.ui_scene._scene.ClickGesture, _on_ended: Callable[[omni::ui::scene::AbstractShape], None] = None, **kwargs) -> None:
```
Constructs an gesture to track when the user clicked the mouse.
### `call_on_ended_fn`
```python
def call_on_ended_fn(self: omni.ui_scene._scene.ClickGesture, arg0: omni::ui::scene::AbstractShape) -> None:
```
Called when the user releases the button.
### `has_on_ended_fn`
```python
def has_on_ended_fn(self: omni.ui_scene._scene.ClickGesture) -> bool:
```
Called when the user releases the button.
### `set_on_ended_fn`
```python
def set_on_ended_fn(self: omni.ui_scene._scene.ClickGesture, fn: Callable[[omni::ui::scene::AbstractShape], None]) -> None:
```
Called when the user releases the button.
### `modifiers`
property modifiers
```
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.ClickGesture.modifier">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
modifier
<a class="headerlink" href="#omni.ui.scene.ClickGesture.modifier" title="Permalink to this definition">
<dd>
<p>
The modifier that should be pressed to trigger this gesture.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.ClickGesture.mouse_button">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
mouse_button
<a class="headerlink" href="#omni.ui.scene.ClickGesture.mouse_button" title="Permalink to this definition">
<dd>
<p>
The mouse button this gesture is watching.
| 3,119 |
omni.ui.scene.Color4.md | # Color4
## Color4
```
class omni.ui.scene.Color4
```
### Methods
```
__init__(*args, **kwargs)
```
### Attributes
```
a
b
g
r
```
```
__init__(self: omni.ui.scene.Color4, *args, **kwargs)
```
Overloaded function.
1. __init__(self: omni.ui.scene.Color4, c: omni.ui_scene._scene.Vector4) -> None
2. __init__(self: omni.ui.scene.Color4, r: float = 0.0) -> None
```
# 文档标题
## 子标题
这里是一些文本内容。
### 更小的标题
这里是更多的文本内容。
- 列表项1
- 子列表项1
- 子列表项2
- 列表项2
这里是代码块:
```python
__init__(self: omni.ui_scene._scene.Color4, r: float, g: float, b: float, a: float) -> None
```
这里是页脚。 | 581 |
omni.ui.scene.Culling.md | # Culling
## Class Definition
```python
class omni.ui.scene.Culling(pybind11_object)
```
### Members
- NONE
- BACK
- FRONT
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self, value)` | |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `BACK` | |
| `FRONT` | |
| `NONE` | |
| `name` | |
| `value` | |
## Method Details
```python
__init__(self: omni.ui_scene._scene.Culling, value)
<span class="n">
<span class="pre">
value
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
int
<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 property">
<dt class="sig sig-object py" id="omni.ui.scene.Culling.name">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
name
<dd>
| 1,048 |
omni.ui.scene.Curve.md | # Curve
## Curve
### Class: `omni.ui.scene.Curve`
**Bases:** [AbstractShape](omni.ui.scene.AbstractShape.html#omni.ui.scene.AbstractShape)
Represents the curve.
#### Methods
| Method | Description |
|--------|-------------|
| `__init__(self, arg0, **kwargs)` | Constructs Curve. |
| `get_gesture_payload(*args, **kwargs)` | Overloaded function. |
#### Attributes
| Attribute | Description |
|-----------|-------------|
| `colors` | The list of colors which defines color per vertex. |
| `curve_type` | The curve interpolation type. |
| `gesture_payload` | Contains all the information about the intersection. |
| `intersection_thicknesses` | The thickness of the line for the intersection. |
<table>
<tbody>
<tr class="row-odd">
<td>
<p>
<code>positions
<td>
<p>
The list of positions which defines the curve.
<tr class="row-even">
<td>
<p>
<code>tesselation
<td>
<p>
The number of points per curve segment.
<tr class="row-odd">
<td>
<p>
<code>tessellation
<td>
<p>
The number of points per curve segment.
<tr class="row-even">
<td>
<p>
<code>thicknesses
<td>
<p>
The list of thicknesses which defines thickness per vertex.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.scene.Curve.__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.ui_scene._scene.Curve
,
<em class="sig-param">
<span class="n">
<span class="pre">
arg0
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
object
,
<em class="sig-param">
<span class="o">
<span class="pre">
**
<span class="n">
<span class="pre">
kwargs
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<dd>
<p>
Constructs Curve.
<p>
### Arguments:
<blockquote>
<div>
<dl class="simple">
<dt>
`positions :`
<dd>
<p>
List of positions
<dt>
`kwargs
<span class="classifier">
dict`
<dd>
<p>
See below
<p>
### Keyword Arguments:
<blockquote>
<div>
<dl class="simple">
<dt>
`positions
<span class="classifier">
`
<dd>
<p>
The list of positions which defines the curve. It has at least two positions. The curve has len(positions)-1
<dt>
`colors
<span class="classifier">
`
<dd>
<p>
The list of colors which defines color per vertex. It has the same length as positions.
<dt>
`thicknesses
<span class="classifier">
`
<dd>
<p>
The list of thicknesses which defines thickness per vertex. It has the same length as positions.
<dt>
`intersection_thickness
<span class="classifier">
`
<dd>
<p>
The thickness of the line for the intersection.
<dt>
`curve_type
<span class="classifier">
`
<dd>
<p>
The curve interpolation type.
<dt>
`tessellation
<span class="classifier">
`
<dd>
<p>
The number of points per curve segment. It can’t be less than 2.
<dt>
`gesture
<span class="classifier">
`
<dd>
<p>
All the gestures assigned to this shape.
<dt>
`gestures
<span class="classifier">
`
<dd>
<p>
All the gestures assigned to this shape.
<dt>
`visible
<span class="classifier">
`
<dd>
<p>
This property holds whether the item is visible.
<dl class="py class">
<dt class="sig sig-object py" id="omni.ui.scene.Curve.CurveType">
<em class="property">
<span class="pre">
class
<span class="w">
<span class="sig-name descname">
<span class="pre">
CurveType
<dd>
<p>
Bases:
<code>
pybind11_object
<p>
Members:
<blockquote>
<div>
<p>
LINEAR
<p>
CUBIC
## Properties
### name
- **Description:** The name property.
### get_gesture_payload(*args, **kwargs)
- **Description:** Overloaded function.
- get_gesture_payload(self: omni.ui_scene._scene.Curve) -> omni.ui_scene._scene.CurveGesturePayload
- Contains all the information about the intersection.
- get_gesture_payload(self: omni.ui_scene._scene.Curve, arg0: omni.ui_scene._scene.GestureState) -> omni.ui_scene._scene.CurveGesturePayload
- Contains all the information about the intersection at the specific state.
### colors
- **Description:** The list of colors which defines color per vertex. It has the same length as positions.
### curve_type
- **Description:** The curve interpolation type.
### gesture_payload
- **Description:** Contains all the information about the intersection.
### intersection_thicknesses
- **Description:** The thickness of the line for the intersection.
### positions
- **Description:** The list of positions which defines the curve. It has at least two positions. The curve has len(positions)-1 segments.
### tesselation
- **Description:** The number of points per curve segment. It can’t be less than 2.
### tessellation
- **Description:** The number of points per curve segment. It can’t be less than 2.
### thicknesses
- **Description:** The list of thicknesses which defines thickness per vertex. It has the same length as positions. | 7,551 |
omni.ui.scene.CurveGesturePayload.md | # CurveGesturePayload
## CurveGesturePayload
```
class omni.ui.scene.CurveGesturePayload
```
Bases: `GesturePayload`
### Methods
| Method | Description |
|--------|-------------|
| `__init__(*args, **kwargs)` | |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `curve_distance` | |
| `moved` | |
| `moved_distance` | |
```
def __init__(*args, **kwargs)
```
``` | 396 |
omni.ui.scene.DoubleClickGesture.md | # DoubleClickGesture
## DoubleClickGesture
```
The gesture that provides a way to capture double clicks.
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self, _on_ended=None, **kwargs)` | Construct the gesture to track double clicks. |
| `call_on_ended_fn(self, arg0)` | Called when the user releases the button. |
| `has_on_ended_fn(self)` | Called when the user releases the button. |
| `set_on_ended_fn(self, fn=None)` | Called when the user releases the button. |
### Attributes
| Attribute | Description |
|-----------|-------------|
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.scene.DoubleClickGesture.__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.ui_scene._scene.DoubleClickGesture
,
<em class="sig-param">
<span class="n">
<span class="pre">
onEnded
<span class="pre">
:
<span class="pre">
Callable[[omni::ui::scene::AbstractShape],
<span class="pre">
None]
,
<em class="sig-param">
<span class="n">
<span class="pre">
=
<span class="pre">
None,
<span class="pre">
**kwargs
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<dd>
<p>
Construct the gesture to track double clicks.
<p>
### Arguments:
<blockquote>
<div>
<dl class="simple">
<dt>
`onEnded :`
<dd>
<p>
Called when the user double clicked
<dt>
`kwargs
<span class="classifier">
dict`
<dd>
<p>
See below
<p>
### Keyword Arguments:
<blockquote>
<div>
<dl class="simple">
<dt>
`mouse_button
<span class="classifier">
`
<dd>
<p>
The mouse button this gesture is watching.
<dt>
`modifiers
<span class="classifier">
`
<dd>
<p>
The modifier that should be pressed to trigger this gesture.
<dt>
`on_ended_fn
<span class="classifier">
`
<dd>
<p>
Called when the user releases the button.
<dt>
`name
<span class="classifier">
`
<dd>
<p>
The name of the object. It’s used for debugging.
<dt>
`manager
<span class="classifier">
`
<dd>
<p>
The Manager that controld this gesture.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.scene.DoubleClickGesture.call_on_ended_fn">
<span class="sig-name descname">
<span class="pre">
call_on_ended_fn
<span class="sig-paren">
(
<em class="sig-param">
<span class="n">
<span class="pre">
self:
<span class="pre">
omni.ui_scene._scene.DoubleClickGesture
,
<em class="sig-param">
<span class="n">
<span class="pre">
arg0:
<span class="pre">
omni::ui::scene::AbstractShape
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<dd>
<p>
Called when the user releases the button.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.scene.DoubleClickGesture.has_on_ended_fn">
<span class="sig-name descname">
<span class="pre">
has_on_ended_fn
<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.ui_scene._scene.DoubleClickGesture
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
bool
<dd>
<p>
Called when the user releases the button.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.scene.DoubleClickGesture.set_on_ended_fn">
<span class="sig-name descname">
<span class="pre">
set_on_ended_fn
<span class="sig-paren">
(
<em class="sig-param">
<span class="pre">
self:
<span class="pre">
omni.ui_scene._scene.ClickGesture,
<span class="pre">
fn:
<span class="pre">
Callable[[omni::ui::scene::AbstractShape],
<span class="pre">
None]
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<dd>
<p>
Called when the user releases the button.
| 6,454 |
omni.ui.scene.DragGesture.md | # DragGesture
## Class: omni.ui.scene.DragGesture
Bases: [ShapeGesture](omni.ui.scene.ShapeGesture.html#omni.ui.scene.ShapeGesture)
The gesture that provides a way to capture click-and-drag mouse event.
### Methods
- **__init__(self, **kwargs)**
- Construct the gesture to track mouse drags.
- **call_on_began_fn(self, arg0)**
- Called when the user starts drag.
- **call_on_changed_fn(self, arg0)**
- Called when the user is dragging.
- **call_on_ended_fn(self, arg0)**
- Called when the user releases the mouse and finishes the drag.
- **has_on_began_fn(self)**
- Called when the user starts drag.
- **has_on_changed_fn(self)**
- Called when the user is dragging.
| Method | Description |
|--------|-------------|
| `has_on_ended_fn(self)` | Called when the user releases the mouse and finishes the drag. |
| `set_on_began_fn(self, fn, None])` | Called when the user starts drag. |
| `set_on_changed_fn(self, fn, None])` | Called when the user is dragging. |
| `set_on_ended_fn(self, fn, None])` | Called when the user releases the mouse and finishes the drag. |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `check_mouse_moved` | The check_mouse_moved property is a boolean flag that determines whether the DragGesture should verify if the 2D screen position of the mouse has changed before invoking the on_changed method. |
| `modifiers` | The keyboard modifier that should be active to start the gesture. |
| `mouse_button` | Mouse button that should be active to start the gesture. |
### `__init__(self, **kwargs)`
Construct the gesture to track mouse drags.
#### Keyword Arguments:
- `mouse_button`: Mouse button that should be active to start the gesture.
- `modifiers`: The keyboard modifier that should be active to start the gesture.
- `check_mouse_moved`: The check_mouse_moved property is a boolean flag that determines whether the DragGesture should verify if the 2D screen position of the mouse has changed before invoking the on_changed method. This property is essential in a 3D environment, as changes in the camera position can result in the mouse pointing to different locations in the 3D world even when the 2D screen position remains unchanged.
Usage:
When `check_mouse_moved` is set to True, the DragGesture will only call the `on_changed` method if the actual 2D screen position of the mouse has changed. This can be useful when you want to ensure that the `on_changed` method is only triggered when there is a genuine change in the mouse’s 2D screen position.
If `check_mouse_moved` is set to False, the DragGesture will not check for changes in the mouse’s 2D screen position before calling the `on_changed` method. This can be useful when you want the `on_changed` method to be invoked even if the mouse’s 2D screen position hasn’t changed, such as when the camera position is altered, and the mouse now points to a different location in the 3D world.
<span class="classifier">
`
<dd>
<p>
Called if the callback is not set when the user clicks the mouse button.
<dt>
`on_changed_fn
<span class="classifier">
`
<dd>
<p>
Called if the callback is not set when the user moves the clicked button.
<dt>
`on_ended_fn
<span class="classifier">
`
<dd>
<p>
Called if the callback is not set when the user releases the mouse button.
<dt>
`name
<span class="classifier">
`
<dd>
<p>
The name of the object. It’s used for debugging.
<dt>
`manager
<span class="classifier">
`
<dd>
<p>
The Manager that controls this gesture.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.scene.DragGesture.call_on_began_fn">
<span class="sig-name descname">
<span class="pre">
call_on_began_fn
<span class="sig-paren">
(
<em class="sig-param">
<span class="n">
<span class="pre">
self:
<span class="pre">
omni.ui_scene._scene.DragGesture
,
<em class="sig-param">
<span class="n">
<span class="pre">
arg0:
<span class="pre">
omni::ui::scene::AbstractShape
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<a class="headerlink" href="#omni.ui.scene.DragGesture.call_on_began_fn" title="Permalink to this definition">
<dd>
<p>
Called when the user starts drag.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.scene.DragGesture.call_on_changed_fn">
<span class="sig-name descname">
<span class="pre">
call_on_changed_fn
<span class="sig-paren">
(
<em class="sig-param">
<span class="n">
<span class="pre">
self:
<span class="pre">
omni.ui_scene._scene.DragGesture
,
<em class="sig-param">
<span class="n">
<span class="pre">
arg0:
<span class="pre">
omni::ui::scene::AbstractShape
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<a class="headerlink" href="#omni.ui.scene.DragGesture.call_on_changed_fn" title="Permalink to this definition">
<dd>
<p>
Called when the user is dragging.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.scene.DragGesture.call_on_ended_fn">
<span class="sig-name descname">
<span class="pre">
call_on_ended_fn
<span class="sig-paren">
(
<em class="sig-param">
<span class="n">
<span class="pre">
self:
<span class="pre">
omni.ui_scene._scene.DragGesture
,
<em class="sig-param">
<span class="n">
<span class="pre">
arg0:
<span class="pre">
omni::ui::scene::AbstractShape
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<a class="headerlink" href="#omni.ui.scene.DragGesture.call_on_ended_fn" title="Permalink to this definition">
<dd>
<p>
Called when the user releases the mouse and finishes the drag.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.scene.DragGesture.has_on_began_fn">
<span class="sig-name descname">
<span class="pre">
has_on_began_fn
<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">
<a class="reference internal" href="#omni.ui.scene.DragGesture" title="omni.ui_scene._scene.DragGesture">
<span class="pre">
omni.ui_scene._scene.DragGesture
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
bool
<a class="headerlink" href="#omni.ui.scene.DragGesture.has_on_began_fn" title="Permalink to this definition">
<dd>
<p>
Called when the user starts drag.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.scene.DragGesture.has_on_changed_fn">
<span class="sig-name descname">
<span class="pre">
has_on_changed_fn
<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">
<a class="reference internal" href="#omni.ui.scene.DragGesture" title="omni.ui_scene._scene.DragGesture">
<span class="pre">
omni.ui_scene._scene.DragGesture
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
bool
<a class="headerlink" href="#omni.ui.scene.DragGesture.has_on_changed_fn" title="Permalink to this definition">
<dd>
<p>
Called when the user is dragging.
### has_on_ended_fn
- **Description**: Called when the user releases the mouse and finishes the drag.
### set_on_began_fn
- **Description**: Called when the user starts drag.
### set_on_changed_fn
- **Description**: Called when the user is dragging.
### set_on_ended_fn
- **Description**: Called when the user releases the mouse and finishes the drag.
### check_mouse_moved
- **Description**: The check_mouse_moved property is a boolean flag that determines whether the DragGesture should verify if the 2D screen position of the mouse has changed before invoking the on_changed method. This property is essential in a 3D environment, as changes in the camera position can result in the mouse pointing to different locations in the 3D world even when the 2D screen position remains unchanged.
- **Usage**:
- When check_mouse_moved is set to True, the DragGesture will only call the on_changed method if the actual 2D screen position of the mouse has changed.
- If check_mouse_moved is set to False, the DragGesture will not check for changes in the mouse’s 2D screen position before calling the on_changed method.
### modifiers
- **Description**: The keyboard modifier that should be active to start the gesture.
### mouse_button
- **Description**: Mouse button that should be active to start the gesture.
SphinxRtdTheme.Navigation.enable(true);
});
| 8,819 |
omni.ui.scene.Functions.md | # omni.ui.scene Functions
## Functions Summary:
| Function | Description |
|----------|-------------|
| Cross | Cross(arg0: handle, arg1: handle) -> object |
| Dot | Dot(arg0: handle, arg1: handle) -> float | | 218 |
omni.ui.scene.GestureManager.md | # GestureManager
## GestureManager
```
The object that controls batch processing and preventing of gestures. Typically each scene has a default manager and if the user wants to have own prevention logic, he can reimplement it.
### Methods
| Method | Description |
| --- | --- |
| `__init__(self, **kwargs)` | Constructor. |
| `amend_input(self, arg0)` | Called once a frame. |
| `can_be_prevented(self, arg0)` | Called per gesture. |
| `should_prevent(self, arg0, arg1)` | Called per gesture. |
```
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.scene.GestureManager.__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">
<a class="reference internal" href="#omni.ui.scene.GestureManager" title="omni.ui_scene._scene.GestureManager">
<span class="pre">
omni.ui_scene._scene.GestureManager
,
<em class="sig-param">
<span class="n">
<span class="pre">
kwargs
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
dict
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<dd>
<p>
Constructor.
<blockquote>
<div>
<dl class="simple">
<dt>
`kwargs
<span class="classifier">
dict`
<dd>
<p>
See below
<p>
### Keyword Arguments:
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.scene.GestureManager.amend_input">
<span class="sig-name descname">
<span class="pre">
amend_input
<span class="sig-paren">
(
<em class="sig-param">
<span class="n">
<span class="pre">
self:
<span class="pre">
omni.ui_scene._scene.GestureManager
,
<em class="sig-param">
<span class="n">
<span class="pre">
arg0:
<span class="pre">
omni::ui::scene::MouseInput
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
omni::ui::scene::MouseInput
<dd>
<p>
Called once a frame. Should be overriden to inject own input to the gestures.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.scene.GestureManager.can_be_prevented">
<span class="sig-name descname">
<span class="pre">
can_be_prevented
<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">
omni.ui_scene._scene.GestureManager
,
<em class="sig-param">
<span class="n">
<span class="pre">
arg0
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
omni.ui_scene._scene.AbstractGesture
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
bool
<dd>
<p>
Called per gesture. Determines if the gesture can be prevented.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.scene.GestureManager.should_prevent">
<span class="sig-name descname">
<span class="pre">
should_prevent
<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">
omni.ui_scene._scene.GestureManager
,
<em class="sig-param">
<span class="n">
<span class="pre">
arg0
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
omni.ui_scene._scene.AbstractGesture
,
<em class="sig-param">
<span class="n">
<span class="pre">
arg1
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
omni.ui_scene._scene.AbstractGesture
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
bool
<dd>
<p>
Called per gesture. Determines if the gesture should be prevented with another gesture. Useful to resolve intersections.
| 5,640 |
omni.ui.scene.GestureState.md | # GestureState
## Class Definition
```python
class omni.ui.scene.GestureState(pybind11_object)
```
### Members
- NONE
- POSSIBLE
- BEGAN
- CHANGED
- ENDED
- CANCELED
- PREVENTED
### Methods
- `__init__(self, value)`
### Attributes
- `BEGAN`
- `CANCELED`
- `CHANGED`
- `ENDED`
- `NONE`
- `POSSIBLE`
- `PREVENTED`
```
| name | value |
| ---- | ----- |
| name | |
| value| |
```python
def __init__(self: omni.ui_scene._scene.GestureState, value: int) -> None:
pass
```
```python
@property
def name(self) -> str:
pass
``` | 543 |
omni.ui.scene.HoverGesture.md | # HoverGesture
## Class
```python
class omni.ui.scene.HoverGesture
```
Bases: `ShapeGesture`
The gesture that provides a way to capture event when mouse enters/leaves the item.
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self, **kwargs)` | Constructs an gesture to track when the user clicked the mouse. |
| `call_on_began_fn(self, arg0)` | Called when the mouse enters the item. |
| `call_on_changed_fn(self, arg0)` | Called when the mouse is hovering the item. |
| `call_on_ended_fn(self, arg0)` | Called when the mouse leaves the item. |
| `has_on_began_fn(self)` | Called when the mouse enters the item. |
| `has_on_changed_fn(self)` | Called when the mouse is hovering the item. |
| Method Name | Description |
|-------------|-------------|
| `has_on_ended_fn(self)` | Called when the mouse leaves the item. |
| `set_on_began_fn(self, fn, None])` | Called when the mouse enters the item. |
| `set_on_changed_fn(self, fn, None])` | Called when the mouse is hovering the item. |
| `set_on_ended_fn(self, fn, None])` | Called when the mouse leaves the item. |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `modifiers` | The modifier that should be pressed to trigger this gesture. |
| `mouse_button` | The mouse button this gesture is watching. |
### omni.ui.scene.HoverGesture.__init__(self, **kwargs)
Constructs an gesture to track when the user clicked the mouse.
#### Arguments:
- `onEnded :` Function that is called when the user clicked the mouse button.
- `kwargs : dict` See below
#### Keyword Arguments:
- `mouse_button` The mouse button this gesture is watching.
- `modifiers` The modifier that should be pressed to trigger this gesture.
- `on_began_fn` Called if the callback is not set and the mouse enters the item.
- `on_changed_fn` Called if the callback is not set and the mouse is hovering the item.
- `on_ended_fn` Called if the callback is not set and the mouse leaves the item.
- `name` The name of the object. It’s used for debugging.
- `manager` The Manager that controls this gesture.
### omni.ui.scene.HoverGesture.call_on_began_fn(self)
### call_on_began_fn
```python
def call_on_began_fn(self: omni.ui_scene._scene.HoverGesture, arg0: omni::ui::scene::AbstractShape) -> None:
```
Called when the mouse enters the item.
### call_on_changed_fn
```python
def call_on_changed_fn(self: omni.ui_scene._scene.HoverGesture, arg0: omni::ui::scene::AbstractShape) -> None:
```
Called when the mouse is hovering the item.
### call_on_ended_fn
```python
def call_on_ended_fn(self: omni.ui_scene._scene.HoverGesture, arg0: omni::ui::scene::AbstractShape) -> None:
```
Called when the mouse leaves the item.
### has_on_began_fn
```python
def has_on_began_fn(self: omni.ui_scene._scene.HoverGesture) -> bool:
```
Called when the mouse enters the item.
### has_on_changed_fn
```python
def has_on_changed_fn(self: omni.ui_scene._scene.HoverGesture) -> bool:
```
Called when the mouse is hovering the item.
### has_on_ended_fn
```python
def has_on_ended_fn(self: omni.ui_scene._scene.HoverGesture) -> bool:
```
Called when the mouse leaves the item.
### set_on_began_fn
```python
def set_on_began_fn(self: omni.ui_scene._scene.HoverGesture, arg0: omni::ui::scene::AbstractShape) -> None:
```
<em class="sig-param">
<span class="pre">
self:
<span class="pre">
omni.ui_scene._scene.HoverGesture,
<span class="pre">
fn:
<span class="pre">
Callable[[omni::ui::scene::AbstractShape],
<span class="pre">
None]
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<dd>
<p>
Called when the mouse enters the item.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.scene.HoverGesture.set_on_changed_fn">
<span class="sig-name descname">
<span class="pre">
set_on_changed_fn
<span class="sig-paren">
(
<em class="sig-param">
<span class="pre">
self:
<span class="pre">
omni.ui_scene._scene.HoverGesture,
<span class="pre">
fn:
<span class="pre">
Callable[[omni::ui::scene::AbstractShape],
<span class="pre">
None]
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<dd>
<p>
Called when the mouse is hovering the item.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.scene.HoverGesture.set_on_ended_fn">
<span class="sig-name descname">
<span class="pre">
set_on_ended_fn
<span class="sig-paren">
(
<em class="sig-param">
<span class="pre">
self:
<span class="pre">
omni.ui_scene._scene.HoverGesture,
<span class="pre">
fn:
<span class="pre">
Callable[[omni::ui::scene::AbstractShape],
<span class="pre">
None]
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<dd>
<p>
Called when the mouse leaves the item.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.HoverGesture.modifiers">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
modifiers
<dd>
<p>
The modifier that should be pressed to trigger this gesture.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.HoverGesture.mouse_button">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
mouse_button
<dd>
<p>
The mouse button this gesture is watching.
<footer>
<hr/>
| 5,567 |
omni.ui.scene.Image.md | # Image
## Image Class
```python
class omni.ui.scene.Image
```
Bases: `omni.ui.scene.Rectangle`
### Methods
```python
__init__(*args, **kwargs)
```
Overloaded function.
### Attributes
```python
fill_policy
```
Define what happens when the source image has a different size than the item.
```python
image_height
```
The resolution of rasterization of svg and for ImageProvider.
```python
image_provider
```
" path, a direct path or the path relative to the application root directory.
```python
image_width
```
The resolution for rasterization of svg and for ImageProvider.
```python
source_url
```
" path, a direct path or the path relative to the application root directory.
```
Overloaded function.
1. __init__(self: omni.ui_scene._scene.Image, source_url: str, width: float = 1.0, height: float = 1.0, **kwargs) -> None
Created an image with the given URL.
### Keyword Arguments:
- `source_url`: This property holds the image URL. It can be an “omni:” path, a “file:” path, a direct path or the path relative to the application root directory.
- `image_provider`: This property holds the image provider. It can be an “omni:” path, a “file:” path, a direct path or the path relative to the application root directory.
- `fill_policy`: Define what happens when the source image has a different size than the item.
- `image_width`: The resolution for rasterization of svg and for ImageProvider.
- `image_height`: The resolution of rasterization of svg and for ImageProvider.
- `width`: The size of the rectangle.
- `height`: The size of the rectangle.
- `thickness`: The thickness of the line.
- `intersection_thickness`: The thickness of the line for the intersection.
- `color`: The color of the line.
- `axis`: The axis the rectangle is perpendicular to.
- `wireframe`: When true, it’s a line. When false it’s a mesh.
- `gesture`: All the gestures assigned to this shape.
- `gestures`: All the gestures assigned to this shape.
- `visible`: This property holds whether the item is visible.
2. __init__(self: omni.ui_scene._scene.Image, image_provider: ImageProvider, width: float = 1.0, height: float = 1.0, **kwargs) -> None
Created an image with the given provider.
### Keyword Arguments:
- `source_url`: This property holds the image URL. It can be an “omni:” path, a “file:” path, a direct path or the path relative to the application root directory.
- `image_provider`: This property holds the image provider. It can be an “omni:” path, a “file:” path, a direct path or the path relative to the application root directory.
- `fill_policy`: Define what happens when the source image has a different size than the item.
- `image_width`: The resolution for rasterization of svg and for ImageProvider.
- `image_height`: The resolution of rasterization of svg and for ImageProvider.
- `width`: The size of the rectangle.
- `height`: The size of the rectangle.
- `thickness`: The thickness of the line.
- `intersection_thickness`: The thickness of the line for the intersection.
- `color`: The color of the line.
- `axis`: The axis the rectangle is perpendicular to.
- `wireframe`: When true, it’s a line. When false it’s a mesh.
- `gesture`: All the gestures assigned to this shape.
- `gestures`: All the gestures assigned to this shape.
- `visible`: This property holds whether the item is visible.
<dl class="simple">
<dt>
`width
<span class="classifier">
`
<dd>
<p>
The size of the rectangle.
<dt>
`height
<span class="classifier">
`
<dd>
<p>
The size of the rectangle.
<dt>
`thickness
<span class="classifier">
`
<dd>
<p>
The thickness of the line.
<dt>
`intersection_thickness
<span class="classifier">
`
<dd>
<p>
The thickness of the line for the intersection.
<dt>
`color
<span class="classifier">
`
<dd>
<p>
The color of the line.
<dt>
`axis
<span class="classifier">
`
<dd>
<p>
The axis the rectangle is perpendicular to.
<dt>
`wireframe
<span class="classifier">
`
<dd>
<p>
When true, it’s a line. When false it’s a mesh.
<dt>
`gesture
<span class="classifier">
`
<dd>
<p>
All the gestures assigned to this shape.
<dt>
`gestures
<span class="classifier">
`
<dd>
<p>
All the gestures assigned to this shape.
<dt>
`visible
<span class="classifier">
`
<dd>
<p>
This property holds whether the item is visible.
<ol class="arabic simple" start="3">
<li>
<p>
__init__(self: omni.ui_scene._scene.Image, width: float = 1.0, height: float = 1.0, **kwargs) -> None
<p>
Created an empty image.
### Keyword Arguments:
<dl class="simple">
<dt>
`kwargs
<span class="classifier">
dict`
<dd>
<p>
See below
<dt>
`source_url
<span class="classifier">
`
<dd>
<p>
This property holds the image URL. It can be an “omni:” path, a “file:” path, a direct path or the path relative to the application root directory.
<dt>
`image_provider
<span class="classifier">
`
<dd>
<p>
This property holds the image provider. It can be an “omni:” path, a “file:” path, a direct path or the path relative to the application root directory.
<dt>
`fill_policy
<span class="classifier">
`
<dd>
<p>
Define what happens when the source image has a different size than the item.
<dt>
`image_width
<span class="classifier">
`
<dd>
<p>
The resolution for rasterization of svg and for ImageProvider.
<dt>
`image_height
<span class="classifier">
`
<dd>
<p>
The resolution of rasterization of svg and for ImageProvider.
<dt>
`width
<span class="classifier">
`
<dd>
<p>
The size of the rectangle.
<dt>
`height
<span class="classifier">
`
<dd>
<p>
The size of the rectangle.
<dt>
`thickness
<span class="classifier">
`
<dd>
<p>
The thickness of the line.
<dt>
`intersection_thickness
<span class="classifier">
`
<dd>
<p>
The thickness of the line for the intersection.
<dt>
`color
<span class="classifier">
`
<dd>
<p>
The color of the line.
<dt>
`axis
<span class="classifier">
`
<dd>
<p>
The axis the rectangle is perpendicular to.
<dt>
`wireframe
<span class="classifier">
`
<dd>
<p>
When true, it’s a line. When false it’s a mesh.
<dt>
`gesture
<span class="classifier">
`
<dd>
<p>
All the gestures assigned to this shape.
<dt>
`gestures
<span class="classifier">
`
<dd>
<p>
All the gestures assigned to this shape.
<dt>
`visible
<span class="classifier">
`
<dd>
<p>
This property holds whether the item is visible.
<p>
PRESERVE_ASPECT_CROP
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.Image.FillPolicy.name">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
name
<dd>
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.Image.fill_policy">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
fill_policy
<dd>
<p>
Define what happens when the source image has a different size than the item.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.Image.image_height">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
image_height
<dd>
<p>
The resolution of rasterization of svg and for ImageProvider.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.Image.image_provider">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
image_provider
<dd>
<p>
” path, a direct path or the path relative to the application root directory.
<dl class="field-list simple">
<dt class="field-odd">
Type
<dd class="field-odd">
<p>
This property holds the image provider. It can be an “omni
<dt class="field-even">
Type
<dd class="field-even">
<p>
” path, a “file
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.Image.image_width">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
image_width
<dd>
<p>
The resolution for rasterization of svg and for ImageProvider.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.Image.source_url">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
source_url
<dd>
<p>
” path, a direct path or the path relative to the application root directory.
<dl class="field-list simple">
<dt class="field-odd">
Type
<dd class="field-odd">
<p>
This property holds the image URL. It can be an “omni
<dt class="field-even">
Type
<dd class="field-even">
<p>
” path, a “file
| 9,697 |
omni.ui.scene.Label.md | # Label
## Class Definition
```python
class omni.ui.scene.Label(AbstractShape)
```
Defines a standard label for user interface items.
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self, arg0, **kwargs)` | A standard label for user interface items. |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `alignment` | This property holds the alignment of the label's contents. |
| `color` | The color of the text. |
| `size` | The font size. |
| `text` | This property holds the label's text. |
### `__init__` Method
```python
def __init__(self, arg0, **kwargs)
```
A standard label for user interface items.
```
### omni.ui.scene.Label.__init__(arg0: str, **kwargs) -> None
A standard label for user interface items.
#### Arguments:
- `text :`
- The string with the text to display
- `kwargs : dict`
- See below
#### Keyword Arguments:
- `color :`
- The color of the text.
- `size :`
- The font size.
- `alignment :`
- This property holds the alignment of the label’s contents. By default, the contents of the label are left-aligned and vertically-centered.
- `text :`
- This property holds the label’s text.
- `gesture :`
- All the gestures assigned to this shape.
- `gestures :`
- All the gestures assigned to this shape.
- `visible :`
- This property holds whether the item is visible.
### omni.ui.scene.Label.alignment
This property holds the alignment of the label’s contents. By default, the contents of the label are left-aligned and vertically-centered.
### omni.ui.scene.Label.color
The color of the text.
### omni.ui.scene.Label.size
The font size.
### omni.ui.scene.Label.text
This property holds the label’s text. | 1,703 |
omni.ui.scene.Line.md | # Line
## Methods
- `__init__(*args, **kwargs)`
- Overloaded function.
- `get_gesture_payload(*args, **kwargs)`
- Overloaded function.
## Attributes
- `color`
- The line color.
- `end`
- The end point of the line.
- `gesture_payload`
- Contains all the information about the intersection.
- `intersection_thickness`
- The thickness of the line for the intersection.
- `start`
- The start point of the line.
<code class="xref py py-obj docutils literal notranslate">
<span class="pre">
start
<td>
<p>
The start point of the line.
<tr class="row-even">
<td>
<p>
<a class="reference internal" href="#omni.ui.scene.Line.thickness" title="omni.ui.scene.Line.thickness">
<code class="xref py py-obj docutils literal notranslate">
<span class="pre">
thickness
<td>
<p>
The line thickness.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.scene.Line.__init__">
<span class="sig-name descname">
<span class="pre">
__init__
<span class="sig-paren">
(
<em class="sig-param">
<span class="o">
<span class="pre">
*
<span class="n">
<span class="pre">
args
,
<em class="sig-param">
<span class="o">
<span class="pre">
**
<span class="n">
<span class="pre">
kwargs
<span class="sig-paren">
)
<a class="headerlink" href="#omni.ui.scene.Line.__init__" title="Permalink to this definition">
<dd>
<p>
Overloaded function.
<ol class="arabic simple">
<li>
<p>
__init__(self: omni.ui_scene._scene.Line, **kwargs) -> None
<p>
A simple line.
<p>
### Arguments:
<blockquote>
<div>
<dl class="simple">
<dt>
`start :`
<dd>
<p>
The start point of the line
<dt>
`end :`
<dd>
<p>
The end point of the line
<dt>
`kwargs
<span class="classifier">
dict`
<dd>
<p>
See below
<p>
### Keyword Arguments:
<blockquote>
<div>
<dl class="simple">
<dt>
`start
<span class="classifier">
`
<dd>
<p>
The start point of the line.
<dt>
`end
<span class="classifier">
`
<dd>
<p>
The end point of the line.
<dt>
`color
<span class="classifier">
`
<dd>
<p>
The line color.
<dt>
`thickness
<span class="classifier">
`
<dd>
<p>
The line thickness.
<dt>
`intersection_thickness
<span class="classifier">
`
<dd>
<p>
The thickness of the line for the intersection.
<dt>
`gesture
<span class="classifier">
`
<dd>
<p>
All the gestures assigned to this shape.
<dt>
`gestures
<span class="classifier">
`
<dd>
<p>
All the gestures assigned to this shape.
<dt>
`visible
<span class="classifier">
`
<dd>
<p>
This property holds whether the item is visible.
<ol class="arabic simple" start="2">
<li>
<p>
__init__(self: omni.ui_scene._scene.Line, arg0: object, arg1: object, **kwargs) -> None
<p>
A simple line.
<p>
### Arguments:
<blockquote>
<div>
<dl class="simple">
<dt>
`start :`
<dd>
<p>
The start point of the line
<dt>
`end :`
<dd>
<p>
The end point of the line
<dt>
`kwargs
<span class="classifier">
dict`
<dd>
<p>
See below
<p>
### Keyword Arguments:
<blockquote>
<div>
<dl class="simple">
<dt>
`start
<span class="classifier">
`
<dd>
<p>
The start point of the line.
<dt>
`end
<span class="classifier">
`
<dd>
<p>
The end point of the line.
<dt>
`color
<span class="classifier">
`
<dd>
<p>
The line color.
<dt>
`thickness
<span class="classifier">
`
<dd>
<p>
The line thickness.
<dt>
`intersection_thickness
<span class="classifier">
`
<dd>
<p>
The thickness of the line for the intersection.
<dt>
`gesture
<span class="classifier">
`
<dd>
<p>
All the gestures assigned to this shape.
<dt>
`gestures
<span class="classifier">
`
<dd>
<p>
All the gestures assigned to this shape.
<dt>
`visible
<span class="classifier">
`
<dd>
<p>
This property holds whether the item is visible.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.scene.Line.get_gesture_payload">
## Functions
### get_gesture_payload
Overloaded function.
1. get_gesture_payload(self: omni.ui_scene._scene.Line) -> omni.ui_scene._scene.LineGesturePayload
Contains all the information about the intersection.
2. get_gesture_payload(self: omni.ui_scene._scene.Line, arg0: omni.ui_scene._scene.GestureState) -> omni.ui_scene._scene.LineGesturePayload
Contains all the information about the intersection at the specific state.
## Properties
### color
The line color.
### end
The end point of the line.
### gesture_payload
Contains all the information about the intersection.
### intersection_thickness
The thickness of the line for the intersection.
### start
The start point of the line.
### thickness
The line thickness. | 4,540 |
omni.ui.scene.LineGesturePayload.md | # LineGesturePayload
## LineGesturePayload
```python
class omni.ui.scene.LineGesturePayload
```
Bases: `GesturePayload`
### Methods
```python
__init__(*args, **kwargs)
```
### Attributes
```python
line_closest_point
line_distance
moved
```
```python
__init__(*args, **kwargs)
``` | 283 |
omni.ui.scene.Manipulator.md | # Manipulator
## Manipulator
The base object for the custom manipulators.
### Methods
- `__init__(self, **kwargs)`
- `call_on_build_fn(self, arg0)`
- Called when Manipulator is dirty to build the content.
- `has_on_build_fn(self)`
- Called when Manipulator is dirty to build the content.
- `invalidate(self)`
- Make Manipulator dirty so onBuild will be executed in _preDrawContent.
- `on_build(self)`
- Called when Manipulator is dirty to build the content.
- `on_model_updated(self, arg0)`
- Called by the model when the model value is changed.
| set_on_build_fn (self, fn) | Called when Manipulator is dirty to build the content. |
| --- | --- |
| gestures | All the gestures assigned to this manipulator. |
| model | Returns the current model. |
### Attributes
| gestures | All the gestures assigned to this manipulator. |
| --- | --- |
| model | Returns the current model. |
### __init__
```python
__init__(self, **kwargs) -> None
```
### call_on_build_fn
```python
call_on_build_fn(self, arg0) -> None
```
Called when Manipulator is dirty to build the content. It’s another way to build the manipulator’s content on the case the user doesn’t want to reimplement the class.
### has_on_build_fn
```python
has_on_build_fn(self) -> bool
```
Called when Manipulator is dirty to build the content. It’s another way to build the manipulator’s content on the case the user doesn’t want to reimplement the class.
### invalidate
```python
invalidate(self) -> None
```
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.scene.Manipulator.on_build">
<span class="sig-name descname">
<span class="pre">
on_build
<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.ui_scene._scene.Manipulator
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<dd>
<p>
Called when Manipulator is dirty to build the content. It’s another way to build the manipulator’s content on the case the user doesn’t want to reimplement the class.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.scene.Manipulator.on_model_updated">
<span class="sig-name descname">
<span class="pre">
on_model_updated
<span class="sig-paren">
(
<em class="sig-param">
<span class="n">
<span class="pre">
self:
<span class="pre">
omni.ui_scene._scene.Manipulator
,
<em class="sig-param">
<span class="n">
<span class="pre">
arg0:
<span class="pre">
omni::ui::scene::AbstractManipulatorModel::AbstractManipulatorItem
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<dd>
<p>
Called by the model when the model value is changed. The class should react to the changes.
<p>
### Arguments:
<blockquote>
<div>
<dl class="simple">
<dt>
`item :`
<dd>
<p>
The item in the model that is changed. If it’s NULL, the root is changed.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.scene.Manipulator.set_on_build_fn">
<span class="sig-name descname">
<span class="pre">
set_on_build_fn
<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.ui_scene._scene.Manipulator
,
<em class="sig-param">
<span class="n">
<span class="pre">
fn
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
Callable
<span class="p">
<span class="pre">
[
<span class="p">
<span class="pre">
[
<span class="pre">
omni.ui_scene._scene.Manipulator
<span class="p">
<span class="pre">
]
<span class="p">
<span class="pre">
,
<span class="w">
<span class="pre">
None
<span class="p">
<span class="pre">
]
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<dd>
<p>
Called when Manipulator is dirty to build the content. It’s another way to build the manipulator’s content on the case the user doesn’t want to reimplement the class.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.Manipulator.gestures">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
gestures
<dd>
<p>
All the gestures assigned to this manipulator.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.Manipulator.model">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
model
<dd>
<p>
Returns the current model.
| 6,440 |
omni.ui.scene.ManipulatorGesture.md | # ManipulatorGesture
## ManipulatorGesture
The base class for the gestures to provides a way to capture events of the manipulator objects.
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self, **kwargs)` | |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `sender` | Returns the relevant shape driving the gesture. |
#### `__init__(self, **kwargs)`
- **Parameters**:
- `self`: The instance of `omni.ui_scene._scene.ManipulatorGesture`.
- `**kwargs`: Additional keyword arguments.
- **Returns**: None
<em>
<span class="sig-name descname">
<span class="pre">
sender
<dt>
<a class="headerlink" href="#omni.ui.scene.ManipulatorGesture.sender" title="Permalink to this definition">
<dd>
<p>
Returns the relevant shape driving the gesture.
<dd>
<dl>
<section>
<div>
<div>
<footer>
<hr/>
| 870 |
omni.ui.scene.Matrix44.md | # Matrix44
## Matrix44
Stores a 4x4 matrix of float elements. A basic type.
Matrices are defined to be in row-major order.
The matrix mode is required to define the matrix that resets the transformation to fit the geometry into NDC, Screen space, or rotate it to the camera direction.
### Methods
- **__init__(*args, **kwargs)**
- Overloaded function.
- **get_inverse(*args, **kwargs)**
- Overloaded function.
- **get_rotation_matrix(x, y, z[, degrees])**
- Creates a matrix to specify a rotation around each axis.
- **get_scale_matrix(x, y, z)**
- Creates a matrix to specify a scaling with the given scale factor per axis.
- **get_translation_matrix(x, y, z)**
- Creates a matrix to specify a translation at the given coordinates.
- **set_look_at_view(self, arg0)**
-
| Attributes |
| --- |
| inversed |
__init__(self: omni.ui_scene._scene.Matrix44, *args, **kwargs)
- Overloaded function.
- __init__(self: omni.ui_scene._scene.Matrix44, m: omni.ui_scene._scene.Matrix44) -> None
- __init__(self: omni.ui_scene._scene.Matrix44, x: float = 1.0) -> None
- __init__(self: omni.ui_scene._scene.Matrix44, a1: float, a2: float, a3: float, a4: float, a5: float, a6: float, a7: float, a8: float, a9: float, a10: float, a11: float, a12: float, a13: float, a14: float, a15: float, a16: float) -> None
get_inverse(self: omni.ui_scene._scene.Matrix44, *args, **kwargs)
- Overloaded function.
- get_inverse(self: omni.ui_scene._scene.Matrix44) -> omni.ui_scene._scene.Matrix44
- get_inverse(self: omni.ui_scene._scene.Matrix44) -> omni.ui_scene._scene.Matrix44
get_rotation_matrix(self: omni.ui_scene._scene.Matrix44, x: float, y: float, z: float, degrees: bool = False) -> omni.ui_scene._scene.Matrix44
- Creates a matrix to specify a rotation around each axis.
### Arguments:
- `degrees :` true if the angles are specified in degrees
get_scale_matrix(self: omni.ui_scene._scene.Matrix44, x: float, y: float, z: float)
## omni.ui.scene.Matrix44 Methods
### get_scale_matrix
```python
static get_scale_matrix(x: float, y: float, z: float) -> omni.ui_scene._scene.Matrix44
```
Creates a matrix to specify a scaling with the given scale factor per axis.
### get_translation_matrix
```python
static get_translation_matrix(x: float, y: float, z: float) -> omni.ui_scene._scene.Matrix44
```
Creates a matrix to specify a translation at the given coordinates.
### set_look_at_view
```python
set_look_at_view(self: omni.ui_scene._scene.Matrix44, arg0: omni.ui_scene._scene.Matrix44) -> omni.ui_scene._scene.Matrix44
``` | 2,543 |
omni.ui.scene.MouseInput.md | # MouseInput
## MouseInput
```python
class omni.ui.scene.MouseInput
```
Bases: `pybind11_object`
### Methods
```python
__init__(self)
```
### Attributes
```python
clicked
double_clicked
down
modifiers
mouse
mouse_direction
mouse_origin
mouse_wheel
```
| Released |
|----------|
| 2023-01-01 |
```
```python
__init__(self: omni.ui_scene._scene.MouseInput) -> None
``` | 371 |
omni.ui.scene.Points.md | # Points
## Class: omni.ui.scene.Points
**Bases:** [AbstractShape](omni.ui.scene.AbstractShape.html#omni.ui.scene.AbstractShape)
Represents the point cloud.
### Methods
- **__init__(self, arg0, **kwargs)**
- Constructs the point cloud object.
- **get_gesture_payload(*args, **kwargs)**
- Overloaded function.
### Attributes
- **colors**
- List of colors of the points.
- **gesture_payload**
- Contains all the information about the intersection.
- **intersection_sizes**
- The size of the points for the intersection.
- **positions**
- List with positions of the points.
<p>
List of point sizes.
<dl>
<dt>
`__init__`
<dd>
<p>
Constructs the point cloud object.
<p>
### Arguments:
<blockquote>
<div>
<dl>
<dt>
`positions :`
<dd>
<p>
List of positions
<dt>
`kwargs
dict`
<dd>
<p>
See below
<p>
### Keyword Arguments:
<blockquote>
<div>
<dl>
<dt>
`positions`
<dd>
<p>
List with positions of the points.
<dt>
`colors`
<dd>
<p>
List of colors of the points.
<dt>
`sizes`
<dd>
<p>
List of point sizes.
<dt>
`intersection_sizes`
<dd>
<p>
The size of the points for the intersection.
<dt>
`gesture`
<dd>
<p>
All the gestures assigned to this shape.
<dt>
`gestures`
<dd>
<p>
All the gestures assigned to this shape.
<dt>
`visible`
<dd>
<p>
This property holds whether the item is visible.
<dl>
<dt>
`get_gesture_payload`
<dd>
<p>
Overloaded function.
<ol>
<li>
<p>
get_gesture_payload(self: omni.ui_scene._scene.Points) -> omni.ui_scene._scene.PointsGesturePayload
<p>
Contains all the information about the intersection.
<ol start="2">
<li>
<p>
get_gesture_payload(self: omni.ui_scene._scene.Points, arg0: omni.ui_scene._scene.GestureState) -> omni.ui_scene._scene.PointsGesturePayload
<p>
Contains all the information about the intersection at the specific state.
<dl>
<dt>
`colors`
<dd>
<p>
List of colors of the points.
<dl>
<dt>
`gesture_payload`
<dd>
<p>
Contains all the information about the intersection.
<dl>
<dt>
`intersection_sizes`
<dd>
<p>
The size of the points for the intersection.
## Properties
### intersection_sizes
The size of the points for the intersection.
### positions
List with positions of the points.
### sizes
List of point sizes. | 2,988 |
omni.ui.scene.PointsGesturePayload.md | # PointsGesturePayload
## PointsGesturePayload
```python
class omni.ui.scene.PointsGesturePayload
```
Bases: `GesturePayload`
### Methods
```python
__init__(*args, **kwargs)
```
### Attributes
```python
closest_point
distance_to_point
moved
```
```python
__init__(*args, **kwargs)
``` | 288 |
omni.ui.scene.PolygonMesh.md | # PolygonMesh
## Class omni.ui.scene.PolygonMesh
**Bases:** [AbstractShape](omni.ui.scene.AbstractShape.html#omni.ui.scene.AbstractShape)
Encodes a mesh.
### Methods
- **__init__(self, positions, colors, ...)**
- Construct a mesh with predefined properties.
- **get_gesture_payload(*args, **kwargs)**
- Overloaded function.
### Attributes
- **colors**
- Describes colors per vertex.
- **gesture_payload**
- Contains all the information about the intersection.
- **intersection_thicknesses**
- The thickness of the line for the intersection.
- **positions**
- The positions of vertices.
| Attribute | Description |
|-----------|-------------|
| points | The primary geometry attribute, describes points in local space. |
| thicknesses | When wireframe is true, it defines the thicknesses of lines. |
| vertex_counts | Provides the number of vertices in each face of the mesh, which is also the number of consecutive indices in vertex_indices that define the face. |
| vertex_indices | Flat list of the index (into the points attribute) of each vertex of each face in the mesh. |
| wireframe | When true, the mesh is drawn as lines. |
### omni.ui.scene.PolygonMesh.__init__(self, positions: object, colors: object, vertex_counts: List[int], vertex_indices: List[int], **kwargs) -> None
- **Construct a mesh with predefined properties.**
#### Arguments:
- `positions :` Describes points in local space.
- `colors :` Describes colors per vertex.
- `vertexCounts :` The number of vertices in each face.
- `vertexIndices :` The list of the index of each vertex of each face in the mesh.
- `kwargs : dict` See below
#### Keyword Arguments:
- `positions :` The primary geometry attribute, describes points in local space.
- `colors :` Describes colors per vertex.
- `vertex_counts :` The number of vertices in each face.
<dd>
<p>
Provides the number of vertices in each face of the mesh, which is also the number of consecutive indices in vertex_indices that define the face. The length of this attribute is the number of faces in the mesh.
<dt>
`vertex_indices`
<dd>
<p>
Flat list of the index (into the points attribute) of each vertex of each face in the mesh.
<dt>
`thicknesses`
<dd>
<p>
When wireframe is true, it defines the thicknesses of lines.
<dt>
`intersection_thickness`
<dd>
<p>
The thickness of the line for the intersection.
<dt>
`wireframe: `
<dd>
<p>
When true, the mesh is drawn as lines.
<dt>
`gesture`
<dd>
<p>
All the gestures assigned to this shape.
<dt>
`gestures`
<dd>
<p>
All the gestures assigned to this shape.
<dt>
`visible`
<dd>
<p>
This property holds whether the item is visible.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.scene.PolygonMesh.get_gesture_payload">
<span class="sig-name descname">
<span class="pre">
get_gesture_payload
<span class="sig-paren">
(
<em class="sig-param">
<span class="o">
<span class="pre">
*
<span class="n">
<span class="pre">
args
,
<em class="sig-param">
<span class="o">
<span class="pre">
**
<span class="n">
<span class="pre">
kwargs
<span class="sig-paren">
)
<a class="headerlink" href="#omni.ui.scene.PolygonMesh.get_gesture_payload" title="Permalink to this definition">
<dd>
<p>
Overloaded function.
<ol class="arabic simple">
<li>
<p>
get_gesture_payload(self: omni.ui_scene._scene.PolygonMesh) -> omni.ui_scene._scene.PolygonMeshGesturePayload
<p>
Contains all the information about the intersection.
<ol class="arabic simple" start="2">
<li>
<p>
get_gesture_payload(self: omni.ui_scene._scene.PolygonMesh, arg0: omni.ui_scene._scene.GestureState) -> omni.ui_scene._scene.PolygonMeshGesturePayload
<p>
Contains all the information about the intersection at the specific state.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.PolygonMesh.colors">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
colors
<a class="headerlink" href="#omni.ui.scene.PolygonMesh.colors" title="Permalink to this definition">
<dd>
<p>
Describes colors per vertex.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.PolygonMesh.gesture_payload">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
gesture_payload
<a class="headerlink" href="#omni.ui.scene.PolygonMesh.gesture_payload" title="Permalink to this definition">
<dd>
<p>
Contains all the information about the intersection.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.PolygonMesh.intersection_thicknesses">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
intersection_thicknesses
<a class="headerlink" href="#omni.ui.scene.PolygonMesh.intersection_thicknesses" title="Permalink to this definition">
<dd>
<p>
The thickness of the line for the intersection.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.PolygonMesh.positions">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
positions
<a class="headerlink" href="#omni.ui.scene.PolygonMesh.positions" title="Permalink to this definition">
<dd>
<p>
The primary geometry attribute, describes points in local space.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.PolygonMesh.thicknesses">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
thicknesses
<a class="headerlink" href="#omni.ui.scene.PolygonMesh.thicknesses" title="Permalink to this definition">
<dd>
<p>
When wireframe is true, it defines the thicknesses of lines.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.PolygonMesh.vertex_counts">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
vertex_counts
<a class="headerlink" href="#omni.ui.scene.PolygonMesh.vertex_counts" title="Permalink to this definition">
<dd>
<p>
Provides the number of vertices in each face of the mesh, which is also the number of consecutive indices in vertex_indices that define the face. The length of this attribute is the number of faces in the mesh.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.PolygonMesh.vertex_indices">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
vertex_indices
<a class="headerlink" href="#omni.ui.scene.PolygonMesh.vertex_indices" title="Permalink to this definition">
<dd>
<p>
Flat list of the index (into the points attribute) of each vertex of each face in the mesh.
### vertex_indices
Flat list of the index (into the points attribute) of each vertex of each face in the mesh.
### wireframe
When true, the mesh is drawn as lines. | 7,014 |
omni.ui.scene.PolygonMeshGesturePayload.md | # PolygonMeshGesturePayload
## PolygonMeshGesturePayload
```
class omni.ui.scene.PolygonMeshGesturePayload
```
Bases: `GesturePayload`
### Methods
- `__init__(*args, **kwargs)`
### Attributes
- `face_id`
- `s`
- `t`
```
def __init__(*args, **kwargs)
```
``` | 265 |
omni.ui.scene.Rectangle.md | # Rectangle
## Rectangle
### Class
```python
class omni.ui.scene.Rectangle
```
**Bases:**
```python
AbstractShape
```
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self[, width, height])` | Construct a rectangle with predefined size. |
| `get_gesture_payload(*args, **kwargs)` | Overloaded function. |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `axis` | The axis the rectangle is perpendicular to. |
| `color` | The color of the line. |
| `gesture_payload` | Contains all the information about the intersection. |
| `height` | The size of the rectangle. |
intersection_thickness
=======================
The thickness of the line for the intersection.
thickness
=========
The thickness of the line.
width
=====
The size of the rectangle.
wireframe
=========
When true, it's a line.
__init__
=======
Construct a rectangle with predefined size.
### Arguments:
- `width :`
- The size of the rectangle
- `height :`
- The size of the rectangle
- `kwargs`
- See below
### Keyword Arguments:
- `width`
- The size of the rectangle.
- `height`
- The size of the rectangle.
- `thickness`
- The thickness of the line.
- `intersection_thickness`
- The thickness of the line for the intersection.
- `color`
- The color of the line.
- `axis`
- The axis the rectangle is perpendicular to.
- `wireframe`
- When true, it’s a line. When false it’s a mesh.
- `gesture`
- All the gestures assigned to this shape.
- `gestures`
- All the gestures assigned to this shape.
<blockquote>
<div>
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.Rectangle.visible">
<span class="classifier">
<dd>
<p>
This property holds whether the item is visible.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.scene.Rectangle.get_gesture_payload">
<span class="sig-name descname">
<span class="pre">
get_gesture_payload
<span class="sig-paren">
(
<em class="sig-param">
<span class="o">
<span class="pre">
*
<span class="n">
<span class="pre">
args
,
<em class="sig-param">
<span class="o">
<span class="pre">
**
<span class="n">
<span class="pre">
kwargs
<span class="sig-paren">
)
<dd>
<p>
Overloaded function.
<ol class="arabic simple">
<li>
<p>
get_gesture_payload(self: omni.ui_scene._scene.Rectangle) -> omni.ui_scene._scene.RectangleGesturePayload
<p>
Contains all the information about the intersection.
<ol class="arabic simple" start="2">
<li>
<p>
get_gesture_payload(self: omni.ui_scene._scene.Rectangle, arg0: omni.ui_scene._scene.GestureState) -> omni.ui_scene._scene.RectangleGesturePayload
<p>
Contains all the information about the intersection at the specific state.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.Rectangle.axis">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
axis
<dd>
<p>
The axis the rectangle is perpendicular to.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.Rectangle.color">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
color
<dd>
<p>
The color of the line.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.Rectangle.gesture_payload">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
gesture_payload
<dd>
<p>
Contains all the information about the intersection.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.Rectangle.height">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
height
<dd>
<p>
The size of the rectangle.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.Rectangle.intersection_thickness">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
intersection_thickness
<dd>
<p>
The thickness of the line for the intersection.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.Rectangle.thickness">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
thickness
<dd>
<p>
The thickness of the line.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.Rectangle.width">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
width
<dd>
<p>
The size of the rectangle.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.Rectangle.wireframe">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
wireframe
<dd>
<p>
When true, it’s a line. When false it’s a mesh.
<footer>
<hr/>
| 4,975 |
omni.ui.scene.RectangleGesturePayload.md | # RectangleGesturePayload
## RectangleGesturePayload
```python
class omni.ui.scene.RectangleGesturePayload
```
Bases: `GesturePayload`
### Methods
| Method | Description |
|--------|-------------|
| `__init__(*args, **kwargs)` | |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `moved` | |
| `moved_s` | |
| `moved_t` | |
| `s` | |
| `t` | |
```python
def __init__(*args, **kwargs):
pass
```
# 标题
这里是段落内容。
这里是另一个段落,包含一些文本。
这里是代码块:
```
代码内容
```
这里是列表:
- 列表项1
- 列表项2
这里是引用:
> 引用内容
这里是表格:
| 列1 | 列2 |
| --- | --- |
| 数据1 | 数据2 |
这里是分割线:
---
这里是脚注:
这里是脚注内容。 | 605 |
omni.ui.scene.Scene.md | # Scene
## Scene
Represents the root of the scene and holds the shapes, gestures and managers.
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self, **kwargs)` | Constructor |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `draw_list_buffer_count` | Return the number of buffers used. |
#### `__init__(self, **kwargs)`
Constructor
- `kwargs (dict)`: See below
### Keyword Arguments:
> ```
> visible
> ```
> This property holds whether the item is visible.
**draw_list_buffer_count**
Return the number of buffers used. Using for unit testing. | 605 |
omni.ui.scene.SceneView.md | # SceneView
## SceneView
The widget to render omni.ui.scene.
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self[, model])` | Constructor. |
| `get_ray_from_ndc(self, ndc)` | Convert NDC 2D [-1..1] coordinates to 3D ray. |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `aspect_ratio_policy` | Define what happens when the aspect ratio of the camera is different from the aspect ratio of the widget. |
| `cache_draw_buffer` | When it's true, the caching draw buffer optimization is enabled. |
| `child_windows_input` | When it's false, the mouse events from other widgets inside the bounds are ignored. |
| `model` | Returns the current model. |
| Projection Matrix | Description |
| --- | --- |
| `projection` | The camera projection matrix. |
| `scene` | The container that holds the shapes, gestures and managers. |
| `screen_aspect_ratio` | Aspect ratio of the rendering screen. |
| `view` | The camera view matrix. |
### omni.ui.scene.SceneView.__init__
`__init__(self: omni.ui_scene._scene.SceneView, model: AbstractManipulatorModel = None, **kwargs)`
- **Constructor.**
#### Keyword Arguments:
- `aspect_ratio_policy`: Define what happens when the aspect ratio of the camera is different from the aspect ratio of the widget.
- `model`: The camera view matrix. It’s a shortcut for Matrix44(SceneView.model.get_as_floats(“view”))
- `screen_aspect_ratio`: Aspect ratio of the rendering screen. This screen will be fit to the widget. SceneView simulates the behavior of the Kit viewport where the rendered image (screen) fits into the viewport (widget), and the camera has multiple policies that modify the camera projection matrix’s aspect ratio to match it to the screen aspect ratio. When screen_aspect_ratio is 0, Screen size matches the Widget bounds.
- `child_windows_input`: When it’s false, the mouse events from other widgets inside the bounds are ignored. We need it to filter out mouse events from mouse events of widgets in `ui.VStack(content_clipping=1)`.
- `width`: This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
- `height`: This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
- `name`: The name of the widget that user can set.
- `style_type_name_override`: By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
- `identifier`: An optional identifier of the widget we can use to refer to it in queries.
- `visible`:
### visible
- **Type:** bool
- **Description:** This property holds whether the widget is visible.
### visibleMin
- **Type:** float
- **Description:** If the current zoom factor and DPI is less than this value, the widget is not visible.
### visibleMax
- **Type:** float
- **Description:** If the current zoom factor and DPI is bigger than this value, the widget is not visible.
### tooltip
- **Type:** str
- **Description:** Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style.
### tooltip_fn
- **Type:** Callable
- **Description:** Set dynamic tooltip that will be created dynamically the first time it is needed. The function is called inside a ui.Frame scope that the widget will be parented correctly.
### tooltip_offset_x
- **Type:** float
- **Description:** Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non-zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
### tooltip_offset_y
- **Type:** float
- **Description:** Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non-zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
### enabled
- **Type:** bool
- **Description:** This property holds whether the widget is enabled. In general, an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
### selected
- **Type:** bool
- **Description:** This property holds a flag that specifies the widget has to use eSelected state of the style.
### checked
- **Type:** bool
- **Description:** This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
### dragging
- **Type:** bool
- **Description:** This property holds if the widget is being dragged.
### opaque_for_mouse_events
- **Type:** bool
- **Description:** If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either.
### skip_draw_when_clipped
- **Type:** bool
- **Description:** The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
### mouse_moved_fn
- **Type:** Callable
- **Description:** Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier).
### mouse_pressed_fn
- **Type:** Callable
- **Description:** Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
### mouse_released_fn
- **Type:** Callable
- **Description:** Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier).
### mouse_double_clicked_fn
- **Type:** Callable
- **Description:** Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier).
### mouse_wheel_fn
- **Type:** Callable
- **Description:** Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier).
### mouse_hovered_fn
- **Type:** Callable
- **Description:** Sets the function that will be called when the user uses mouse enter/leave on the focused window. Function specification is the same as in setMouseHoveredFn. void onMouseHovered(bool hovered).
### drag_fn
- **Type:** Callable
- **Description:** Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
### accept_drop_fn
- **Type:** Callable
- **Description:** Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
### drop_fn
- **Type:** Callable
- **Description:** Specify that this Widget accepts drops and set the callback to the drop operation.
### computed_content_size_changed_fn
- **Type:** Callable
- **Description:** [Description missing in the provided HTML]
Called when the size of the widget is changed.
### get_ray_from_ndc
```python
get_ray_from_ndc(self: omni.ui_scene._scene.SceneView, ndc: omni.ui_scene._scene.Vector2) -> Tuple[omni.ui_scene._scene.Vector3, omni.ui_scene._scene.Vector3]
```
Convert NDC 2D [-1..1] coordinates to 3D ray.
### aspect_ratio_policy
```
property aspect_ratio_policy
```
Define what happens when the aspect ratio of the camera is different from the aspect ratio of the widget.
### cache_draw_buffer
```
property cache_draw_buffer
```
When it’s true, the caching draw buffer optimization is enabled.
### child_windows_input
```
property child_windows_input
```
When it’s false, the mouse events from other widgets inside the bounds are ignored. We need it to filter out mouse events from mouse events of widgets in `ui.VStack(content_clipping=1)`.
### model
```
property model
```
Returns the current model.
### projection
```
property projection
```
The camera projection matrix. It’s a shortcut for Matrix44(SceneView.model.get_as_floats(“projection”))
### scene
```
property scene
```
The container that holds the shapes, gestures and managers.
### screen_aspect_ratio
```
property screen_aspect_ratio
```
Aspect ratio of the rendering screen. This screen will be fit to the widget. SceneView simulates the behavior of the Kit viewport where the rendered image (screen) fits into the viewport (widget), and the camera has multiple policies that modify the camera projection matrix’s aspect ratio to match it to the screen aspect ratio. When screen_aspect_ratio is 0, Screen size matches the Widget bounds.
### view
```
property view
```
## view
The camera view matrix. It’s a shortcut for Matrix44(SceneView.model.get_as_floats(“view”)) | 9,687 |
omni.ui.scene.Screen.md | # Screen
## Screen
The empty shape that triggers all the gestures at any place. Is used to track gestures when the user clicked the empty space. For example for cameras.
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self, **kwargs)` | Constructor. |
| `get_gesture_payload(*args, **kwargs)` | Overloaded function. |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `gesture_payload` | Contains all the information about the intersection. |
### `__init__(self, **kwargs)`
Constructor for `omni.ui_scene._scene.Screen`.
<dt>
`kwargs
<span class="classifier">
dict`
<dd>
<p>
See below
<p>
### Keyword Arguments:
<blockquote>
<div>
<dl class="simple">
<dt>
`gesture
<span class="classifier">
`
<dd>
<p>
All the gestures assigned to this shape.
<dt>
`gestures
<span class="classifier">
`
<dd>
<p>
All the gestures assigned to this shape.
<dt>
`visible
<span class="classifier">
`
<dd>
<p>
This property holds whether the item is visible.
<dd>
<p>
Overloaded function.
<ol class="arabic simple">
<li>
<p>
get_gesture_payload(self: omni.ui_scene._scene.Screen) -> omni.ui_scene._scene.ScreenGesturePayload
<p>
Contains all the information about the intersection.
<ol class="arabic simple" start="2">
<li>
<p>
get_gesture_payload(self: omni.ui_scene._scene.Screen, arg0: omni.ui_scene._scene.GestureState) -> omni.ui_scene._scene.ScreenGesturePayload
<p>
Contains all the information about the intersection at the specific state.
<dd>
<p>
Contains all the information about the intersection.
| 1,768 |
omni.ui.scene.ScreenGesturePayload.md | # ScreenGesturePayload
## ScreenGesturePayload
```python
class omni.ui.scene.ScreenGesturePayload
```
Bases: `GesturePayload`
### Methods
```python
__init__(*args, **kwargs)
```
### Attributes
```python
direction
mouse
mouse_moved
moved
```
```python
__init__(*args, **kwargs)
``` | 284 |
omni.ui.scene.ScrollGesture.md | # ScrollGesture
## Class `omni.ui.scene.ScrollGesture`
Bases: `ShapeGesture`
The gesture that provides a way to capture mouse scroll event.
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self, _on_ended=None, **kwargs)` | Constructs an gesture to track when the user clicked the mouse. |
| `call_on_ended_fn(self, arg0)` | Called when the user scrolls. |
| `has_on_ended_fn(self)` | Called when the user scrolls. |
| `set_on_ended_fn(self, fn, None])` | Called when the user scrolls. |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `modifiers` | The modifier that should be pressed to trigger this gesture. |
| `mouse_button` | |
| Property | Description |
|----------|-------------|
| `mouse_button` | The mouse button this gesture is watching. |
| `scroll` | Returns the current scroll state. |
### __init__
```python
__init__(self: omni.ui_scene._scene.ScrollGesture, _on_ended: Callable[[omni::ui::scene::AbstractShape], None] = None, **kwargs) -> None
```
Constructs an gesture to track when the user clicked the mouse.
#### Arguments:
- `onEnded :` Function that is called when the user clicked the mouse button.
- `kwargs` dict: See below
#### Keyword Arguments:
- `mouse_button` : The mouse button this gesture is watching.
- `modifiers` : The modifier that should be pressed to trigger this gesture.
- `on_ended_fn` : Called when the user scrolls.
- `name` : The name of the object. It’s used for debugging.
- `manager` : The Manager that controls this gesture.
### call_on_ended_fn
```python
call_on_ended_fn(self: omni.ui_scene._scene.ScrollGesture, arg0: omni::ui::scene::AbstractShape) -> None
```
Called when the user scrolls.
### has_on_ended_fn
```python
has_on_ended_fn(self: omni.ui_scene._scene.ScrollGesture) -> bool
```
Called when the user scrolls.
### set_on_ended_fn
```python
set_on_ended_fn(self: omni.ui_scene._scene.ScrollGesture, fn: Callable[[omni::ui::scene::AbstractShape], None]) -> None
```
Sets the function to be called when the user scrolls.
## Properties
### modifiers
The modifier that should be pressed to trigger this gesture.
### mouse_button
The mouse button this gesture is watching.
### scroll
Returns the current scroll state. | 2,247 |
omni.ui.scene.ShapeGesture.md | # ShapeGesture
## ShapeGesture
The base class for the gestures to provides a way to capture mouse events in 3d scene.
### Methods
- `__init__(*args, **kwargs)`
### Attributes
- `raw_input`
- `sender`
### `__init__(*args, **kwargs)` | 238 |
omni.ui.scene.Space.md | # Space
## Class Definition
```python
class omni.ui.scene.Space(pybind11_object)
```
### Members
- CURRENT
- WORLD
- OBJECT
- NDC
- SCREEN
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self, value)` | |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `CURRENT` | |
| `NDC` | |
| `OBJECT` | |
| `SCREEN` | |
| `WORLD` | |
| `name` | |
| `value` | |
```
__init__(self: omni.ui_scene._scene.Space, value: int) -> None
property name | 494 |
omni.ui.scene.TexturedMesh.md | # TexturedMesh
Encodes a polygonal mesh with free-form textures.
## Methods
| Method | Description |
|--------|-------------|
| `__init__(*args, **kwargs)` | Overloaded function. |
| `get_gesture_payload(*args, **kwargs)` | Overloaded function. |
## Attributes
| Attribute | Description |
|-----------|-------------|
| `gesture_payload` | Contains all the information about the intersection. |
| `image_height` | The resolution of rasterization of svg and for ImageProvider. |
| `image_provider` | " path, a direct path or the path relative to the application root directory. |
| `image_width` | The resolution of rasterization of svg and for ImageProvider. |
| Property | Description |
|----------|-------------|
| The resolution for rasterization of svg and for ImageProvider. | The resolution for rasterization of svg and for ImageProvider. |
| source_url | " path, a direct path or the path relative to the application root directory. |
| uvs | This property holds the texture coordinates of the mesh. |
### omni.ui.scene.TexturedMesh.__init__
```python
__init__(*args, **kwargs)
```
Overloaded function.
1. __init__(self: omni.ui_scene._scene.TexturedMesh, source_url: str, uvs: object, positions: object, colors: object, vertex_counts: List[int], vertex_indices: List[int], legacy_flipped_v: bool = True, **kwargs) -> None
Construct a mesh with predefined properties.
### Arguments:
- `sourceUrl :` Describes the texture image url.
- `uvs :` Describes uvs for the image texture.
- `positions :` Describes points in local space.
- `colors :` Describes colors per vertex.
- `vertexCounts :` The number of vertices in each face.
- `vertexIndices :` The list of the index of each vertex of each face in the mesh.
- `kwargs` See below
### Keyword Arguments:
- `uvs` This property holds the texture coordinates of the mesh.
- `source_url` This property holds the image URL. It can be an “omni:” path, a “file:” path, a direct path or the path relative to the application root directory.
- `image_provider` This property holds the image provider. It can be an “omni:” path, a “file:” path, a direct path or the path relative to the application root directory.
- `image_width` The resolution for rasterization of svg and for ImageProvider.
- `image_height` The resolution of rasterization of svg and for ImageProvider.
- `positions` The primary geometry attribute, describes points in local space.
- `colors` Describes colors per vertex.
- `vertex_counts` Provides the number of vertices in each face of the mesh, which is also the number of consecutive indices in vertex_indices that define the face. The length of this attribute is the number of faces in the mesh.
- `vertex_indices` Flat list of the index (into the points attribute) of each vertex of each face in the mesh.
- `thicknesses` When wireframe is true, it defines the thicknesses of lines.
- `intersection_thickness` The thickness of the line for the intersection.
- `wireframe:` When true, the mesh is drawn as lines.
- `gesture` All the gestures assigned to this shape.
- `gestures` All the gestures assigned to this shape.
```
<blockquote>
<div>
<dl>
<dt>
`visible`
<dd>
<p>
This property holds whether the item is visible.
<ol start="2">
<li>
<p>
__init__(self: omni.ui_scene._scene.TexturedMesh, image_provider: omni.ui._ui.ImageProvider, uvs: object, positions: object, colors: object, vertex_counts: List[int], vertex_indices: List[int], legacy_flipped_v: bool = True, **kwargs) -> None
<p>
Construct a mesh with predefined properties.
<p>
### Arguments:
<blockquote>
<div>
<dl>
<dt>
`imageProvider :`
<dd>
<p>
Describes the texture image provider.
<dt>
`uvs :`
<dd>
<p>
Describes uvs for the image texture.
<dt>
`positions :`
<dd>
<p>
Describes points in local space.
<dt>
`colors :`
<dd>
<p>
Describes colors per vertex.
<dt>
`vertexCounts :`
<dd>
<p>
The number of vertices in each face.
<dt>
`vertexIndices :`
<dd>
<p>
The list of the index of each vertex of each face in the mesh.
<dt>
`kwargs`
<dd>
<p>
See below
<p>
### Keyword Arguments:
<blockquote>
<div>
<dl>
<dt>
`uvs`
<dd>
<p>
This property holds the texture coordinates of the mesh.
<dt>
`source_url`
<dd>
<p>
This property holds the image URL. It can be an “omni:” path, a “file:” path, a direct path or the path relative to the application root directory.
<dt>
`image_provider`
<dd>
<p>
This property holds the image provider. It can be an “omni:” path, a “file:” path, a direct path or the path relative to the application root directory.
<dt>
`image_width`
<dd>
<p>
The resolution for rasterization of svg and for ImageProvider.
<dt>
`image_height`
<dd>
<p>
The resolution of rasterization of svg and for ImageProvider.
<dt>
`positions`
<dd>
<p>
The primary geometry attribute, describes points in local space.
<dt>
`colors`
<dd>
<p>
Describes colors per vertex.
<dt>
`vertex_counts`
<dd>
<p>
Provides the number of vertices in each face of the mesh, which is also the number of consecutive indices in vertex_indices that define the face. The length of this attribute is the number of faces in the mesh.
<dt>
`vertex_indices`
<dd>
<p>
Flat list of the index (into the points attribute) of each vertex of each face in the mesh.
<dt>
`thicknesses`
<dd>
<p>
When wireframe is true, it defines the thicknesses of lines.
<dt>
`intersection_thickness`
<dd>
<p>
The thickness of the line for the intersection.
<dt>
`wireframe: `
<dd>
<p>
When true, the mesh is drawn as lines.
<dt>
`gesture`
<dd>
<p>
All the gestures assigned to this shape.
<dt>
`gestures`
<dd>
<p>
All the gestures assigned to this shape.
<dt>
`visible`
<dd>
<p>
This property holds whether the item is visible.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.scene.TexturedMesh.get_gesture_payload">
<span class="sig-name descname">
<span class="pre">
get_gesture_payload
<span class="sig-paren">
(
<em class="sig-param">
<span class="o">
<span class="pre">
*
<span class="n">
<span class="pre">
args
,
<em class="sig-param">
<span class="o">
<span class="pre">
**
<span class="n">
<span class="pre">
kwargs
<span class="sig-paren">
)
<a class="headerlink" href="#omni.ui.scene.TexturedMesh.get_gesture_payload" title="Permalink to this definition">
<dd>
<p>
Overloaded function.
<ol class="arabic simple">
<li>
<p>
get_gesture_payload(self: omni.ui_scene._scene.TexturedMesh) -> omni.ui_scene._scene.TexturedMeshGesturePayload
<p>
Contains all the information about the intersection.
<ol class="arabic simple" start="2">
<li>
<p>
get_gesture_payload(self: omni.ui_scene._scene.TexturedMesh, arg0: omni.ui_scene._scene.GestureState) -> omni.ui_scene._scene.TexturedMeshGesturePayload
Contains all the information about the intersection at the specific state.
Contains all the information about the intersection.
The resolution of rasterization of svg and for ImageProvider.
” path, a direct path or the path relative to the application root directory.
- Type
This property holds the image provider. It can be an “omni
- Type
” path, a “file
The resolution for rasterization of svg and for ImageProvider.
” path, a direct path or the path relative to the application root directory.
- Type
This property holds the image URL. It can be an “omni
- Type
” path, a “file
This property holds the texture coordinates of the mesh. | 7,380 |
omni.ui.scene.TexturedMeshGesturePayload.md | # TexturedMeshGesturePayload
## TexturedMeshGesturePayload
```python
class omni.ui.scene.TexturedMeshGesturePayload
```
Bases: `PolygonMeshGesturePayload`
### Methods
```python
__init__(*args, **kwargs)
```
### Attributes
```python
u
v
```
```python
__init__(*args, **kwargs)
``` | 283 |
omni.ui.scene.Transform.md | # Transform
## Class: omni.ui.scene.Transform
**Bases:** [AbstractContainer](omni.ui.scene.AbstractContainer.html#omni.ui.scene.AbstractContainer)
Transforms children with component affine transformations.
### Methods
- **__init__(*args, **kwargs)**
- Overloaded function.
### Attributes
- **basis**
- A custom basis for representing this transform's coordinate system.
- **look_at**
- Rotates this transform to align the direction with the camera.
- **scale_to**
- Which space the current transform will be rescaled before applying the matrix.
- **transform**
- Single transformation matrix.
## __init__
**__init__(*args, **kwargs)**
- Overloaded function.
### Overloaded function.
1. __init__(self: omni.ui_scene._scene.Transform, **kwargs) -> None
- Constructor.
- ### Keyword Arguments:
- `transform` (Single transformation matrix.)
- `scale_to` (Which space the current transform will be rescaled before applying the matrix. It’s useful to make the object the same size regardless the distance to the camera.)
- `look_at` (Rotates this transform to align the direction with the camera.)
- `basis` (A custom basis for representing this transform’s coordinate system.)
- `visible` (This property holds whether the item is visible.)
2. __init__(self: omni.ui_scene._scene.Transform, arg0: object, **kwargs) -> None
- Constructor.
- ### Keyword Arguments:
- `transform` (Single transformation matrix.)
- `scale_to` (Which space the current transform will be rescaled before applying the matrix. It’s useful to make the object the same size regardless the distance to the camera.)
- `look_at` (Rotates this transform to align the direction with the camera.)
- `basis` (A custom basis for representing this transform’s coordinate system.)
- `visible` (This property holds whether the item is visible.)
### Bases:
- pybind11_object
### Members:
- NONE
- CAMERA
### Properties:
- `name` (property)
- `basis` (A custom basis for representing this transform’s coordinate system.)
- `look_at` (Rotates this transform to align the direction with the camera.)
- `scale_to` (Which space the current transform will be rescaled before applying the matrix. It’s useful to make the object the same size regardless the distance to the camera.)
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.Transform.space">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
space
<a class="headerlink" href="#omni.ui.scene.Transform.space" title="Permalink to this definition">
<dd>
<p>
Which space the current transform will be rescaled before applying the matrix. It’s useful to make the object the same size regardless the distance to the camera.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.scene.Transform.transform">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
transform
<a class="headerlink" href="#omni.ui.scene.Transform.transform" title="Permalink to this definition">
<dd>
<p>
Single transformation matrix.
| 3,290 |
omni.ui.scene.TransformBasis.md | # TransformBasis
## Class
```python
class omni.ui.scene.TransformBasis(pybind11_object)
```
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self, **kwargs)` | |
| `get_matrix(self)` | |
#### `__init__(self, **kwargs)`
- **Parameters**:
- `self`: Instance of `omni.ui_scene._scene.TransformBasis`
- `**kwargs`: Additional keyword arguments
- **Returns**: None
#### `get_matrix(self)`
- **Parameters**:
- `self`: Instance of `omni.ui_scene._scene.TransformBasis`
- **Returns**: None
``` | 523 |
omni.ui.scene.Vector2.md | # Vector2
## Vector2
### Methods
- `__init__(*args, **kwargs)`
- Overloaded function.
- `get_length(self)`
- `get_normalized(self)`
### Attributes
- `x`
- `y`
#### `__init__(*args, **kwargs)`
- Overloaded function.
- __init__(self: omni.ui_scene._scene.Vector2, v: omni.ui_scene._scene.Vector2) -> None
- __init__(self: omni.ui_scene._scene.Vector2, x: float = 0.0) -> None
- __init__(self: omni.ui_scene._scene.Vector2, x: float, y: float) -> None
### get_length
- **Function**: get_length
- **Parameters**:
- self: omni.ui_scene._scene.Vector2
- **Returns**: float
### get_normalized
- **Function**: get_normalized
- **Parameters**:
- self: omni.ui_scene._scene.Vector2
- **Returns**: omni.ui_scene._scene.Vector2 | 730 |
omni.ui.scene.Vector3.md | # Vector3
## Vector3
Bases: `pybind11_object`
### Methods
| Method | Description |
|--------|-------------|
| `__init__(*args, **kwargs)` | Overloaded function. |
| `get_length(self)` | |
| `get_normalized(self)` | |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `x` | |
| `y` | |
| `z` | |
## __init__(*args, **kwargs)
```
### Overloaded function.
1. __init__(self: omni.ui_scene._scene.Vector3, v: omni.ui_scene._scene.Vector3) -> None
2. __init__(self: omni.ui_scene._scene.Vector3, x: float = 0.0) -> None
3. __init__(self: omni.ui_scene._scene.Vector3, x: float, y: float, z: float) -> None
### get_length
- Parameters:
- self: omni.ui_scene._scene.Vector3
- Returns: float
### get_normalized
- Parameters:
- self: omni.ui_scene._scene.Vector3
- Returns: omni.ui_scene._scene.Vector3 | 833 |
omni.ui.scene.Vector4.md | # Vector4
## Vector4
```
```markdown
class omni.ui.scene.Vector4
```
```markdown
Bases: pybind11_object
```
```markdown
### Methods
```
```markdown
__init__(*args, **kwargs)
```
```markdown
Overloaded function.
```
```markdown
get_length(self)
```
```markdown
get_normalized(self)
```
```markdown
### Attributes
```
```markdown
w
```
```markdown
x
```
```markdown
y
```
```markdown
z
```
```markdown
__init__(self, *args, **kwargs)
```
```markdown
Overloaded function.
```
```markdown
get_length(self)
```
```markdown
get_normalized(self)
```
```markdown
### Attributes
```
```markdown
w
```
```markdown
x
```
```markdown
y
```
```markdown
z
```
### __init__ Method
**Overloaded function.**
1. __init__(self: omni.ui_scene._scene.Vector4, v: omni.ui_scene._scene.Vector4) -> None
2. __init__(self: omni.ui_scene._scene.Vector4, x: float = 0.0) -> None
3. __init__(self: omni.ui_scene._scene.Vector4, x: float, y: float, z: float, w: float) -> None
4. __init__(self: omni.ui_scene._scene.Vector4, v: omni.ui_scene._scene.Vector3, w: float) -> None
### get_length Method
get_length(self: omni.ui_scene._scene.Vector4) -> float
### get_normalized Method
get_normalized(self: omni.ui_scene._scene.Vector4) -> omni.ui_scene._scene.Vector4 | 1,257 |
omni.ui.scene.Widget.md | # Widget
## Widget
The shape that contains the omni.ui widgets. It automatically creates IAppWindow and transfers its content to the texture of the rectangle. It interacts with the mouse and sends the mouse events to the underlying window, so interacting with the UI on this rectangle is smooth for the user.
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self, width, height, **kwargs)` | Created an empty image. |
| `invalidate(self)` | Rebuild and recapture the widgets at the next frame. |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `fill_policy` | Define what happens when the source image has a different size than the item. |
| `frame` | Return the main frame of the widget. |
| `resolution_height` | The resolution of the widget framebuffer. |
| `resolution_scale` | The resolution scale of the widget framebuffer. |
| Property | Description |
|-------------------------|-----------------------------------------------------------------------------|
| resolution_scale | The resolution scale of the widget. |
| resolution_width | The resolution of the widget framebuffer. |
| update_policy | Define when to redraw the widget. |
### __init__ Method:
```python
def __init__(self, width: float, height: float, **kwargs) -> None:
```
- **Description:** Created an empty image.
- **Keyword Arguments:**
- `fill_policy`: Define what happens when the source image has a different size than the item.
- `update_policy`: Define when to redraw the widget.
- `resolution_scale`: The resolution scale of the widget.
- `resolution_width`: The resolution of the widget framebuffer.
- `resolution_height`: The resolution of the widget framebuffer.
- `width`: The size of the rectangle.
- `height`: The size of the rectangle.
- `thickness`: The thickness of the line.
- `intersection_thickness`: The thickness of the line for the intersection.
- `color`: The color of the line.
- `axis`: The axis the rectangle is perpendicular to.
- `wireframe`: When true, it’s a line. When false it’s a mesh.
- `gesture`: All the gestures assigned to this shape.
- `gestures`: All the gestures assigned to this shape.
- `visible`: This property holds whether the item is visible.
```
### FillPolicy Class:
```python
class FillPolicy:
## Definitions
### FillPolicy
- **Bases:** pybind11_object
- **Members:**
- STRETCH
- PRESERVE_ASPECT_FIT
- PRESERVE_ASPECT_CROP
- **Property:** name
### UpdatePolicy
- **Bases:** pybind11_object
- **Members:**
- ON_DEMAND
- ALWAYS
- ON_MOUSE_HOVERED
- **Property:** name
### Methods
- **invalidate(self: omni.ui_scene._scene.Widget) -> None**
- Rebuild and recapture the widgets at the next frame.
### Properties
- **fill_policy**
- Define what happens when the source image has a different size than the item.
- **frame**
- Return the main frame of the widget.
- **resolution_height**
- The resolution of the widget framebuffer.
- **resolution_scale**
- The resolution scale of the widget.
- **resolution_width**
- The resolution of the widget framebuffer.
- **update_policy**
- Define when to redraw the widget. | 3,366 |
omni.ui.ScrollBarPolicy.md | # ScrollBarPolicy
## ScrollBarPolicy
- Bases: `pybind11_object`
### Members
- SCROLLBAR_AS_NEEDED
- SCROLLBAR_ALWAYS_OFF
- SCROLLBAR_ALWAYS_ON
### Methods
- `__init__(self, value)`
### Attributes
- `SCROLLBAR_ALWAYS_OFF`
- `SCROLLBAR_ALWAYS_ON`
- `SCROLLBAR_AS_NEEDED`
- `name`
- `value`
:
omni.ui._ui.ScrollBarPolicy
,
value : int
)
→ None
property
name | 360 |
omni.ui.ScrollingFrame.md | # ScrollingFrame
The ScrollingFrame class provides the ability to scroll onto another widget. ScrollingFrame is used to display the contents of a child widget within a frame. If the widget exceeds the size of the frame, the frame can provide scroll bars so that the entire area of the child widget can be viewed. The child widget must be specified with addChild().
## Methods
- `__init__(self, **kwargs)`
- Construct ScrollingFrame.
- `set_scroll_x_changed_fn(self, arg0)`
- The horizontal position of the scroll bar.
- `set_scroll_y_changed_fn(self, arg0)`
- The vertical position of the scroll bar.
## Attributes
- `horizontal_scrollbar_policy`
- This property holds the policy for the horizontal scroll bar.
- `scroll_x`
- The horizontal scroll position.
The horizontal position of the scroll bar.
The max position of the horizontal scroll bar.
The vertical position of the scroll bar.
The max position of the vertical scroll bar.
This property holds the policy for the vertical scroll bar.
__init__(self: omni.ui._ui.ScrollingFrame, **kwargs) -> None
- Construct ScrollingFrame.
- `kwargs: dict`
- See below
### Keyword Arguments:
- `scroll_x: float`
- The horizontal position of the scroll bar. When it’s changed, the contents will be scrolled accordingly.
- `scroll_x_max: float`
- The max position of the horizontal scroll bar.
- `scroll_x_changed_fn: Callable[[float], None]`
- The horizontal position of the scroll bar. When it’s changed, the contents will be scrolled accordingly.
- `scroll_y: float`
- The vertical position of the scroll bar. When it’s changed, the contents will be scrolled accordingly.
- `scroll_y_max: float`
- The max position of the vertical scroll bar.
- `scroll_y_changed_fn: Callable[[float], None]`
- The vertical position of the scroll bar. When it’s changed, the contents will be scrolled accordingly.
- `horizontal_scrollbar_policy: ui.ScrollBarPolicy`
- This property holds the policy for the horizontal scroll bar.
- `vertical_scrollbar_policy: ui.ScrollBarPolicy`
- This property holds the policy for the vertical scroll bar.
- `horizontal_clipping`
- When the content of the frame is bigger than the frame the exceeding part is not drawn if the clipping is on. It only works for horizontal direction.
- `vertical_clipping`
- When the content of the frame is bigger than the frame the exceeding part is not drawn if the clipping is on. It only works for vertial direction.
- `separate_window`
- A special mode where the child is placed to the transparent borderless window. We need it to be able to place the UI to the exact stacking order between other windows.
- `raster_policy`
- Determine how the content of the frame should be rasterized.
- `build_fn`
- Set the callback that will be called once the frame is visible and the content of the callback will override the frame child. It’s useful for lazy load.
<dt>
`width
<span class="classifier">
ui.Length`
<dd>
<p>
This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
<dt>
`height
<span class="classifier">
ui.Length`
<dd>
<p>
This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
<dt>
`name
<span class="classifier">
str`
<dd>
<p>
The name of the widget that user can set.
<dt>
`style_type_name_override
<span class="classifier">
str`
<dd>
<p>
By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
<dt>
`identifier
<span class="classifier">
str`
<dd>
<p>
An optional identifier of the widget we can use to refer to it in queries.
<dt>
`visible
<span class="classifier">
bool`
<dd>
<p>
This property holds whether the widget is visible.
<dt>
`visibleMin
<span class="classifier">
float`
<dd>
<p>
If the current zoom factor and DPI is less than this value, the widget is not visible.
<dt>
`visibleMax
<span class="classifier">
float`
<dd>
<p>
If the current zoom factor and DPI is bigger than this value, the widget is not visible.
<dt>
`tooltip
<span class="classifier">
str`
<dd>
<p>
Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
<dt>
`tooltip_fn
<span class="classifier">
Callable`
<dd>
<p>
Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
<dt>
`tooltip_offset_x
<span class="classifier">
float`
<dd>
<p>
Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
<dt>
`tooltip_offset_y
<span class="classifier">
float`
<dd>
<p>
Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
<dt>
`enabled
<span class="classifier">
bool`
<dd>
<p>
This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
<dt>
`selected
<span class="classifier">
bool`
<dd>
<p>
This property holds a flag that specifies the widget has to use eSelected state of the style.
<dt>
`checked
<span class="classifier">
bool`
<dd>
<p>
This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
<dt>
`dragging
<span class="classifier">
bool`
<dd>
<p>
This property holds if the widget is being dragged.
<dt>
`opaque_for_mouse_events
<span class="classifier">
bool`
<dd>
<p>
If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
<dt>
`skip_draw_when_clipped
<span class="classifier">
bool`
<dd>
<p>
The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
<dt>
`mouse_moved_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
<dt>
`mouse_pressed_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
<dt>
`mouse_released_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_double_clicked_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_wheel_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
### Functions
#### mouse_hovered_fn
- **Description**: Sets the function that will be called when the user uses mouse enter/leave on the focused window. Function specification is the same as in setMouseHoveredFn. void onMouseHovered(bool hovered)
#### drag_fn
- **Description**: Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
#### accept_drop_fn
- **Description**: Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
#### drop_fn
- **Description**: Specify that this Widget accepts drops and set the callback to the drop operation.
#### computed_content_size_changed_fn
- **Description**: Called when the size of the widget is changed.
### Methods
#### set_scroll_x_changed_fn(self: omni.ui._ui.ScrollingFrame, arg0: Callable[[float], None]) -> None
- **Description**: The horizontal position of the scroll bar. When it’s changed, the contents will be scrolled accordingly.
#### set_scroll_y_changed_fn(self: omni.ui._ui.ScrollingFrame, arg0: Callable[[float], None]) -> None
- **Description**: The vertical position of the scroll bar. When it’s changed, the contents will be scrolled accordingly.
### Properties
#### horizontal_scrollbar_policy
- **Description**: This property holds the policy for the horizontal scroll bar.
#### scroll_x
- **Description**: The horizontal position of the scroll bar. When it’s changed, the contents will be scrolled accordingly.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.ScrollingFrame.scroll_x_max">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
scroll_x_max
<a class="headerlink" href="#omni.ui.ScrollingFrame.scroll_x_max" title="Permalink to this definition">
<dd>
<p>
The max position of the horizontal scroll bar.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.ScrollingFrame.scroll_y">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
scroll_y
<a class="headerlink" href="#omni.ui.ScrollingFrame.scroll_y" title="Permalink to this definition">
<dd>
<p>
The vertical position of the scroll bar. When it’s changed, the contents will be scrolled accordingly.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.ScrollingFrame.scroll_y_max">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
scroll_y_max
<a class="headerlink" href="#omni.ui.ScrollingFrame.scroll_y_max" title="Permalink to this definition">
<dd>
<p>
The max position of the vertical scroll bar.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.ScrollingFrame.vertical_scrollbar_policy">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
vertical_scrollbar_policy
<a class="headerlink" href="#omni.ui.ScrollingFrame.vertical_scrollbar_policy" title="Permalink to this definition">
<dd>
<p>
This property holds the policy for the vertical scroll bar.
| 12,053 |
omni.ui.Separator.md | # Separator
The Separator class provides blank space. Normally, it’s used to create separator line in the UI elements
## Methods
- `__init__(self[, text])`
- Construct Separator.
## Attributes
```
Construct Separator.
```
See below
```
### Keyword Arguments:
```
text: str
This property holds the menu’s text.
hotkey_text: str
This property holds the menu’s hotkey text.
checkable: bool
This property holds whether this menu item is checkable. A checkable item is one which has an on/off state.
hide_on_click: bool
Hide or keep the window when the user clicked this item.
delegate: MenuDelegate
The delegate that generates a widget per menu item.
triggered_fn: void
Sets the function that is called when an action is activated by the user; for example, when the user clicks a menu option, or presses an action’s shortcut key combination.
width: ui.Length
This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
height: ui.Length
This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
name: str
The name of the widget that user can set.
style_type_name_override: str
By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
identifier: str
An optional identifier of the widget we can use to refer to it in queries.
visible: bool
This property holds whether the widget is visible.
visibleMin: float
If the current zoom factor and DPI is less than this value, the widget is not visible.
visibleMax: float
If the current zoom factor and DPI is bigger than this value, the widget is not visible.
tooltip: str
Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
tooltip_fn: Callable
Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
tooltip_offset_x: float
Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
tooltip_offset_y: float
Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
enabled: bool
This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
selected: bool
This property holds a flag that specifies the widget has to use eSelected state of the style.
checked: bool
This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
dragging: bool
This property holds if the widget is being dragged.
opaque_for_mouse_events: bool
If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
```
<dl>
<dt>
`skip_draw_when_clipped
<span class="classifier">
bool`
<dd>
<p>
The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
<dt>
`mouse_moved_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
<dt>
`mouse_pressed_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
<dt>
`mouse_released_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_double_clicked_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_wheel_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_hovered_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
<dt>
`drag_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
<dt>
`accept_drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
<dt>
`drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget accepts drops and set the callback to the drop operation.
<dt>
`computed_content_size_changed_fn
<span class="classifier">
Callable`
<dd>
<p>
Called when the size of the widget is changed.
| 6,830 |
omni.ui.set_menu_delegate.md | # set_menu_delegate
## set_menu_delegate
```python
omni.ui.set_menu_delegate(delegate: omni.ui.MenuDelegate)
```
Set the default delegate to use it when the item doesn’t have a delegate.
``` | 197 |
omni.ui.ShadowFlag.md | # ShadowFlag
## Class omni.ui.ShadowFlag
Bases: pybind11_object
Members:
- NONE
- CUT_OUT_SHAPE_BACKGROUND
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self, value)` | |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `CUT_OUT_SHAPE_BACKGROUND` | |
| `NONE` | |
| `name` | |
| `value` | |
### Method Details
#### `__init__(self, value)`
<section name="omni.ui.ShadowFlag">
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.ShadowFlag.__init__">
<em class="method object">
<span class="pre">
def
<span class="w">
<span class="n">
<span class="pre">
__init__
<span class="sig-paren">
(
<span class="sig-params">
<span class="p">
<span class="pre">
self
<span class="p">
<span class="pre">
value
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
int
<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 property">
<dt class="sig sig-object py" id="omni.ui.ShadowFlag.name">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
name
<dd>
| 1,866 |
omni.ui.Shape.md | # Shape
## Shape
The Shape widget provides a base class for all the Shape Widget. Currently implemented are Rectangle, Circle, Triangle, Line, Ellipse and BezierCurve.
### Methods
| Method | Description |
|--------|-------------|
| `__init__(*args, **kwargs)` | |
### Attributes
| Attribute | Description |
|-----------|-------------|
## `__init__(*args, **kwargs)` | 373 |
omni.ui.ShapeAnchorHelper.md | # ShapeAnchorHelper
## ShapeAnchorHelper
The ShapeAnchorHelper provides common functionality for Shape Anchors.
### Methods
- **__init__(*args, **kwargs)**
- **call_anchor_fn(self)**
Sets the function that will be called for the curve anchor.
- **get_closest_parametric_position(self, ...)**
Function that returns the closest parametric T value to a given x,y position.
- **has_anchor_fn(self)**
Sets the function that will be called for the curve anchor.
- **invalidate_anchor(self)**
Function that causes the anchor frame to be redrawn.
- **set_anchor_fn(self, fn)**
Sets the function that will be called for the curve anchor.
<p>
Sets the function that will be called for the curve anchor.
<p class="rubric">
Attributes
<table>
<colgroup>
<col style="width: 10%"/>
<col style="width: 90%"/>
<tbody>
<tr class="row-odd">
<td>
<p>
<code>anchor_alignment
<td>
<p>
This property holds the Alignment of the curve anchor.
<tr class="row-even">
<td>
<p>
<code>anchor_position
<td>
<p>
This property holds the parametric value of the curve anchor.
<dl>
<dt>
<code>__init__(*args, **kwargs)
<a href="#omni.ui.ShapeAnchorHelper.__init__" title="Permalink to this definition">
<dd>
<dl>
<dt>
<code>call_anchor_fn(self: omni.ui._ui.ShapeAnchorHelper) -> None
<a href="#omni.ui.ShapeAnchorHelper.call_anchor_fn" title="Permalink to this definition">
<dd>
<p>
Sets the function that will be called for the curve anchor.
<dl>
<dt>
<code>get_closest_parametric_position(self: omni.ui._ui.ShapeAnchorHelper, position_x: float, position_y: float) -> float
<a href="#omni.ui.ShapeAnchorHelper.get_closest_parametric_position" title="Permalink to this definition">
<dd>
<p>
Function that returns the closest parametric T value to a given x,y position.
<dl>
<dt>
<code>has_anchor_fn(self: omni.ui._ui.ShapeAnchorHelper) -> bool
<a href="#omni.ui.ShapeAnchorHelper.has_anchor_fn" title="Permalink to this definition">
<dd>
<p>
Sets the function that will be called for the curve anchor.
<dl>
<dt>
<code>invalidate_anchor(self: omni.ui._ui.ShapeAnchorHelper)
<a href="#omni.ui.ShapeAnchorHelper.invalidate_anchor" title="Permalink to this definition">
<dd>
### omni.ui.ShapeAnchorHelper.invalidate_anchor
Function that causes the anchor frame to be redrawn.
### omni.ui.ShapeAnchorHelper.set_anchor_fn
Sets the function that will be called for the curve anchor.
### omni.ui.ShapeAnchorHelper.anchor_alignment
This property holds the Alignment of the curve anchor.
### omni.ui.ShapeAnchorHelper.anchor_position
This property holds the parametric value of the curve anchor. | 2,617 |
omni.ui.SimpleBoolModel.md | # SimpleBoolModel
## SimpleBoolModel
Bases: `AbstractValueModel`
A very simple bool model.
### Methods
- `__init__(self[, default_value])`
- `get_max(self)`
- `get_min(self)`
- `set_max(self, arg0)`
- `set_min(self, arg0)`
### Attributes
- `max`
- This property holds the model's maximum value.
<table>
<tbody>
<tr class="row-even">
<td>
<p>
<code>min
<td>
<p>This property holds the model's minimum value.
<dl>
<dt>
<code>__init__(self: omni.ui._ui.SimpleBoolModel, default_value: bool = False, **kwargs)
<span>→ None
<dd>
<dl>
<dt>
<code>get_max(self: omni.ui._ui.SimpleBoolModel)
<span>→ bool
<dd>
<dl>
<dt>
<code>get_min(self: omni.ui._ui.SimpleBoolModel)
<span>→ bool
<dd>
<dl>
<dt>
<code>set_max(self: omni.ui._ui.SimpleBoolModel, arg0: bool)
<span>→ None
<dd>
<dl>
<dt>
<code>set_min(self: omni.ui._ui.SimpleBoolModel, arg0: bool)
<span>→ None
<dd>
## omni.ui.SimpleBoolModel.set_min
- **Type**: `bool`
- **Returns**: `None`
## omni.ui.SimpleBoolModel.max
- **Type**: `property`
- **Description**: This property holds the model’s maximum value.
## omni.ui.SimpleBoolModel.min
- **Type**: `property`
- **Description**: This property holds the model’s minimum value. | 1,338 |
omni.ui.SimpleFloatModel.md | # SimpleFloatModel
## SimpleFloatModel
- **Bases:** [AbstractValueModel](omni.ui.AbstractValueModel.html#omni.ui.AbstractValueModel)
- **Description:** A very simple double model.
### Methods
- `__init__(self[, default_value])`
- `get_max(self)`
- `get_min(self)`
- `set_max(self, arg0)`
- `set_min(self, arg0)`
### Attributes
- `max`
This property holds the model's minimum value.
<code>min
This property holds the model's minimum value.
<dl>
<dt>
<code>__init__(self: omni.ui._ui.SimpleFloatModel, default_value: float = 0.0, **kwargs)
<dd>
<dt>
<code>get_max(self: omni.ui._ui.SimpleFloatModel)
<dd>
<dt>
<code>get_min(self: omni.ui._ui.SimpleFloatModel)
<dd>
<dt>
<code>set_max(self: omni.ui._ui.SimpleFloatModel, arg0: float)
<dd>
<dt>
<code>set_min(self: omni.ui._ui.SimpleFloatModel, arg0: float)
<dd>
## omni.ui.SimpleFloatModel.set_min
### set_min(float) -> None
- **Description**:
## omni.ui.SimpleFloatModel.max
### property max
- **Description**: This property holds the model’s maximum value.
## omni.ui.SimpleFloatModel.min
### property min
- **Description**: This property holds the model’s minimum value. | 1,195 |
omni.ui.SimpleIntModel.md | # SimpleIntModel
## SimpleIntModel
Bases: `AbstractValueModel`
A very simple Int model.
### Methods
- `__init__(self[, default_value])`
- `get_max(self)`
- `get_min(self)`
- `set_max(self, arg0)`
- `set_min(self, arg0)`
### Attributes
- `max`
- This property holds the model's minimum value.
| Property | Description |
|----------|-------------|
| `min` | This property holds the model's minimum value. |
```python
__init__(self: omni.ui._ui.SimpleIntModel, default_value: int = 0, **kwargs) -> None
```
```python
get_max(self: omni.ui._ui.SimpleIntModel) -> int
```
```python
get_min(self: omni.ui._ui.SimpleIntModel) -> int
```
```python
set_max(self: omni.ui._ui.SimpleIntModel, arg0: int) -> None
```
```python
set_min(self: omni.ui._ui.SimpleIntModel, arg0: int) -> None
```
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.SimpleIntModel.max">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
max
<dd>
<p>
This property holds the model’s minimum value.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.SimpleIntModel.min">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
min
<dd>
<p>
This property holds the model’s minimum value.
| 1,435 |
omni.ui.SimpleStringModel.md | # SimpleStringModel
## SimpleStringModel
A very simple value model that holds a single string.
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self[, defaultValue])` | |
### Attributes
| Attribute | Description |
|-----------|-------------|
### `__init__(self, defaultValue='')`
- **Parameters**:
- **self** : `omni.ui._ui.SimpleStringModel`
- **defaultValue** : `str` = ''
- **Returns**:
- `None`
# Hello, World!
This is an example of [a link].
Here is an image: ![Description of image] | 531 |
omni.ui.SliderDrawMode.md | # SliderDrawMode
## Overview
The `SliderDrawMode` class is a part of the `omni.ui` module, inheriting from `pybind11_object`. It defines several modes for slider drawing.
### Members
- **FILLED**
- **HANDLE**
- **DRAG**
### Methods
- **__init__(self, value)**
### Attributes
- **DRAG**
- **FILLED**
- **HANDLE**
- **name**
- **value**
omni.ui._ui.SliderDrawMode(
value: int
) -> None
property name | 406 |
omni.ui.Spacer.md | # Spacer
The Spacer class provides blank space. Normally, it’s used to place other widgets correctly in a layout.
## Methods
- **__init__(self, **kwargs)**
- Construct Spacer.
## Attributes
## __init__
- **Parameters:**
- `self` : omni.ui._ui.Spacer
- `**kwargs` : dict
- **Returns:** None
Construct Spacer.
### Keyword Arguments:
- `width` : ui.Length
- This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
<dt>
`height
<span class="classifier">
ui.Length`
<dd>
<p>
This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
<dt>
`name
<span class="classifier">
str`
<dd>
<p>
The name of the widget that user can set.
<dt>
`style_type_name_override
<span class="classifier">
str`
<dd>
<p>
By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
<dt>
`identifier
<span class="classifier">
str`
<dd>
<p>
An optional identifier of the widget we can use to refer to it in queries.
<dt>
`visible
<span class="classifier">
bool`
<dd>
<p>
This property holds whether the widget is visible.
<dt>
`visibleMin
<span class="classifier">
float`
<dd>
<p>
If the current zoom factor and DPI is less than this value, the widget is not visible.
<dt>
`visibleMax
<span class="classifier">
float`
<dd>
<p>
If the current zoom factor and DPI is bigger than this value, the widget is not visible.
<dt>
`tooltip
<span class="classifier">
str`
<dd>
<p>
Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
<dt>
`tooltip_fn
<span class="classifier">
Callable`
<dd>
<p>
Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
<dt>
`tooltip_offset_x
<span class="classifier">
float`
<dd>
<p>
Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
<dt>
`tooltip_offset_y
<span class="classifier">
float`
<dd>
<p>
Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
<dt>
`enabled
<span class="classifier">
bool`
<dd>
<p>
This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
<dt>
`selected
<span class="classifier">
bool`
<dd>
<p>
This property holds a flag that specifies the widget has to use eSelected state of the style.
<dt>
`checked
<span class="classifier">
bool`
<dd>
<p>
This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
<dt>
`dragging
<span class="classifier">
bool`
<dd>
<p>
This property holds if the widget is being dragged.
<dt>
`opaque_for_mouse_events
<span class="classifier">
bool`
<dd>
<p>
If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
<dt>
`skip_draw_when_clipped
<span class="classifier">
bool`
<dd>
<p>
The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
<dt>
`mouse_moved_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
<dt>
`mouse_pressed_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
<dt>
`mouse_released_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_double_clicked_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_wheel_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_hovered_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user hovers the mouse over the widget. The function specification is the same as in setMousePressedFn. void onMouseHovered(float x, float y, carb::input::KeyboardModifierFlags modifier)
<dl>
<dt>
onMouseHovered(bool hovered)
<dd>
<p>
Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHoveredFn. void onMouseHovered(bool hovered)
<dt>
drag_fn
<span class="classifier">
Callable
<dd>
<p>
Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
<dt>
accept_drop_fn
<span class="classifier">
Callable
<dd>
<p>
Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
<dt>
drop_fn
<span class="classifier">
Callable
<dd>
<p>
Specify that this Widget accepts drops and set the callback to the drop operation.
<dt>
computed_content_size_changed_fn
<span class="classifier">
Callable
<dd>
<p>
Called when the size of the widget is changed.
| 7,149 |
omni.ui.Stack.md | # Stack
## Stack
The Stack class lines up child widgets horizontally, vertically or sorted in a Z-order.
### Methods
- **__init__(self, arg0, **kwargs)**
- Constructor.
### Attributes
- **content_clipping**
- Determines if the child widgets should be clipped by the rectangle of this Stack.
- **direction**
- This type is used to determine the direction of the layout.
- **send_mouse_events_to_back**
- When children of a Z-based stack overlap mouse events are normally sent to the topmost one.
- **spacing**
- Sets a non-stretchable space in pixels between child items of this layout.
(
self: omni.ui._ui.Stack,
arg0: omni.ui._ui.Direction,
**kwargs
) → None
### Arguments:
- `direction :`
- Determines the orientation of the Stack.
- `kwargs` dict
- See below
### Keyword Arguments:
- `direction`
- This type is used to determine the direction of the layout. If the Stack’s orientation is eLeftToRight the widgets are placed in a horizontal row, from left to right. If the Stack’s orientation is eRightToLeft the widgets are placed in a horizontal row, from right to left. If the Stack’s orientation is eTopToBottom, the widgets are placed in a vertical column, from top to bottom. If the Stack’s orientation is eBottomToTop, the widgets are placed in a vertical column, from bottom to top. If the Stack’s orientation is eBackToFront, the widgets are placed sorted in a Z-order in top right corner. If the Stack’s orientation is eFrontToBack, the widgets are placed sorted in a Z-order in top right corner, the first widget goes to front.
- `content_clipping`
- Determines if the child widgets should be clipped by the rectangle of this Stack.
- `spacing`
- Sets a non-stretchable space in pixels between child items of this layout.
- `send_mouse_events_to_back`
- When children of a Z-based stack overlap mouse events are normally sent to the topmost one. Setting this property true will invert that behavior, sending mouse events to the bottom-most child.
- `width` ui.Length
- This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
- `height` ui.Length
- This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
- `name` str
- The name of the widget that user can set.
- `style_type_name_override` str
- By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
- `identifier` str
- An optional identifier of the widget we can use to refer to it in queries.
- `visible` bool
- This property holds whether the widget is visible.
- `visibleMin` float
- If the current zoom factor and DPI is less than this value, the widget is not visible.
- `visibleMax` float
- If the current zoom factor and DPI is bigger than this value, the widget is not visible.
- `tooltip` str
- Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
- `tooltip_fn` Callable
- Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
- `tooltip_offset_x` float
- Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
- `tooltip_offset_y` float
- Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
### Properties
#### enabled
- **Type:** bool
- **Description:** This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
#### selected
- **Type:** bool
- **Description:** This property holds a flag that specifies the widget has to use eSelected state of the style.
#### checked
- **Type:** bool
- **Description:** This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
#### dragging
- **Type:** bool
- **Description:** This property holds if the widget is being dragged.
#### opaque_for_mouse_events
- **Type:** bool
- **Description:** If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
#### skip_draw_when_clipped
- **Type:** bool
- **Description:** The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
#### mouse_moved_fn
- **Type:** Callable
- **Description:** Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
#### mouse_pressed_fn
- **Type:** Callable
- **Description:** Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
#### mouse_released_fn
- **Type:** Callable
- **Description:** Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
#### mouse_double_clicked_fn
- **Type:** Callable
- **Description:** Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
#### mouse_wheel_fn
- **Type:** Callable
- **Description:** Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
#### mouse_hovered_fn
- **Type:** Callable
- **Description:** Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
#### drag_fn
- **Type:** Callable
- **Description:** Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
#### accept_drop_fn
- **Type:** Callable
- **Description:** Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
#### drop_fn
- **Type:** Callable
- **Description:** Specify that this Widget accepts drops and set the callback to the drop operation.
#### computed_content_size_changed_fn
- **Type:** Callable
- **Description:** Called when the size of the widget is changed.
### content_clipping
- **Description:** Determines if the child widgets should be clipped by the rectangle of this Stack.
### direction
- **Description:** This type is used to determine the direction of the layout. If the Stack’s orientation is eLeftToRight the widgets are placed in a horizontal row, from left to right. If the Stack’s orientation is eRightToLeft the widgets are placed in a horizontal row, from right to left. If the Stack’s orientation is eTopToBottom, the widgets are placed in a vertical column, from top to bottom. If the Stack’s orientation is eBottomToTop, the widgets are placed in a vertical column, from bottom to top. If the Stack’s orientation is eBackToFront, the widgets are placed sorted in a Z-order in top right corner. If the Stack’s orientation is eFrontToBack, the widgets are placed sorted in a Z-order in top right corner, the first widget goes to front.
### send_mouse_events_to_back
- **Description:**
## 属性说明
### omni.ui.Stack.send_mouse_events_to_back
当Z-based stack的子元素重叠时,鼠标事件通常会被发送到最顶层的子元素。设置此属性为true将反转该行为,将鼠标事件发送到最底层的子元素。
### omni.ui.Stack.spacing
设置此布局的子项之间的非可拉伸空间(以像素为单位)。 | 8,917 |
omni.ui.StringField.md | # StringField
## StringField
The StringField widget is a one-line text editor with a string model.
### Methods
| Method | Description |
| --- | --- |
| `__init__(self[, model])` | Constructs StringField. |
### Attributes
| Attribute | Description |
| --- | --- |
| `allow_tab_input` | This property holds if the field allows Tab input. |
| `multiline` | Multiline allows to press enter and create a new line. |
| `password_mode` | This property holds the password mode. |
| `read_only` | This property holds if the field is read-only. |
<dt>
Constructs StringField.
<dd>
<p>
### Arguments:
<blockquote>
<div>
<dl class="simple">
<dt>
`model :`
<dd>
<p>
The widget’s model. If the model is not assigned, the default model is created.
<dt>
`kwargs
<span class="classifier">
dict`
<dd>
<p>
See below
<p>
### Keyword Arguments:
<blockquote>
<div>
<dl class="simple">
<dt>
`password_mode
<span class="classifier">
`
<dd>
<p>
This property holds the password mode. If the field is in the password mode when the entered text is obscured.
<dt>
`read_only
<span class="classifier">
`
<dd>
<p>
This property holds if the field is read-only.
<dt>
`multiline
<span class="classifier">
`
<dd>
<p>
Multiline allows to press enter and create a new line.
<dt>
`allow_tab_input
<span class="classifier">
`
<dd>
<p>
This property holds if the field allows Tab input.
<dt>
`width
<span class="classifier">
ui.Length`
<dd>
<p>
This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
<dt>
`height
<span class="classifier">
ui.Length`
<dd>
<p>
This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
<dt>
`name
<span class="classifier">
str`
<dd>
<p>
The name of the widget that user can set.
<dt>
`style_type_name_override
<span class="classifier">
str`
<dd>
<p>
By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
<dt>
`identifier
<span class="classifier">
str`
<dd>
<p>
An optional identifier of the widget we can use to refer to it in queries.
<dt>
`visible
<span class="classifier">
bool`
<dd>
<p>
This property holds whether the widget is visible.
<dt>
`visibleMin
<span class="classifier">
float`
<dd>
<p>
If the current zoom factor and DPI is less than this value, the widget is not visible.
<dt>
`visibleMax
<span class="classifier">
float`
<dd>
<p>
If the current zoom factor and DPI is bigger than this value, the widget is not visible.
<dt>
`tooltip
<span class="classifier">
str`
<dd>
<p>
Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
<dt>
`tooltip_fn
<span class="classifier">
Callable`
<dd>
<p>
Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
<dt>
`tooltip_offset_x
<span class="classifier">
float`
<dd>
<p>
Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
<dt>
`tooltip_offset_y
<span class="classifier">
float`
<dd>
<p>
Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
<dt>
`enabled
<span class="classifier">
bool`
<dd>
<p>
This property holds whether the widget is enabled.
<dl>
<dt>enabled
<dd>
<p>This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
<dt>selected bool
<dd>
<p>This property holds a flag that specifies the widget has to use eSelected state of the style.
<dt>checked bool
<dd>
<p>This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
<dt>dragging bool
<dd>
<p>This property holds if the widget is being dragged.
<dt>opaque_for_mouse_events bool
<dd>
<p>If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
<dt>skip_draw_when_clipped bool
<dd>
<p>The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
<dt>mouse_moved_fn Callable
<dd>
<p>Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
<dt>mouse_pressed_fn Callable
<dd>
<p>Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
<dt>mouse_released_fn Callable
<dd>
<p>Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>mouse_double_clicked_fn Callable
<dd>
<p>Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>mouse_wheel_fn Callable
<dd>
<p>Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
<dt>mouse_hovered_fn Callable
<dd>
<p>Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
<dt>drag_fn Callable
<dd>
<p>Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
<dt>accept_drop_fn Callable
<dd>
<p>Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
<dt>drop_fn Callable
<dd>
<p>Specify that this Widget accepts drops and set the callback to the drop operation.
<dt>computed_content_size_changed_fn Callable
<dd>
<p>Called when the size of the widget is changed.
<dl>
<dt>allow_tab_input
<dd>
<p>This property holds if the field allows Tab input.
<dl>
<dt>multiline
<dd>
<p>Multiline allows to press enter and create a new line.
<dl>
<dt>password_mode
<dd>
<p>This property holds the password mode. If the field is in the password mode when the entered text is obscured.
<dl>
<dt>read_only
<dd>
<p>This property holds if the field is read only.
This property holds if the field is read-only. | 10,031 |
omni.ui.StringStore.md | # StringStore
## Methods
- `__init__(*args, **kwargs)`
- `find(name)`
- Return the index of the color with specific name.
- `store(name, string)`
- Save the color by name.
<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">
str
<dt class="sig sig-object py" id="omni.ui.StringStore.find">
<em class="property">
<span class="pre">
static
<span class="w">
<span class="sig-name descname">
<span class="pre">
find
<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">
str
<dd>
<p>
Return the index of the color with specific name.
<dt class="sig sig-object py" id="omni.ui.StringStore.store">
<em class="property">
<span class="pre">
static
<span class="w">
<span class="sig-name descname">
<span class="pre">
store
<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
,
<em class="sig-param">
<span class="n">
<span class="pre">
string
<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">
None
<dd>
<p>
Save the color by name.
| 2,010 |
omni.ui.Style.md | # Style
## Methods
- `__init__(*args, **kwargs)`
- `get_instance()`
- Get the instance of this singleton object.
## Attributes
- `default`
- Set the default root style.
### `__init__(*args, **kwargs)`
### `get_instance()`
### omni.ui.Style.get_instance
Get the instance of this singleton object.
### omni.ui.Style.default
property default
Set the default root style. It’s the style that is preselected when no alternative is specified. | 446 |
omni.ui.style_utils.md | # omni.ui.style_utils
## Module Overview
This document provides an overview of the `omni.ui.style_utils` module, which is part of the `omni.ui` submodules.
### Navigation
- [Home](https://docs.omniverse.nvidia.com/kit/docs)
- [API (python)](API.html)
- [Modules](Modules.html)
- [omni.ui](omni.ui.html)
- [omni.ui Submodules](omni.ui.Submodules.html)
### Module Details
#### omni.ui.style_utils
The `omni.ui.style_utils` module provides utility functions for styling components within the Omniverse Kit.
---
This documentation is part of the Omniverse Kit 2.25.15 documentation. | 587 |
omni.ui.Submodules.md | # omni.ui Submodules
## Submodules Summary
| Submodule | Description |
|-----------|-------------|
| omni.ui.abstract_shade | No submodule docstring provided |
| omni.ui.color_utils | No submodule docstring provided |
| omni.ui.constant_utils | No submodule docstring provided |
| omni.ui.extension | No submodule docstring provided |
| omni.ui.singleton | No submodule docstring provided |
| omni.ui.style_utils | No submodule docstring provided |
| omni.ui.url_utils | No submodule docstring provided |
| omni.ui.workspace_utils | The utilities to capture and restore layout | | 580 |
omni.ui.TextureFormat.md | # TextureFormat
## TextureFormat
```
class omni.ui.TextureFormat
```
Bases:
```
pybind11_object
```
Members:
- R8_UNORM
- R8_SNORM
- R8_UINT
- R8_SINT
- RG8_UNORM
- RG8_SNORM
- RG8_UINT
- RG8_SINT
- BGRA8_UNORM
- BGRA8_SRGB
- RGBA8_UNORM
- RGBA8_SNORM
- RGBA8_UINT
- RGBA8_SINT
- RGBA8_SRGB
- R16_UNORM
- R16_SNORM
- R16_UINT
- R16_SINT
- R16_SFLOAT
- RG16_UNORM
- RG16_SNORM
- RG16_UINT
- RG16_SINT
- RG16_SFLOAT
- RGBA16_UNORM
- RGBA16_SNORM
- RGBA16_UINT
- RGBA16_SINT
- RGBA16_SFLOAT
- R32_UINT
- R32_SINT
- R32_SFLOAT
- RG32_UINT
- RG32_SINT
- RG32_SFLOAT
- RGB32_UINT
- RGB32_SINT
- RGB32_SFLOAT
- RGBA32_UINT
- RGBA32_SINT
- RGBA32_SFLOAT
- R10_G10_B10_A2_UNORM
- R10_G10_B10_A2_UINT
- R11_G11_B10_UFLOAT
- R9_G9_B9_E5_UFLOAT
- B5_G6_R5_UNORM
- B5_G5_R5_A1_UNORM
- BC1_RGBA_UNORM
- BC1_RGBA_SRGB
- BC2_RGBA_UNORM
- BC2_RGBA_SRGB
- BC3_RGBA_UNORM
- BC3_RGBA_SRGB
- BC4_R_UNORM
- BC4_R_SNORM
- BC5_RG_UNORM
- BC5_RG_SNORM
- BC6H_RGB_UFLOAT
- BC6H_RGB_SFLOAT
- BC7_RGBA_UNORM
- BC7_RGBA_SRGB
- D16_UNORM
- D24_UNORM_S8_UINT
- D32_SFLOAT
- D32_SFLOAT_S8_UINT_X24
- R24_UNORM_X8
- X24_R8_UINT
- X32_R8_UINT_X24
- R32_SFLOAT_X8_X24
- SAMPLER_FEEDBACK_MIN_MIP
- SAMPLER_FEEDBACK_MIP_REGION_USED
### Methods
```
| Attribute | Description |
|-----------|-------------|
| `__init__` | (self, value) |
## Attributes
| Attribute | Description |
|-----------|-------------|
| `B5_G5_R5_A1_UNORM` | |
| `B5_G6_R5_UNORM` | |
| `BC1_RGBA_SRGB` | |
| `BC1_RGBA_UNORM` | |
| `BC2_RGBA_SRGB` | |
| `BC2_RGBA_UNORM` | |
| `BC3_RGBA_SRGB` | |
| `BC3_RGBA_UNORM` | |
| `BC4_R_SNORM` | |
| `BC4_R_UNORM` | |
| `BC5_RG_SNORM` | |
| `BC5_RG_UNORM` | |
| `BC6H_RGB_SFLOAT` | |
| `BC6H_RGB_UFLOAT` | |
| `BC7_RGBA_SRGB` | |
| `BC7_RGBA_UNORM` | |
| `BGRA8_SRGB` | |
| `BGRA8_UNORM` | |
| `D16_UNORM` | |
| `D24_UNORM_S8_UINT` | |
| `D32_SFLOAT` | |
| `D32_SFLOAT_S8_UINT_X24` | |
- **R10_G10_B10_A2_UINT**
- **R10_G10_B10_A2_UNORM**
- **R11_G11_B10_UFLOAT**
- **R16_SFLOAT**
- **R16_SINT**
- **R16_SNORM**
- **R16_UINT**
- **R16_UNORM**
- **R24_UNORM_X8**
- **R32_SFLOAT**
- **R32_SFLOAT_X8_X24**
- **R32_SINT**
- **R32_UINT**
- **R8_SINT**
- **R8_SNORM**
- **R8_UINT**
- **R8_UNORM**
- **R9_G9_B9_E5_UFLOAT**
- **RG16_SFLOAT**
- **RG16_SINT**
- **RG16_SNORM**
- **RG16_UINT**
- **RG16_UNORM**
- **RG32_SFLOAT**
- **RG32_SINT**
- **RG32_UINT**
- `RG8_SINT`
- `RG8_SNORM`
- `RG8_UINT`
- `RG8_UNORM`
- `RGB32_SFLOAT`
- `RGB32_SINT`
- `RGB32_UINT`
- `RGBA16_SFLOAT`
- `RGBA16_SINT`
- `RGBA16_SNORM`
- `RGBA16_UINT`
- `RGBA16_UNORM`
- `RGBA32_SFLOAT`
- `RGBA32_SINT`
- `RGBA32_UINT`
- `RGBA8_SINT`
- `RGBA8_SNORM`
- `RGBA8_SRGB`
- `RGBA8_UINT`
- `RGBA8_UNORM`
- `SAMPLER_FEEDBACK_MIN_MIP`
- `SAMPLER_FEEDBACK_MIP_REGION_USED`
- `X24_R8_UINT`
- `X32_R8_UINT_X24`
| name | value |
|------|-------|
| name | |
| value| |
__init__(self: omni.gpu_foundation_factory._gpu_foundation_factory.TextureFormat, value: int) -> None
property name | 2,930 |
omni.ui.ToolBar.md | # ToolBar
## ToolBar
The ToolBar class represents a window in the underlying windowing system that as some fixed size property.
### Methods
- **__init__**(self, title, **kwargs)
- Construct ToolBar.
- **set_axis_changed_fn**(self, arg0)
-
### Attributes
- **axis**
-
Construct ToolBar.
> ```
> kwargs
> dict
> ```
> See below
### Keyword Arguments:
> ```
> axis
> ui.Axis
> ```
> @brief axis for the toolbar
> ```
> axis_changed_fn
> Callable[[ui.Axis], None]
> ```
> @brief axis for the toolbar
> ```
> 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.
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<dd>
<footer>
<hr/>
| 2,555 |
omni.ui.ToolBarAxis.md | # ToolBarAxis
## Class Definition
```python
class omni.ui.ToolBarAxis(pybind11_object)
```
### Members
- X
- Y
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self, value)` | |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `X` | |
| `Y` | |
| `name` | |
| `value` | |
## `__init__` Method
```python
__init__(self, value)
<section>
<dl class="py function">
<dt class="sig sig-object py" id="omni.ui.ToolBarAxis.__init__">
<em class="function">
<span class="pre">
def
<span class="w">
<span class="n">
<span class="pre">
__init__
<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 property">
<dt class="sig sig-object py" id="omni.ui.ToolBarAxis.name">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
name
<dd>
| 1,342 |
omni.ui.ToolButton.md | # ToolButton
## ToolButton
```python
class omni.ui.ToolButton
```
Bases:
```python
Button, ValueModelHelper
```
ToolButton is functionally similar to Button, but provides a model that determines if the button is checked. This button toggles between checked (on) and unchecked (off) when the user clicks it.
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self[, model])` | Construct a checkable button with the model. |
### Attributes
| Attribute | Description |
|-----------|-------------|
```python
def __init__(self, model=None, **kwargs):
self: omni.ui._ui.ToolButton
model: omni.ui._ui.AbstractValueModel = None
<dt>
`model :`
<dd>
<p>
The model that determines if the button is checked.
<dt>
`kwargs
<span class="classifier">
dict`
<dd>
<p>
See below
<p>
### Keyword Arguments:
<blockquote>
<div>
<dl class="simple">
<dt>
`text
<span class="classifier">
str`
<dd>
<p>
This property holds the button’s text.
<dt>
`image_url
<span class="classifier">
str`
<dd>
<p>
This property holds the button’s optional image URL.
<dt>
`image_width
<span class="classifier">
float`
<dd>
<p>
This property holds the width of the image widget. Do not use this function to find the width of the image.
<dt>
`image_height
<span class="classifier">
float`
<dd>
<p>
This property holds the height of the image widget. Do not use this function to find the height of the image.
<dt>
`spacing
<span class="classifier">
float`
<dd>
<p>
Sets a non-stretchable space in points between image and text.
<dt>
`clicked_fn
<span class="classifier">
Callable[[], None]`
<dd>
<p>
Sets the function that will be called when when the button is activated (i.e., pressed down then released while the mouse cursor is inside the button).
<dt>
`width
<span class="classifier">
ui.Length`
<dd>
<p>
This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
<dt>
`height
<span class="classifier">
ui.Length`
<dd>
<p>
This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
<dt>
`name
<span class="classifier">
str`
<dd>
<p>
The name of the widget that user can set.
<dt>
`style_type_name_override
<span class="classifier">
str`
<dd>
<p>
By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
<dt>
`identifier
<span class="classifier">
str`
<dd>
<p>
An optional identifier of the widget we can use to refer to it in queries.
<dt>
`visible
<span class="classifier">
bool`
<dd>
<p>
This property holds whether the widget is visible.
<dt>
`visibleMin
<span class="classifier">
float`
<dd>
<p>
If the current zoom factor and DPI is less than this value, the widget is not visible.
<dt>
`visibleMax
<span class="classifier">
float`
<dd>
<p>
If the current zoom factor and DPI is bigger than this value, the widget is not visible.
<dt>
`tooltip
<span class="classifier">
str`
<dd>
<p>
Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
<dt>
`tooltip_fn
<span class="classifier">
Callable`
<dd>
<p>
Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
<dt>
`tooltip_offset_x
<span class="classifier">
float`
<dd>
<p>
Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
<dt>
`tooltip_offset_y
<span class="classifier">
float`
<dd>
<p>
Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
<dt>
`enabled
<span class="classifier">
bool`
<dd>
<p>
This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
<dt>
`selected
<span class="classifier">
bool`
<dd>
<p>
This property holds a flag that specifies the widget has to use eSelected state of the style.
<dt>
`checked
<span class="classifier">
bool`
<dd>
<p>
This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
<dl>
<dt>
`dragging
<span class="classifier">
bool`
<dd>
<p>
This property holds if the widget is being dragged.
<dt>
`opaque_for_mouse_events
<span class="classifier">
bool`
<dd>
<p>
If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
<dt>
`skip_draw_when_clipped
<span class="classifier">
bool`
<dd>
<p>
The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
<dt>
`mouse_moved_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
<dt>
`mouse_pressed_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
<dt>
`mouse_released_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_double_clicked_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_wheel_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_hovered_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
<dt>
`drag_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
<dt>
`accept_drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
<dt>
`drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget accepts drops and set the callback to the drop operation.
<dt>
`computed_content_size_changed_fn
<span class="classifier">
Callable`
<dd>
<p>
Called when the size of the widget is changed.
| 9,725 |
omni.ui.TreeView.md | # TreeView
## TreeView
TreeView is a widget that presents a hierarchical view of information. Each item can have a number of subitems. An indentation often visualizes this in a list. An item can be expanded to reveal subitems, if any exist, and collapsed to hide subitems.
TreeView can be used in file manager applications, where it allows the user to navigate the file system directories. They are also used to present hierarchical data, such as the scene object hierarchy.
TreeView uses a model/view pattern to manage the relationship between data and the way it is presented. The separation of functionality gives developers greater flexibility to customize the presentation of items and provides a standard interface to allow a wide range of data sources to be used with other widgets.
TreeView is responsible for the presentation of model data to the user and processing user input. To allow some flexibility in the way the data is presented, the creation of the sub-widgets is performed by the delegate. It provides the ability to customize any sub-item of TreeView.
### Methods
- `__init__(*args, **kwargs)`
- Overloaded function.
- `call_hover_changed_fn(self, arg0, arg1)`
- Set the callback that is called when the item hover status is changed.
- `call_selection_changed_fn(self, arg0)`
- Set the callback that is called when the selection is changed.
- `clear_selection(self)`
- Clear the selection.
### Methods
- **Deselects all selected items.**
- **dirty_widgets (self)**
- When called, it will make the delegate to regenerate all visible widgets the next frame.
- **extend_selection (self, item)**
- Extends the current selection selecting all the items between currently selected nodes and the given item.
- **has_hover_changed_fn (self)**
- Set the callback that is called when the item hover status is changed.
- **has_selection_changed_fn (self)**
- Set the callback that is called when the selection is changed.
- **is_expanded (self, item)**
- Returns true if the given item is expanded.
- **set_expanded (self, item, expanded, recursive)**
- Sets the given item expanded or collapsed.
- **set_hover_changed_fn (self, fn)**
- Set the callback that is called when the item hover status is changed.
- **set_selection_changed_fn (self, fn)**
- Set the callback that is called when the selection is changed.
- **toggle_selection (self, item)**
- Switches the selection state of the given item.
### Attributes
- **column_widths**
- Widths of the columns.
- **columns_resizable**
- When true, the columns can be resized with the mouse.
- **drop_between_items**
- When true, the tree nodes can be dropped between items.
- **expand_on_branch_click**
- This flag allows to prevent expanding when the user clicks the plus icon.
- **header_visible**
- This property holds if the header is shown or not.
- **keep_alive**
- This property holds if the header is shown or not.
| Property Name | Description |
|---------------|-------------|
| `keep_alive` | When true, the tree nodes are never destroyed even if they are disappeared from the model. |
| `keep_expanded` | Expand all the nodes and keep them expanded regardless their state. |
| `min_column_widths` | Minimum widths of the columns. |
| `root_expanded` | The expanded state of the root item. |
| `root_visible` | This property holds if the root is shown. |
| `selection` | Set current selection. |
### Arguments:
#### `model :`
- The given model.
#### `kwargs : dict`
- See below
### Keyword Arguments:
#### `delegate :`
- The Item delegate that generates a widget per item.
#### `header_visible :`
- This property holds if the header is shown or not.
#### `selection :`
- Set current selection.
#### `expand_on_branch_click :`
- This flag allows to prevent expanding when the user clicks the plus icon. It’s used in the case the user wants to control how the items expanded or collapsed.
#### `keep_alive :`
- When true, the tree nodes are never destroyed even if they are disappeared from the model. It’s useful for the temporary filtering if it’s necessary to display thousands of nodes.
#### `keep_expanded :`
- Expand all the nodes and keep them expanded regardless their state.
#### `drop_between_items :`
- When true, the tree nodes can be dropped between items.
#### `column_widths :`
- Widths of the columns. If not set, the width is Fraction(1).
#### `min_column_widths :`
- Minimum widths of the columns. If not set, the width is Pixel(0).
#### `columns_resizable :`
- When true, the columns can be resized with the mouse.
#### `selection_changed_fn :`
- Set the callback that is called when the selection is changed.
<dt>
`root_expanded
<span class="classifier">
`
<dd>
<p>
The expanded state of the root item. Changing this flag doesn’t make the children repopulated.
<dt>
`width
<span class="classifier">
ui.Length`
<dd>
<p>
This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
<dt>
`height
<span class="classifier">
ui.Length`
<dd>
<p>
This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
<dt>
`name
<span class="classifier">
str`
<dd>
<p>
The name of the widget that user can set.
<dt>
`style_type_name_override
<span class="classifier">
str`
<dd>
<p>
By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
<dt>
`identifier
<span class="classifier">
str`
<dd>
<p>
An optional identifier of the widget we can use to refer to it in queries.
<dt>
`visible
<span class="classifier">
bool`
<dd>
<p>
This property holds whether the widget is visible.
<dt>
`visibleMin
<span class="classifier">
float`
<dd>
<p>
If the current zoom factor and DPI is less than this value, the widget is not visible.
<dt>
`visibleMax
<span class="classifier">
float`
<dd>
<p>
If the current zoom factor and DPI is bigger than this value, the widget is not visible.
<dt>
`tooltip
<span class="classifier">
str`
<dd>
<p>
Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
<dt>
`tooltip_fn
<span class="classifier">
Callable`
<dd>
<p>
Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
<dt>
`tooltip_offset_x
<span class="classifier">
float`
<dd>
<p>
Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
<dt>
`tooltip_offset_y
<span class="classifier">
float`
<dd>
<p>
Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
<dt>
`enabled
<span class="classifier">
bool`
<dd>
<p>
This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
<dt>
`selected
<span class="classifier">
bool`
<dd>
<p>
This property holds a flag that specifies the widget has to use eSelected state of the style.
<dt>
`checked
<span class="classifier">
bool`
<dd>
<p>
This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
<dt>
`dragging
<span class="classifier">
bool`
<dd>
<p>
This property holds if the widget is being dragged.
<dt>
`opaque_for_mouse_events
<span class="classifier">
bool`
<dd>
<p>
If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
<dt>
`skip_draw_when_clipped
<span class="classifier">
bool`
<dd>
<p>
The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
<dt>
`mouse_moved_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
<dt>
`mouse_pressed_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
<dt>
`mouse_released_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_double_clicked_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dl>
<dt>
`mouse_wheel_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_hovered_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
<dt>
`drag_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
<dt>
`accept_drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
<dt>
`drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget accepts drops and set the callback to the drop operation.
<dt>
`computed_content_size_changed_fn
<span class="classifier">
Callable`
<dd>
<p>
Called when the size of the widget is changed.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.TreeView.call_hover_changed_fn">
<span class="sig-name descname">
<span class="pre">
call_hover_changed_fn
<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">
<a class="reference internal" href="#omni.ui.TreeView" title="omni.ui._ui.TreeView">
<span class="pre">
omni.ui._ui.TreeView
,
<em class="sig-param">
<span class="n">
<span class="pre">
arg0
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<a class="reference internal" href="omni.ui.AbstractItem.html#omni.ui.AbstractItem" title="omni.ui._ui.AbstractItem">
<span class="pre">
omni.ui._ui.AbstractItem
,
<em class="sig-param">
<span class="n">
<span class="pre">
arg1
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
bool
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<a class="headerlink" href="#omni.ui.TreeView.call_hover_changed_fn" title="Permalink to this definition">
<dd>
<p>
Set the callback that is called when the item hover status is changed.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.TreeView.call_selection_changed_fn">
<span class="sig-name descname">
<span class="pre">
call_selection_changed_fn
<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">
<a class="reference internal" href="#omni.ui.TreeView" title="omni.ui._ui.TreeView">
<span class="pre">
omni.ui._ui.TreeView
,
<em class="sig-param">
<span class="n">
<span class="pre">
arg0
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
List
<span class="p">
<span class="pre">
[
<a class="reference internal" href="omni.ui.AbstractItem.html#omni.ui.AbstractItem" title="omni.ui._ui.AbstractItem">
<span class="pre">
omni.ui._ui.AbstractItem
<span class="p">
<span class="pre">
]
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<a class="headerlink" href="#omni.ui.TreeView.call_selection_changed_fn" title="Permalink to this definition">
<dd>
<p>
Set the callback that is called when the selection is changed.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.TreeView.clear_selection">
<span class="sig-name descname">
<span class="pre">
clear_selection
<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">
<a class="reference internal" href="#omni.ui.TreeView" title="omni.ui._ui.TreeView">
<span class="pre">
omni.ui._ui.TreeView
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<a class="headerlink" href="#omni.ui.TreeView.clear_selection" title="Permalink to this definition">
<dd>
<p>
Deselects all selected items.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.TreeView.dirty_widgets">
<span class="sig-name descname">
### dirty_widgets(self: omni.ui._ui.TreeView) -> None
When called, it will make the delegate to regenerate all visible widgets the next frame.
### extend_selection(self: omni.ui._ui.TreeView, item: omni.ui._ui.AbstractItem) -> None
Extends the current selection selecting all the items between currently selected nodes and the given item. It’s when user does shift+click.
### has_hover_changed_fn(self: omni.ui._ui.TreeView) -> bool
Set the callback that is called when the item hover status is changed.
### has_selection_changed_fn(self: omni.ui._ui.TreeView) -> bool
Set the callback that is called when the selection is changed.
### is_expanded(self: omni.ui._ui.TreeView, item: omni.ui._ui.AbstractItem) -> bool
Returns true if the given item is expanded.
### set_expanded(self: omni.ui._ui.TreeView, item: omni.ui._ui.AbstractItem) -> None
### omni.ui.TreeView.set_expanded
```python
set_expanded(self: omni.ui._ui.TreeView, item: omni.ui._ui.AbstractItem, expanded: bool, recursive: bool) -> None
```
Sets the given item expanded or collapsed.
#### Arguments:
- `item :` The item to expand or collapse.
- `expanded :` True if it’s necessary to expand, false to collapse.
- `recursive :` True if it’s necessary to expand children.
### omni.ui.TreeView.set_hover_changed_fn
```python
set_hover_changed_fn(self: omni.ui._ui.TreeView, fn: Callable[[omni.ui._ui.AbstractItem, bool], None]) -> None
```
Set the callback that is called when the item hover status is changed.
### omni.ui.TreeView.set_selection_changed_fn
```python
set_selection_changed_fn(self: omni.ui._ui.TreeView, fn: Callable[[List[omni.ui._ui.AbstractItem]], None]) -> None
```
Set the callback that is called when the item selection status is changed.
### set_selection_changed_fn
Set the callback that is called when the selection is changed.
### toggle_selection
Switches the selection state of the given item.
### column_widths
Widths of the columns. If not set, the width is Fraction(1).
### columns_resizable
When true, the columns can be resized with the mouse.
### drop_between_items
When true, the tree nodes can be dropped between items.
### expand_on_branch_click
This flag allows to prevent expanding when the user clicks the plus icon. It’s used in the case the user wants to control how the items expanded or collapsed.
### header_visible
This property holds if the header is shown or not.
### keep_alive
When true, the tree nodes are never destroyed even if they are disappeared from the model. It’s useful for the temporary filtering if it’s necessary to display thousands of nodes.
### keep_expanded
Expand all the nodes and keep them expanded regardless their state.
### min_column_widths
Minimum widths of the columns. If not set, the width is Pixel(0).
### root_expanded
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
root_expanded
<dd>
<p>
The expanded state of the root item. Changing this flag doesn’t make the children repopulated.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.TreeView.root_visible">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
root_visible
<dd>
<p>
This property holds if the root is shown. It can be used to make a single level tree appear like a simple list.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.TreeView.selection">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
selection
<dd>
<p>
Set current selection.
<footer>
<hr/>
| 20,050 |
omni.ui.Triangle.md | # Triangle
## Triangle
The Triangle widget provides a colored triangle to display.
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self, **kwargs)` | Constructs Triangle. |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `alignment` | This property holds the alignment of the triangle when the fill policy is ePreserveAspectFit or ePreserveAspectCrop. |
#### `__init__(self, **kwargs)`
Constructs Triangle.
**Parameters:**
- `self` : `omni.ui._ui.Triangle`
- `**kwargs` : dict
**Returns:**
- `None`
See below
### Keyword Arguments:
- `alignment`
- This property holds the alignment of the triangle when the fill policy is ePreserveAspectFit or ePreserveAspectCrop. By default, the triangle is centered.
- `width` (ui.Length)
- This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
- `height` (ui.Length)
- This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
- `name` (str)
- The name of the widget that user can set.
- `style_type_name_override` (str)
- By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
- `identifier` (str)
- An optional identifier of the widget we can use to refer to it in queries.
- `visible` (bool)
- This property holds whether the widget is visible.
- `visibleMin` (float)
- If the current zoom factor and DPI is less than this value, the widget is not visible.
- `visibleMax` (float)
- If the current zoom factor and DPI is bigger than this value, the widget is not visible.
- `tooltip` (str)
- Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
- `tooltip_fn` (Callable)
- Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
- `tooltip_offset_x` (float)
- Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
- `tooltip_offset_y` (float)
- Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
- `enabled` (bool)
- This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
- `selected` (bool)
- This property holds a flag that specifies the widget has to use eSelected state of the style.
- `checked` (bool)
- This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
- `dragging` (bool)
- This property holds if the widget is being dragged.
- `opaque_for_mouse_events` (bool)
- If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
- `skip_draw_when_clipped` (bool)
- The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
- `mouse_moved_fn` (Callable)
- Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
- `mouse_pressed_fn` (Callable)
- Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
- `mouse_released_fn` (Callable)
- Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
- `mouse_double_clicked_fn` (Callable)
- Sets the function that will be called when the user double clicks the mouse button inside the widget.
<dl>
<dt>
`onMouseDoubleClicked`
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_wheel_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
<dt>
`mouse_hovered_fn
<span class="classifier">
Callable`
<dd>
<p>
Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
<dt>
`drag_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
<dt>
`accept_drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
<dt>
`drop_fn
<span class="classifier">
Callable`
<dd>
<p>
Specify that this Widget accepts drops and set the callback to the drop operation.
<dt>
`computed_content_size_changed_fn
<span class="classifier">
Callable`
<dd>
<p>
Called when the size of the widget is changed.
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.Triangle.alignment">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
alignment
<a class="headerlink" href="#omni.ui.Triangle.alignment" title="Permalink to this definition">
<dd>
<p>
This property holds the alignment of the triangle when the fill policy is ePreserveAspectFit or ePreserveAspectCrop. By default, the triangle is centered.
| 7,322 |
omni.ui.UIPreferencesExtension.md | # UIPreferencesExtension
## UIPreferencesExtension
```python
class omni.ui.UIPreferencesExtension(IExt)
```
**Methods**
| Method | Description |
|--------------|-------------|
| `on_shutdown()` | |
| `on_startup(ext_id)` | |
```python
def __init__(self: omni.ext._extensions.IExt) -> None:
pass
```
``` | 337 |
omni.ui.UnitType.md | # UnitType
## Overview
Unit types.
Widths, heights or other UI length can be specified in pixels or relative to window (or child window) size.
### Members
- PIXEL
- PERCENT
- FRACTION
## Methods
- `__init__(self, value)`
## Attributes
- `FRACTION`
- `PERCENT`
- `PIXEL`
- `name`
- `value`
<span class="pre">
self
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
omni.ui._ui.UnitType
,
<em class="sig-param">
<span class="n">
<span class="pre">
value
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
int
<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 property">
<dt class="sig sig-object py" id="omni.ui.UnitType.name">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
name
<dd>
<footer>
<hr/>
| 1,008 |
omni.ui.url_utils.Classes.md | # omni.ui.url_utils Classes
## Classes Summary
- **AbstractShade**
- The implementation of shades for custom style parameter type.
- **StringShade**
- | 156 |
omni.ui.url_utils.Functions.md | # omni.ui.url_utils Functions
## Functions Summary:
| Function | Description |
|----------|-------------|
| [Singleton](#) | A singleton decorator | | 150 |
omni.ui.url_utils.md | # omni.ui.url_utils
## Classes Summary
- **AbstractShade**
- The implementation of shades for custom style parameter type.
- **StringShade**
## Functions Summary
- **Singleton**
- A singleton decorator | 209 |
omni.ui.ValueModelHelper.md | # ValueModelHelper
The ValueModelHelper class provides the basic functionality for value widget classes. ValueModelHelper class is the base class for every standard widget that uses a AbstractValueModel. ValueModelHelper is an abstract class and itself cannot be instantiated. It provides a standard interface for interoperating with models.
## Methods
- `__init__(*args, **kwargs)`
## Attributes
- `model`
## `__init__(*args, **kwargs)` | 443 |
omni.ui.VectorImageProvider.md | # VectorImageProvider
## VectorImageProvider
```python
class omni.ui.VectorImageProvider
```
Bases: `ImageProvider`
doc
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self[, source_url])` | doc |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `max_mip_levels` | Maximum number of mip map levels allowed |
| `source_url` | Sets the vector image URL. |
```python
def __init__(self, source_url: str):
# Implementation details
```
<dl class="py function">
<dt class="sig sig-object py" id="omni.ui.VectorImageProvider.__init__">
<em class="sig-param">
<span class="o">
<span class="o">
<span class="pre">
=
<span class="w">
<span class="default_value">
<span class="pre">
None
,
<em class="sig-param">
<span class="o">
<span class="pre">
**
<span class="n">
<span class="pre">
kwargs
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<dd>
<p>
doc
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.VectorImageProvider.max_mip_levels">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
max_mip_levels
<dd>
<p>
Maximum number of mip map levels allowed
<dl class="py property">
<dt class="sig sig-object py" id="omni.ui.VectorImageProvider.source_url">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
source_url
<dd>
<p>
Sets the vector image URL. Asset loading doesn’t happen immediately, but rather is started the next time widget is visible, in prepareDraw call.
<footer>
<hr/>
| 1,723 |
omni.ui.VGrid.md | # VGrid
## VGrid
Bases: [Grid](omni.ui.Grid.html#omni.ui.Grid)
Shortcut for Grid{eTopToBottom}. The grid grows from top to bottom with the widgets placed.
### Methods
| Method | Description |
|--------|-------------|
| `__init__` (self, **kwargs) | Construct a grid that grows from top to bottom with the widgets placed. |
### Attributes
| Attribute | Description |
|-----------|-------------|
### `__init__` (self, **kwargs)
Construct a grid that grows from top to bottom with the widgets placed.
#### Keyword Arguments:
| Argument | Description |
|----------|-------------|
| `column_width` | The width of the column. It’s only possible to set it if the grid is vertical. Once it’s set, the column count depends on the size of the widget. |
<dt>
`row_height`
<dd>
<p>
The height of the row. It’s only possible to set it if the grid is horizontal. Once it’s set, the row count depends on the size of the widget.
<dt>
`column_count`
<dd>
<p>
The number of columns. It’s only possible to set it if the grid is vertical. Once it’s set, the column width depends on the widget size.
<dt>
`row_count`
<dd>
<p>
The number of rows. It’s only possible to set it if the grid is horizontal. Once it’s set, the row height depends on the widget size.
<dt>
`direction`
<dd>
<p>
This type is used to determine the direction of the layout. If the Stack’s orientation is eLeftToRight the widgets are placed in a horizontal row, from left to right. If the Stack’s orientation is eRightToLeft the widgets are placed in a horizontal row, from right to left. If the Stack’s orientation is eTopToBottom, the widgets are placed in a vertical column, from top to bottom. If the Stack’s orientation is eBottomToTop, the widgets are placed in a vertical column, from bottom to top. If the Stack’s orientation is eBackToFront, the widgets are placed sorted in a Z-order in top right corner. If the Stack’s orientation is eFrontToBack, the widgets are placed sorted in a Z-order in top right corner, the first widget goes to front.
<dt>
`content_clipping`
<dd>
<p>
Determines if the child widgets should be clipped by the rectangle of this Stack.
<dt>
`spacing`
<dd>
<p>
Sets a non-stretchable space in pixels between child items of this layout.
<dt>
`send_mouse_events_to_back`
<dd>
<p>
When children of a Z-based stack overlap mouse events are normally sent to the topmost one. Setting this property true will invert that behavior, sending mouse events to the bottom-most child.
<dt>
`width`
ui.Length
<dd>
<p>
This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.
<dt>
`height`
ui.Length
<dd>
<p>
This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
<dt>
`name`
str
<dd>
<p>
The name of the widget that user can set.
<dt>
`style_type_name_override`
str
<dd>
<p>
By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
<dt>
`identifier`
str
<dd>
<p>
An optional identifier of the widget we can use to refer to it in queries.
<dt>
`visible`
bool
<dd>
<p>
This property holds whether the widget is visible.
<dt>
`visibleMin`
float
<dd>
<p>
If the current zoom factor and DPI is less than this value, the widget is not visible.
<dt>
`visibleMax`
float
<dd>
<p>
If the current zoom factor and DPI is bigger than this value, the widget is not visible.
<dt>
`tooltip`
str
<dd>
<p>
Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
<dt>
`tooltip_fn`
Callable
<dd>
<p>
Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
<dt>
`tooltip_offset_x`
float
<dd>
<p>
Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
<dt>
`tooltip_offset_y`
float
<dd>
<p>
Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
<dt>
`enabled`
bool
<dd>
<p>
This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
<dt>
`selected`
bool
<dd>
<p>
This property holds a flag that specifies the widget has to use eSelected state of the style.
<dt>
`checked`
bool
<dd>
<p>
This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
<dt>
`dragging`
bool
<dd>
<p>
This property holds if the widget is being dragged.
<dt>
`opaque_for_mouse_events`
- `skip_draw_when_clipped bool`
- If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either.
- The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
- `mouse_moved_fn Callable`
- Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
- `mouse_pressed_fn Callable`
- Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
- `mouse_released_fn Callable`
- Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
- `mouse_double_clicked_fn Callable`
- Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
- `mouse_wheel_fn Callable`
- Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
- `mouse_hovered_fn Callable`
- Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
- `drag_fn Callable`
- Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
- `accept_drop_fn Callable`
- Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
- `drop_fn Callable`
- Specify that this Widget accepts drops and set the callback to the drop operation.
- `computed_content_size_changed_fn Callable`
- Called when the size of the widget is changed. | 7,981 |
omni.ui.Widget.md | # Widget
## omni.ui.Widget
The Widget class is the base class of all user interface objects.
The widget is the atom of the user interface: it receives mouse, keyboard and other events, and paints a representation of itself on the screen. Every widget is rectangular. A widget is clipped by its parent and by the widgets in front of it.
### Methods
- **__init__(self, **kwargs)**
- **call_accept_drop_fn(self, arg0)**
Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
- **call_computed_content_size_changed_fn(self)**
Called when the size of the widget is changed.
- **call_drag_fn(self)**
Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
- **call_drop_fn(self, arg0)**
Specify that this Widget accepts drops and set the callback to the drop operation.
- **call_key_pressed_fn(self, arg0)**
Specify that this Widget can handle key presses and set the callback for key press events.
- `call_key_pressed_fn(self, arg0, arg1, arg2)`
- Sets the function that will be called when the user presses the keyboard key when the mouse clicks the widget.
- `call_mouse_double_clicked_fn(self, arg0, ...)`
- Sets the function that will be called when the user presses the mouse button twice inside the widget.
- `call_mouse_hovered_fn(self, arg0)`
- Sets the function that will be called when the user use mouse enter/leave on the focused window.
- `call_mouse_moved_fn(self, arg0, arg1, arg2, arg3)`
- Sets the function that will be called when the user moves the mouse inside the widget.
- `call_mouse_pressed_fn(self, arg0, arg1, ...)`
- Sets the function that will be called when the user presses the mouse button inside the widget.
- `call_mouse_released_fn(self, arg0, arg1, ...)`
- Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget.
- `call_mouse_wheel_fn(self, arg0, arg1, arg2)`
- Sets the function that will be called when the user uses mouse wheel on the focused window.
- `call_tooltip_fn(self)`
- Set dynamic tooltip that will be created dynamically the first time it is needed.
- `destroy(self)`
- Removes all the callbacks and circular references.
- `has_accept_drop_fn(self)`
- Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
- `has_computed_content_size_changed_fn(self)`
- Called when the size of the widget is changed.
- `has_drag_fn(self)`
- Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
- `has_drop_fn(self)`
- Specify that this Widget accepts drops and set the callback to the drop operation.
- `has_key_pressed_fn(self)`
- Sets the function that will be called when the user presses the keyboard key when the mouse clicks the widget.
- `has_mouse_double_clicked_fn(self)`
- Sets the function that will be called when the user presses the mouse button twice inside the widget.
| Function Name | Description |
|---------------|-------------|
| has_mouse_hovered_fn (self) | Sets the function that will be called when the user use mouse enter/leave on the focused window. |
| has_mouse_moved_fn (self) | Sets the function that will be called when the user moves the mouse inside the widget. |
| has_mouse_pressed_fn (self) | Sets the function that will be called when the user presses the mouse button inside the widget. |
| has_mouse_released_fn (self) | Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. |
| has_mouse_wheel_fn (self) | Sets the function that will be called when the user uses mouse wheel on the focused window. |
| has_tooltip_fn (self) | Set dynamic tooltip that will be created dynamically the first time it is needed. |
| scroll_here (self[, center_ratio_x, ...]) | Adjust scrolling amount in two axes to make current item visible. |
| scroll_here_x (self[, center_ratio]) | Adjust scrolling amount to make current item visible. |
| scroll_here_y (self[, center_ratio]) | Adjust scrolling amount to make current item visible. |
| set_accept_drop_fn (self, fn) | Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted. |
| set_checked_changed_fn (self, fn) | This property holds a flag that specifies the widget has to use eChecked state of the style. |
| set_computed_content_size_changed_fn (self, fn) | Called when the size of the widget is changed. |
| set_drag_fn (self, fn) | Specify that this Widget is draggable, and set the callback that is attached to the drag operation. |
| set_drop_fn (self, fn) | Specify that this Widget accepts drops and set the callback to the drop operation. |
| 方法 | 描述 |
| --- | --- |
| `set_key_pressed_fn(self, fn)` | Sets the function that will be called when the user presses the keyboard key when the mouse clicks the widget. |
| `set_mouse_double_clicked_fn(self, fn)` | Sets the function that will be called when the user presses the mouse button twice inside the widget. |
| `set_mouse_hovered_fn(self, fn)` | Sets the function that will be called when the user use mouse enter/leave on the focused window. |
| `set_mouse_moved_fn(self, fn)` | Sets the function that will be called when the user moves the mouse inside the widget. |
| `set_mouse_pressed_fn(self, fn)` | Sets the function that will be called when the user presses the mouse button inside the widget. |
| `set_mouse_released_fn(self, fn)` | Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. |
| `set_mouse_wheel_fn(self, fn)` | Sets the function that will be called when the user uses mouse wheel on the focused window. |
| `set_style(self, arg0)` | Set the current style. |
| `set_tooltip(self, tooltip_label)` | Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style. |
| `set_tooltip_fn(self, fn)` | Set dynamic tooltip that will be created dynamically the first time it is needed. |
### Attributes
| 属性 | 描述 |
| --- | --- |
| `FLAG_WANT_CAPTURE_KEYBOARD` | |
| `checked` | This property holds a flag that specifies the widget has to use eChecked state of the style. |
| `computed_content_height` | Returns the final computed height of the content of the widget. |
| `computed_content_width` | Returns the final computed width of the content of the widget. |
| `computed_height` | Returns the final computed height of the widget. |
- **computed_height**
- Returns the final computed height of the widget.
- **computed_width**
- Returns the final computed width of the widget.
- **dragging**
- This property holds if the widget is being dragged.
- **enabled**
- This property holds whether the widget is enabled.
- **height**
- This property holds the height of the widget relative to its parent.
- **identifier**
- An optional identifier of the widget we can use to refer to it in queries.
- **name**
- The name of the widget that user can set.
- **opaque_for_mouse_events**
- If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don't get routed to the child widgets either
- **screen_position_x**
- Returns the X Screen coordinate the widget was last draw.
- **screen_position_y**
- Returns the Y Screen coordinate the widget was last draw.
- **scroll_only_window_hovered**
- When it's false, the scroll callback is called even if other window is hovered.
- **selected**
- This property holds a flag that specifies the widget has to use eSelected state of the style.
- **skip_draw_when_clipped**
- The flag that specifies if it's necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame.
- **style**
- The local style.
- **style_type_name_override**
- By default, we use typeName to look up the style.
- **tooltip**
- Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
- **tooltip_offset_x**
- (No description provided)
<code class="xref py py-obj docutils literal notranslate">
<span class="pre">
tooltip_offset_x
<td>
<p>
Set the X tooltip offset in points.
<tr class="row-even">
<td>
<p>
<a class="reference internal" href="#omni.ui.Widget.tooltip_offset_y" title="omni.ui.Widget.tooltip_offset_y">
<code class="xref py py-obj docutils literal notranslate">
<span class="pre">
tooltip_offset_y
<td>
<p>
Set the Y tooltip offset in points.
<tr class="row-odd">
<td>
<p>
<a class="reference internal" href="#omni.ui.Widget.visible" title="omni.ui.Widget.visible">
<code class="xref py py-obj docutils literal notranslate">
<span class="pre">
visible
<td>
<p>
This property holds whether the widget is visible.
<tr class="row-even">
<td>
<p>
<a class="reference internal" href="#omni.ui.Widget.visible_max" title="omni.ui.Widget.visible_max">
<code class="xref py py-obj docutils literal notranslate">
<span class="pre">
visible_max
<td>
<p>
If the current zoom factor and DPI is bigger than this value, the widget is not visible.
<tr class="row-odd">
<td>
<p>
<a class="reference internal" href="#omni.ui.Widget.visible_min" title="omni.ui.Widget.visible_min">
<code class="xref py py-obj docutils literal notranslate">
<span class="pre">
visible_min
<td>
<p>
If the current zoom factor and DPI is less than this value, the widget is not visible.
<tr class="row-even">
<td>
<p>
<a class="reference internal" href="#omni.ui.Widget.width" title="omni.ui.Widget.width">
<code class="xref py py-obj docutils literal notranslate">
<span class="pre">
width
<td>
<p>
This property holds the width of the widget relative to its parent.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.Widget.__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">
<a class="reference internal" href="#omni.ui.Widget" title="omni.ui._ui.Widget">
<span class="pre">
omni.ui._ui.Widget
,
<em class="sig-param">
<span class="o">
<span class="pre">
**
<span class="n">
<span class="pre">
kwargs
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<a class="headerlink" href="#omni.ui.Widget.__init__" title="Permalink to this definition">
<dd>
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.Widget.call_accept_drop_fn">
<span class="sig-name descname">
<span class="pre">
call_accept_drop_fn
<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">
<a class="reference internal" href="#omni.ui.Widget" title="omni.ui._ui.Widget">
<span class="pre">
omni.ui._ui.Widget
,
<em class="sig-param">
<span class="n">
<span class="pre">
arg0
<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">
bool
<a class="headerlink" href="#omni.ui.Widget.call_accept_drop_fn" title="Permalink to this definition">
<dd>
<p>
Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.Widget.call_computed_content_size_changed_fn">
<span class="sig-name descname">
<span class="pre">
call_computed_content_size_changed_fn
<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">
<a class="reference internal" href="#omni.ui.Widget" title="omni.ui._ui.Widget">
<span class="pre">
omni.ui._ui.Widget
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<a class="headerlink" href="#omni.ui.Widget.call_computed_content_size_changed_fn" title="Permalink to this definition">
<dd>
<p>
Called when the size of the widget is changed.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.Widget.call_drag_fn">
<span class="sig-name descname">
<span class="pre">
call_drag_fn
<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">
<a class="reference internal" href="#omni.ui.Widget" title="omni.ui._ui.Widget">
<span class="pre">
omni.ui._ui.Widget
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<a class="headerlink" href="#omni.ui.Widget.call_drag_fn" title="Permalink to this definition">
<dd>
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.Widget.call_drag_fn">
<span class="sig-name descname">
<span class="pre">
call_drag_fn
<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">
<a class="reference internal" href="#omni.ui.Widget" title="omni.ui._ui.Widget">
<span class="pre">
omni.ui._ui.Widget
,
<em class="sig-param">
<span class="n">
<span class="pre">
fn
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
Callable[[omni.ui._ui.Widget, omni.ui._ui.WidgetDragEvent], None]
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
str
<dd>
<p>
Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.Widget.call_drop_fn">
<span class="sig-name descname">
<span class="pre">
call_drop_fn
<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">
<a class="reference internal" href="#omni.ui.Widget" title="omni.ui._ui.Widget">
<span class="pre">
omni.ui._ui.Widget
,
<em class="sig-param">
<span class="n">
<span class="pre">
arg0
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
omni.ui._ui.WidgetMouseDropEvent
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<dd>
<p>
Specify that this Widget accepts drops and set the callback to the drop operation.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.Widget.call_key_pressed_fn">
<span class="sig-name descname">
<span class="pre">
call_key_pressed_fn
<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">
<a class="reference internal" href="#omni.ui.Widget" title="omni.ui._ui.Widget">
<span class="pre">
omni.ui._ui.Widget
,
<em class="sig-param">
<span class="n">
<span class="pre">
arg0
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
int
,
<em class="sig-param">
<span class="n">
<span class="pre">
arg1
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
int
,
<em class="sig-param">
<span class="n">
<span class="pre">
arg2
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
bool
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<dd>
<p>
Sets the function that will be called when the user presses the keyboard key when the mouse clicks the widget.
<dl class="py method">
<dt class="sig sig-object py" id="omni.ui.Widget.call_mouse_double_clicked_fn">
<span class="sig-name descname">
<span class="pre">
call_mouse_double_clicked_fn
<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">
<a class="reference internal" href="#omni.ui.Widget" title="omni.ui._ui.Widget">
<span class="pre">
omni.ui._ui.Widget
,
<em class="sig-param">
<span class="n">
<span class="pre">
arg0
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
float
,
<em class="sig-param">
<span class="n">
<span class="pre">
arg1
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
float
,
<em class="sig-param">
<span class="n">
<span class="pre">
arg2
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
int
,
<em class="sig-param">
<span class="n">
<span class="pre">
arg3
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
int
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
→
<span class="sig-return-typehint">
<span class="pre">
None
<dd>
<p>
Sets the function that will be called when the user double clicks the mouse on the widget.
### omni.ui.Widget.call_mouse_double_clicked_fn
Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
### omni.ui.Widget.call_mouse_hovered_fn
Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
### omni.ui.Widget.call_mouse_moved_fn
Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
### omni.ui.Widget.call_mouse_pressed_fn
Sets the function that will be called when the user presses the mouse button inside the widget. void onMousePressed(float x, float y, int32_t button, int modifier)
Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
Set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.
### destroy
- **Parameters**:
- `self` : omni.ui._ui.Widget
- **Returns**: `None`
- **Description**: Removes all the callbacks and circular references.
### has_accept_drop_fn
- **Parameters**:
- `self` : omni.ui._ui.Widget
- **Returns**: `bool`
- **Description**: Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
### has_computed_content_size_changed_fn
- **Parameters**:
- `self` : omni.ui._ui.Widget
- **Returns**: `bool`
- **Description**: Called when the size of the widget is changed.
### has_drag_fn
- **Parameters**:
- `self` : omni.ui._ui.Widget
- **Returns**: `bool`
- **Description**: Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
### has_drop_fn
- **Parameters**:
- `self` : omni.ui._ui.Widget
- **Returns**: `bool`
- **Description**: Specify that this Widget accepts drops and set the callback to the drop operation.
### has_key_pressed_fn
- **Parameters**:
- `self` : omni.ui._ui.Widget
- **Returns**: `bool`
- **Description**: Sets the function that will be called when the user presses the keyboard key when the mouse clicks the widget.
### has_mouse_double_clicked_fn
```python
has_mouse_double_clicked_fn(self: omni.ui._ui.Widget) -> bool
```
Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. `void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)`
### has_mouse_hovered_fn
```python
has_mouse_hovered_fn(self: omni.ui._ui.Widget) -> bool
```
Sets the function that will be called when the user uses mouse enter/leave on the focused window. The function specification is the same as in setMouseHoveredFn. `void onMouseHovered(bool hovered)`
### has_mouse_moved_fn
```python
has_mouse_moved_fn(self: omni.ui._ui.Widget) -> bool
```
Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. `void onMouseMoved(float x, float y, int32_t modifier)`
### has_mouse_pressed_fn
```python
has_mouse_pressed_fn(self: omni.ui._ui.Widget) -> bool
```
Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: `void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)` Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
### has_mouse_released_fn
```python
has_mouse_released_fn(self: omni.ui._ui.Widget) -> bool
```
Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. `void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)`
### has_mouse_wheel_fn
```python
has_mouse_wheel_fn(self: omni.ui._ui.Widget) -> bool
```
Sets the function that will be called when the user uses the mouse wheel. The function specification is the same as in setMouseWheelFn. `void onMouseWheel(float x, float y, int32_t modifier)`
### omni.ui.Widget.has_mouse_wheel_fn
Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
### omni.ui.Widget.has_tooltip_fn
Set dynamic tooltip that will be created dynamically the first time it is needed. The function is called inside a ui.Frame scope that the widget will be parented correctly.
### omni.ui.Widget.scroll_here
Adjust scrolling amount in two axes to make current item visible.
#### Arguments:
- `centerRatioX :`
- 0.0: left, 0.5: center, 1.0: right
- `centerRatioY :`
- 0.0: top, 0.5: center, 1.0: bottom
### omni.ui.Widget.scroll_here_x
Adjust scrolling amount to make current item visible.
#### Arguments:
- `centerRatio :`
- 0.0: left, 0.5: center, 1.0: right
## omni.ui.Widget.scroll_here_y
```
```python
scroll_here_y(self: omni.ui._ui.Widget, center_ratio: float = 0.0) -> None
```
- **Description**: Adjust scrolling amount to make current item visible.
- **Arguments**:
- `centerRatio :`
- 0.0: top, 0.5: center, 1.0: bottom
## omni.ui.Widget.set_accept_drop_fn
```python
set_accept_drop_fn(self: omni.ui._ui.Widget, fn: Callable[[str], bool]) -> None
```
- **Description**: Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.
## omni.ui.Widget.set_checked_changed_fn
```python
set_checked_changed_fn(self: omni.ui._ui.Widget, fn: Callable[[bool], None]) -> None
```
- **Description**: This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
:
omni.ui._ui.Widget
fn: Callable[[], None]
)
→ None
Called when the size of the widget is changed.
set_drag_fn(self: omni.ui._ui.Widget, fn: Callable[[], str])
→ None
Specify that this Widget is draggable, and set the callback that is attached to the drag operation.
set_drop_fn(self: omni.ui._ui.Widget, fn: Callable[[omni.ui._ui.WidgetMouseDropEvent], None])
→ None
Specify that this Widget accepts drops and set the callback to the drop operation.
set_key_pressed_fn(self: omni.ui._ui.Widget, fn: Callable[[], None])
→ None
### set_key_pressed_fn
Sets the function that will be called when the user presses the keyboard key when the mouse clicks the widget.
### set_mouse_double_clicked_fn
Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
### set_mouse_hovered_fn
Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)
### set_mouse_moved_fn
### set_mouse_moved_fn
```python
set_mouse_moved_fn(self: omni.ui._ui.Widget, fn: Callable[[float, float, int, bool], None]) -> None
```
Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)
### set_mouse_pressed_fn
```python
set_mouse_pressed_fn(self: omni.ui._ui.Widget, fn: Callable[[float, float, int, int], None]) -> None
```
Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
### set_mouse_released_fn
```python
set_mouse_released_fn(self: omni.ui._ui.Widget, fn: Callable[[float, float, int, int], None]) -> None
```
Sets the function that will be called when the user releases the mouse button inside the widget. The function should be like this: void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.
### omni.ui.Widget.set_mouse_released_fn
Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)
### omni.ui.Widget.set_mouse_wheel_fn
Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)
### omni.ui.Widget.set_style
Set the current style. The style contains a description of customizations to the widget’s style.
### omni.ui.Widget.set_tooltip
Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
## set_tooltip_fn
```python
set_tooltip_fn(self: omni.ui._ui.Widget, fn: Callable[[], None]) -> None
```
Set dynamic tooltip that will be created dynamically the first time it is needed. The function is called inside a ui.Frame scope that the widget will be parented correctly.
## checked
```python
property checked
```
This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.
## computed_content_height
```python
property computed_content_height
```
Returns the final computed height of the content of the widget. It’s in public section. For the explanation why please see the draw() method.
## computed_content_width
```python
property computed_content_width
```
Returns the final computed width of the content of the widget. It’s in public section. For the explanation why please see the draw() method.
## computed_height
```python
property computed_height
```
Returns the final computed height of the widget. It includes margins. It’s in public section. For the explanation why please see the draw() method.
## computed_width
```python
property computed_width
```
Returns the final computed width of the widget. It includes margins. It’s in public section. For the explanation why please see the draw() method.
## dragging
```python
property dragging
```
This property holds if the widget is being dragged.
## enabled
```python
property enabled
```
This property holds whether the widget is enabled. In general, an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.
## height
```python
property height
```
This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.
### identifier
An optional identifier of the widget we can use to refer to it in queries.
### name
The name of the widget that user can set.
### opaque_for_mouse_events
If the widgets has callback functions it will by default not capture the events if it is the top most widget and setup this option to true, so they don’t get routed to the child widgets either
### screen_position_x
Returns the X Screen coordinate the widget was last draw. This is in Screen Pixel size.
It’s a float because we need negative numbers and precise position considering DPI scale factor.
### screen_position_y
Returns the Y Screen coordinate the widget was last draw. This is in Screen Pixel size.
It’s a float because we need negative numbers and precise position considering DPI scale factor.
### scroll_only_window_hovered
When it’s false, the scroll callback is called even if other window is hovered.
### selected
This property holds a flag that specifies the widget has to use eSelected state of the style.
### skip_draw_when_clipped
The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.
### style
The local style. When the user calls setStyle()
### style_type_name_override
By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget is a part of another widget. (Label is a part of Button) This property can override the name to use in style.
### tooltip
Set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style
### tooltip_offset_x
Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
## Property: tooltip_offset_y
Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.
## Property: visible
This property holds whether the widget is visible.
## Property: visible_max
If the current zoom factor and DPI is bigger than this value, the widget is not visible.
## Property: visible_min
If the current zoom factor and DPI is less than this value, the widget is not visible.
## Property: width
This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen. | 35,006 |