omni.ui module

Omni::UI

Omni::UI is Omniverse’s UI toolkit for creating beautiful and flexible graphical user interfaces in the Kit extensions. Omni::UI provides the basic types necessary to create rich extensions with a fluid and dynamic user interface in Omniverse Kit. It gives a layout system and includes widgets for creating visual components, receiving user input, and creating data models. It allows ser interface components to be built around their behavior and enables a declarative flavor of describing the layout of the application. Omni::UI gives a very flexible styling system that allows deep customizing the final look of the application.

Typical Example

Typical example to create a window with two buttons:

import omni.ui as ui

_window_example = ui.Window("Example Window", width=300, height=300)

with _window_example.frame:
    with ui.VStack():
        ui.Button("click me")

        def move_me(window):
            window.setPosition(200, 200)

        def size_me(window):
            window.width = 300
            window.height = 300

        ui.Button("Move to (200,200)", clicked_fn=lambda w=self._window_example: move_me(w))
        ui.Button("Set size (300,300)", clicked_fn=lambda w=self._window_example: size_me(w))

Detailed Documentation

Omni::UI is shipped with the developer documentation that is written with Omni::UI. For detailed documentation, please see omni.example.ui extension. It has detailed descriptions of all the classes, best practices, and real-world usage examples.

Widgets

class omni.ui.AbstractField

Bases: omni.ui._ui.Widget, omni.ui._ui.ValueModelHelper

The abstract widget that is base for any field, which is a one-line text editor. A field allows the user to enter and edit a single line of plain text. It’s implemented using the model-view pattern and uses AbstractValueModel as the central component of the system.

Keyword Args:

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 as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

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 fallow 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 event if is the top most widget setup this options to true to enable you to capture the events so they don’t also get routed to the bellow widgets

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)

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)

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)

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)

drag_fn: Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

accept_drop_fn: 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: Specify that this Widget accepts drops and set the callback to the drop operation.

focus_keyboard(self: omni.ui._ui.AbstractField, focus: bool = True)None

focus

class omni.ui.AbstractItem(self: omni.ui._ui.AbstractItem)None

Bases: pybind11_builtins.pybind11_object

The object that is associated with the data entity of the AbstractItemModel.

class omni.ui.AbstractItemDelegate(self: omni.ui._ui.AbstractItemDelegate)None

Bases: pybind11_builtins.pybind11_object

build_branch(self: omni.ui._ui.AbstractItemDelegate, model: omni.ui._ui.AbstractItemModel, item: omni.ui._ui.AbstractItem = None, column_id: int = 0, level: int = 0, expanded: bool = False)None
build_header(self: omni.ui._ui.AbstractItemDelegate, column_id: int = 0)None
build_widget(self: omni.ui._ui.AbstractItemDelegate, model: omni.ui._ui.AbstractItemModel, item: omni.ui._ui.AbstractItem = None, index: int = 0, level: int = 0, expanded: bool = False)None
class omni.ui.AbstractItemModel(self: omni.ui._ui.AbstractItemModel)None

Bases: pybind11_builtins.pybind11_object

The central component of the item widget. It is the application’s dynamic data structure, independent of the user interface, and it directly manages the nested data. It follows closely model–view pattern. It’s abstract, and it defines the standard interface to be able to interoperate with the components of the model-view architecture. It is not supposed to be instantiated directly. Instead, the user should subclass it to create a new model. # Data is inside the model (cache) * # Data is outside the model (mirror) |----------------------------| * |-------------------| | AbstractItemModel | * | AbstractItemModel | | |------- Data -------|| * | | |----- Data -----| | | |- Item1 || <– AbstractItem * | | – AbstractItem –>| |- Item1 | | | | |- SubItem1 || <– AbstractItem * | | – AbstractItem –>| | |- Sub1 | | | | | |- SubSubItem1|| <– AbstractItem * | | – AbstractItem –>| | | |- SubSub1| | | | | |- SubSubItem2|| <– AbstractItem * | | – AbstractItem –>| | | |- SubSub2| | | | |- SubItem2 || <– AbstractItem * | | – AbstractItem –>| | |- Sub2 | | | |- Item2 || <– AbstractItem * | | – AbstractItem –>| |- Item2 | | | |- SubItem3 || <– AbstractItem * | | – AbstractItem –>| |- Sub3 | | | |- SubItem4 || <– AbstractItem * | | – AbstractItem –>| |- Sub4 | | |--------------------|| * | | |----------------| |----------------------------| * |-------------------|

* |
* |

|----------------------------| * |----------------------------| | ItemModelHelper | * | ItemModelHelper | ||————————–|| * ||————————–|| || Root || * || Root || || |- World || * || |- World || || | |- Charater || * || | |- Charater || || | | |- Head || * || | | |- Head || || | | |- Body || * || | | |- Body || || | |- Sphere || * || | |- Sphere || || |- Materials || * || |- Materials || || |- GGX || * || |- GGX || || |- GTR || * || |- GTR || ||————————–|| * ||————————–|| |----------------------------| * |----------------------------| The item model doesn’t return the data itself. Instead, it returns the value model that can contain any data type and supports callbacks. Thus the client of the model can track the changes in both the item model and any value it holds. From any item, the item model can get both the value model and the nested items. Therefore, the model is flexible to represent anything from color to complicated tree-table construction.

Keyword Args:

add_begin_edit_fn(self: omni.ui._ui.AbstractItemModel, arg0: Callable[[omni.ui._ui.AbstractItemModel, omni.ui._ui.AbstractItem], None])int

Adds the function that will be called every time the user starts the editing. The id of the callback that is used to remove the callback.

add_end_edit_fn(self: omni.ui._ui.AbstractItemModel, arg0: Callable[[omni.ui._ui.AbstractItemModel, omni.ui._ui.AbstractItem], None])int

Adds the function that will be called every time the user finishes the editing. The id of the callback that is used to remove the callback.

add_item_changed_fn(self: omni.ui._ui.AbstractItemModel, arg0: Callable[[omni.ui._ui.AbstractItemModel, omni.ui._ui.AbstractItem], 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.

append_child_item(self: omni.ui._ui.AbstractItemModel, parentItem: omni.ui._ui.AbstractItem, model: omni.ui._ui.AbstractValueModel) → omni.ui._ui.AbstractItem

Creates a new item from the value model and appends it to the list of the children of the given item.

begin_edit(self: omni.ui._ui.AbstractItemModel, item: omni.ui._ui.AbstractItem)None

Called when the user starts the editing. If it’s a field, this method is called when the user activates the field and places the cursor inside.

can_item_have_children(self: omni.ui._ui.AbstractItemModel, parentItem: omni.ui._ui.AbstractItem = None)bool

Returns true if the item can have children. In this way the delegate usually draws +/- icon.

Args:

id: The item to request children from. If it’s null, the children of root will be returned.

drop(*args, **kwargs)

Overloaded function.

  1. drop(self: omni.ui._ui.AbstractItemModel, item_tagget: omni.ui._ui.AbstractItem, item_source: omni.ui._ui.AbstractItem, drop_location: int = -1) -> None

Called when the user droped one item to another. def drop(self, target_item, source) drop(self, target_item, source) PyAbstractItemModel::drop AbstractItemModel.drop pybind11::class_<AbstractItemModel>.def(“drop”) AbstractItemModel

  1. drop(self: omni.ui._ui.AbstractItemModel, item_tagget: omni.ui._ui.AbstractItem, source: str, drop_location: int = -1) -> None

Called when the user droped a string to the item.

drop_accepted(*args, **kwargs)

Overloaded function.

  1. drop_accepted(self: omni.ui._ui.AbstractItemModel, item_tagget: omni.ui._ui.AbstractItem, item_source: omni.ui._ui.AbstractItem, drop_location: int = -1) -> bool

Called to determine if the model can perform drag and drop to the given item. If this method returns false, the widget shouldn’t highlight the visual element that represents this item.

  1. drop_accepted(self: omni.ui._ui.AbstractItemModel, item_tagget: omni.ui._ui.AbstractItem, source: str, drop_location: int = -1) -> bool

Called to determine if the model can perform drag and drop of the given string to the given item. If this method returns false, the widget shouldn’t highlight the visual element that represents this item.

end_edit(self: omni.ui._ui.AbstractItemModel, item: omni.ui._ui.AbstractItem)None

Called when the user finishes the editing. If it’s a field, this method is called when the user presses Enter or selects another field for editing. It’s useful for undo/redo.

get_drag_mime_data(self: omni.ui._ui.AbstractItemModel, item: omni.ui._ui.AbstractItem = None)str

Returns Multipurpose Internet Mail Extensions (MIME) for drag and drop.

get_item_children(self: omni.ui._ui.AbstractItemModel, parentItem: omni.ui._ui.AbstractItem = None) → List[omni.ui._ui.AbstractItem]

Returns the vector of items that are nested to the given parent item.

Args:

id: The item to request children from. If it’s null, the children of root will be returned.

get_item_value_model(self: omni.ui._ui.AbstractItemModel, item: omni.ui._ui.AbstractItem = None, column_id: int = 0) → omni.ui._ui.AbstractValueModel

Get the value model associated with this item.

Args:

item: The item to request the value model from. If it’s null, the root value model will be returned. index: The column number to get the value model.

get_item_value_model_count(self: omni.ui._ui.AbstractItemModel, item: omni.ui._ui.AbstractItem = None)int

Returns the number of columns this model item contains.

remove_begin_edit_fn(self: omni.ui._ui.AbstractItemModel, arg0: int)None

Remove the callback by its id.

Args:

id: The id that addBeginEditFn returns.

remove_end_edit_fn(self: omni.ui._ui.AbstractItemModel, arg0: int)None

Remove the callback by its id.

Args:

id: The id that addEndEditFn returns.

remove_item(self: omni.ui._ui.AbstractItemModel, item: omni.ui._ui.AbstractItem)None

Removes the item from the model. There is no parent here because we assume that the reimplemented model deals with its data and can figure out how to remove this item.

remove_item_changed_fn(self: omni.ui._ui.AbstractItemModel, arg0: int)None

Remove the callback by its id.

Args:

id: The id that addValueChangedFn returns.

subscribe_begin_edit_fn(self: omni.ui._ui.AbstractItemModel, arg0: Callable[[omni.ui._ui.AbstractItemModel, omni.ui._ui.AbstractItem], None]) → carb._carb.Subscription

Adds the function that will be called every time the user starts the editing. The id of the callback that is used to remove the callback.

subscribe_end_edit_fn(self: omni.ui._ui.AbstractItemModel, arg0: Callable[[omni.ui._ui.AbstractItemModel, omni.ui._ui.AbstractItem], None]) → carb._carb.Subscription

Adds the function that will be called every time the user finishes the editing. The id of the callback that is used to remove the callback.

subscribe_item_changed_fn(self: omni.ui._ui.AbstractItemModel, arg0: Callable[[omni.ui._ui.AbstractItemModel, omni.ui._ui.AbstractItem], None]) → carb._carb.Subscription

Adds the function that will be called every time the value changes. The id of the callback that is used to remove the callback.

class omni.ui.AbstractMultiField

Bases: omni.ui._ui.Widget, omni.ui._ui.ItemModelHelper

AbstractMultiField is the abstract class that has everything to create a custom widget per model item. The class that wants to create multiple widgets per item needs to reimplement the method _createField.

Keyword Args:

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 as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

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 fallow 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 event if is the top most widget setup this options to true to enable you to capture the events so they don’t also get routed to the bellow widgets

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)

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)

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)

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)

drag_fn: Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

accept_drop_fn: 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: Specify that this Widget accepts drops and set the callback to the drop operation.

property column_count

The max number of fields in a line.

property h_spacing

Sets a non-stretchable horizontal space in pixels between child fields.

property v_spacing

Sets a non-stretchable vertical space in pixels between child fields.

class omni.ui.AbstractSlider

Bases: omni.ui._ui.Widget, omni.ui._ui.ValueModelHelper

TODO

class omni.ui.AbstractValueModel(self: omni.ui._ui.AbstractValueModel)None

Bases: pybind11_builtins.pybind11_object

Keyword Args:

add_begin_edit_fn(self: omni.ui._ui.AbstractValueModel, arg0: Callable[[omni.ui._ui.AbstractValueModel], None])int

Adds the function that will be called every time the user starts the editing. The id of the callback that is used to remove the callback.

add_end_edit_fn(self: omni.ui._ui.AbstractValueModel, arg0: Callable[[omni.ui._ui.AbstractValueModel], None])int

Adds the function that will be called every time the user finishes the editing. The id of the callback that is used to remove the callback.

add_value_changed_fn(self: omni.ui._ui.AbstractValueModel, arg0: Callable[[omni.ui._ui.AbstractValueModel], 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.

property as_bool

Return the bool representation of the value.

property as_float

Return the float representation of the value.

property as_int

Return the int representation of the value.

property as_string

Return the string representation of the value.

begin_edit(self: omni.ui._ui.AbstractValueModel)None

Called when the user starts the editing. If it’s a field, this method is called when the user activates the field and places the cursor inside. This method should be reimplemented.

end_edit(self: omni.ui._ui.AbstractValueModel)None

Called when the user finishes the editing. If it’s a field, this method is called when the user presses Enter or selects another field for editing. It’s useful for undo/redo. This method should be reimplemented.

get_value_as_bool(self: omni.ui._ui.AbstractValueModel)bool

Return the bool representation of the value.

get_value_as_float(self: omni.ui._ui.AbstractValueModel)float

Return the float representation of the value.

get_value_as_int(self: omni.ui._ui.AbstractValueModel)int

Return the int representation of the value.

get_value_as_string(self: omni.ui._ui.AbstractValueModel)str

Return the string representation of the value.

remove_begin_edit_fn(self: omni.ui._ui.AbstractValueModel, arg0: int)None

Remove the callback by its id.

Args:

id: The id that addBeginEditFn returns.

remove_end_edit_fn(self: omni.ui._ui.AbstractValueModel, arg0: int)None

Remove the callback by its id.

Args:

id: The id that addEndEditFn returns.

remove_value_changed_fn(self: omni.ui._ui.AbstractValueModel, arg0: int)None

Remove the callback by its id.

Args:

id: The id that addValueChangedFn returns.

set_value(*args, **kwargs)

Overloaded function.

  1. set_value(self: omni.ui._ui.AbstractValueModel, value: bool) -> None

Set the value.

  1. set_value(self: omni.ui._ui.AbstractValueModel, value: int) -> None

Set the value.

  1. set_value(self: omni.ui._ui.AbstractValueModel, value: float) -> None

Set the value.

  1. set_value(self: omni.ui._ui.AbstractValueModel, value: str) -> None

Set the value.

subscribe_begin_edit_fn(self: omni.ui._ui.AbstractValueModel, arg0: Callable[[omni.ui._ui.AbstractValueModel], None]) → carb._carb.Subscription

Adds the function that will be called every time the user starts the editing. The id of the callback that is used to remove the callback.

subscribe_end_edit_fn(self: omni.ui._ui.AbstractValueModel, arg0: Callable[[omni.ui._ui.AbstractValueModel], None]) → carb._carb.Subscription

Adds the function that will be called every time the user finishes the editing. The id of the callback that is used to remove the callback.

subscribe_item_changed_fn(self: omni.ui._ui.AbstractValueModel, arg0: Callable[[omni.ui._ui.AbstractValueModel], None]) → carb._carb.Subscription
subscribe_value_changed_fn(self: omni.ui._ui.AbstractValueModel, arg0: Callable[[omni.ui._ui.AbstractValueModel], None]) → carb._carb.Subscription

Adds the function that will be called every time the value changes. The id of the callback that is used to remove the callback.

class omni.ui.Alignment(self: omni.ui._ui.Alignment, arg0: int)None

Bases: pybind11_builtins.pybind11_object

Members:

LEFT_TOP

LEFT_CENTER

LEFT_BOTTOM

CENTER_TOP

CENTER

CENTER_BOTTOM

RIGHT_TOP

RIGHT_CENTER

RIGHT_BOTTOM

LEFT

RIGHT

H_CENTER

TOP

BOTTOM

V_CENTER

BOTTOM = Alignment.BOTTOM
CENTER = Alignment.CENTER
CENTER_BOTTOM = Alignment.CENTER_BOTTOM
CENTER_TOP = Alignment.CENTER_TOP
H_CENTER = Alignment.H_CENTER
LEFT = Alignment.LEFT
LEFT_BOTTOM = Alignment.LEFT_BOTTOM
LEFT_CENTER = Alignment.LEFT_CENTER
LEFT_TOP = Alignment.LEFT_TOP
RIGHT = Alignment.RIGHT
RIGHT_BOTTOM = Alignment.RIGHT_BOTTOM
RIGHT_CENTER = Alignment.RIGHT_CENTER
RIGHT_TOP = Alignment.RIGHT_TOP
TOP = Alignment.TOP
V_CENTER = Alignment.V_CENTER
property name

handle) -> str

Type

(self

class omni.ui.Axis(self: omni.ui._ui.Axis, arg0: int)None

Bases: pybind11_builtins.pybind11_object

Members:

None

X

Y

XY

None = Axis.None
X = Axis.X
XY = Axis.XY
Y = Axis.Y
property name

handle) -> str

Type

(self

class omni.ui.Button(self: omni.ui._ui.Button, text: str = '', **kwargs)None

Bases: omni.ui._ui.InvisibleButton

The Button widget provides a command button. The command button, is perhaps the most commonly used widget in any graphical user interface. Click a button to execute a command. It is rectangular and typically displays a text label describing its action.

Keyword Args:

text: This property holds the button’s text.

image_url: This property holds the button’s optional image URL.

image_width: This property holds the width of the image widget. Do not use this function to find the width of the image.

image_height: This property holds the height of the image widget. Do not use this function to find the height of the image.

spacing: Sets a non-stretchable space in points between image and text.

clicked_fn: 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: 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 as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

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 fallow 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 event if is the top most widget setup this options to true to enable you to capture the events so they don’t also get routed to the bellow widgets

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)

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)

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)

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)

drag_fn: Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

accept_drop_fn: 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: Specify that this Widget accepts drops and set the callback to the drop operation.

Constructor. Construct a button with a text on it.

Args:

text: The text for the button to use.

property image_height

This property holds the height of the image widget. Do not use this function to find the height of the image.

property image_url

This property holds the button’s optional image URL.

property image_width

This property holds the width of the image widget. Do not use this function to find the width of the image.

property spacing

Sets a non-stretchable space in points between image and text.

property text

This property holds the button’s text.

class omni.ui.ByteImageProvider(self: omni.ui._ui.ByteImageProvider, **kwargs)None

Bases: omni.ui._ui.ImageProvider

doc

doc

set_bytes_data(self: omni.ui._ui.ByteImageProvider, bytes: List[int], sizes: List[int])None

Sets byte data that the image provider will turn into an image.

set_data(self: omni.ui._ui.ByteImageProvider, arg0: List[int], arg1: List[int])None

[DEPRECATED FUNCTION]

class omni.ui.CanvasFrame(self: omni.ui._ui.CanvasFrame, **kwargs)None

Bases: omni.ui._ui.Frame

CanvasFrame is the widget that allows the user to pan and zoom its children with a mouse. It has the layout that can be infinitely moved in any direction.

Keyword Args:

pan_x: The horizontal offset of the child item.

pan_y: The vertical offset of the child item.

zoom: The zoom level of the child item.

draggable: Provides a convenient way to make the content draggable and zoomable.

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 specail 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.

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.

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 as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

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 fallow 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 event if is the top most widget setup this options to true to enable you to capture the events so they don’t also get routed to the bellow widgets

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)

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)

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)

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)

drag_fn: Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

accept_drop_fn: 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: Specify that this Widget accepts drops and set the callback to the drop operation.

property draggable

Provides a convenient way to make the content draggable and zoomable.

property pan_x

The horizontal offset of the child item.

property pan_y

The vertical offset of the child item.

screen_to_canvas(self: omni.ui._ui.CanvasFrame, x: float, y: float) → Tuple[float, float]

Transforms screen-space coordinates to canvas-space

screen_to_canvas_x(self: omni.ui._ui.CanvasFrame, x: float)float

Transforms screen-space X to canvas-space X.

screen_to_canvas_y(self: omni.ui._ui.CanvasFrame, y: float)float

Transforms screen-space Y to canvas-space Y.

set_pan_key_shortcut(self: omni.ui._ui.CanvasFrame, mouse_button: int, key_flag: int)None

Specify the mouse button and key to pan the canvas.

property zoom

The zoom level of the child item.

class omni.ui.CheckBox(self: omni.ui._ui.CheckBox, model: omni.ui._ui.AbstractValueModel = None, **kwargs)None

Bases: omni.ui._ui.Widget, omni.ui._ui.ValueModelHelper

A CheckBox is an option button that can be switched on (checked) or off (unchecked). Checkboxes are typically used to represent features in an application that can be enabled or disabled without affecting others. The checkbox is implemented using the model-view pattern. The model is the central component of this system. It is the application’s dynamic data structure independent of the widget. It directly manages thedata, logic, and rules of the checkbox. If the model is not specified, the simple one is created automatically when the object is constructed.

Keyword Args:

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 as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

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 fallow 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 event if is the top most widget setup this options to true to enable you to capture the events so they don’t also get routed to the bellow widgets

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)

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)

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)

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)

drag_fn: Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

accept_drop_fn: 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: Specify that this Widget accepts drops and set the callback to the drop operation.

CheckBox with specified model. If model is not specified, it’s using the default one.

class omni.ui.Circle(self: omni.ui._ui.Circle, **kwargs)None

Bases: omni.ui._ui.Shape

The Circle widget provides a colored rectangle to display.

Keyword Args:

alignment: This property holds the alignment of the circle when the fill policy is ePreserveAspectFit or ePreserveAspectCrop. By default, the circle is centered.

radius: This property holds the radius of the circle when the fill policy is eFixed or eFixedCrop. By default, the circle radius is 0.

arc: This property is the way to draw a half or a quarter of the circle. When it’s eLeft, only left side of the circle is rendered. When it’s eLeftTop, only left top quarter is rendered.

size_policy: Define what happens when the source image has a different size than the item.

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 as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

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 fallow 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 event if is the top most widget setup this options to true to enable you to capture the events so they don’t also get routed to the bellow widgets

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)

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)

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)

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)

drag_fn: Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

accept_drop_fn: 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: Specify that this Widget accepts drops and set the callback to the drop operation.

property alignment

This property holds the alignment of the circle when the fill policy is ePreserveAspectFit or ePreserveAspectCrop. By default, the circle is centered.

property arc

This property is the way to draw a half or a quarter of the circle. When it’s eLeft, only left side of the circle is rendered. When it’s eLeftTop, only left top quarter is rendered.

property radius

This property holds the radius of the circle when the fill policy is eFixed or eFixedCrop. By default, the circle radius is 0.

property size_policy

Define what happens when the source image has a different size than the item.

class omni.ui.CircleSizePolicy(self: omni.ui._ui.CircleSizePolicy, arg0: int)None

Bases: pybind11_builtins.pybind11_object

Define what happens when the source image has a different size than the item.

Members:

STRETCH

FIXED

FIXED = CircleSizePolicy.FIXED
STRETCH = CircleSizePolicy.STRETCH
property name

handle) -> str

Type

(self

class omni.ui.CollapsableFrame(self: omni.ui._ui.CollapsableFrame, title: str = '', **kwargs)None

Bases: omni.ui._ui.Frame

CollapsableFrame is a frame widget that can hide or show its content. It has two states expanded and collapsed. When it’s collapsed, it looks like a button. If it’s expanded, it looks like a button and a frame with the content. It’s handy to group properties, and temporarily hide them to get more space for something else.

Keyword Args:

collapsed: The state of the CollapsableFrame.

title: The header text.

alignment: This property holds the alignment of the label in the default header. By default, the contents of the label are left-aligned and vertically-centered.

build_header_fn: Set dynamic header that will be created dynamiclly when it is needed. The function is called inside a ui.Frame scope that the widget will be parented correctly.

collapsed_changed_fn: The state of the CollapsableFrame.

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 specail 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.

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.

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 as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

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 fallow 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 event if is the top most widget setup this options to true to enable you to capture the events so they don’t also get routed to the bellow widgets

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)

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)

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)

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)

drag_fn: Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

accept_drop_fn: 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: Specify that this Widget accepts drops and set the callback to the drop operation.

property alignment

This property holds the alignment of the label in the default header. By default, the contents of the label are left-aligned and vertically-centered.

property collapsed

The state of the CollapsableFrame.

set_build_header_fn(self: omni.ui._ui.CollapsableFrame, fn: Callable[[bool, str], None])None

Set dynamic header that will be created dynamiclly when it is needed. The function is called inside a ui.Frame scope that the widget will be parented correctly.

set_collapsed_changed_fn(self: omni.ui._ui.CollapsableFrame, fn: Callable[[bool], None])None

The state of the CollapsableFrame.

property title

The header text.

class omni.ui.ColorWidget(*args, **kwargs)

Bases: omni.ui._ui.Widget, omni.ui._ui.ItemModelHelper

The ColorWidget widget is a button that displays the color from the item model and can open a picker window.

The color dialog’s function is to allow users to choose colors.

Parameters
  • 1 (Option) – None: The default RGBA model is assigned to this widget.

  • 2 (Option) – model (AbstractItemModel): The model assigned to this widget.

  • 3 (Option) – red (float): The red component of the initial color. green (float): The green component of the initial color. blue (float): The blue component of the initial color.

  • 4 (Option) – red (float): The red component of the initial color. green (float): The green component of the initial color. blue (float): The blue component of the initial color. alpha (float): The alpha component of the initial color.

Overloaded function.

  1. __init__(self: omni.ui._ui.ColorWidget, **kwargs) -> None

  2. __init__(self: omni.ui._ui.ColorWidget, arg0: omni.ui._ui.AbstractItemModel, **kwargs) -> None

  3. __init__(self: omni.ui._ui.ColorWidget, arg0: float, arg1: float, arg2: float, **kwargs) -> None

  4. __init__(self: omni.ui._ui.ColorWidget, arg0: float, arg1: float, arg2: float, arg3: float, **kwargs) -> None

class omni.ui.ComboBox(self: omni.ui._ui.ComboBox, *args, **kwargs)None

Bases: omni.ui._ui.Widget, omni.ui._ui.ItemModelHelper

The ComboBox widget is a combined button and a drop-down list.

A combo box is a selection widget that displays the current item and can pop up a list of selectable items.

Parameters
  • 1 (Option) – model (AbstractItemModel): The model assigned to this widget.

  • 1 – currentIndex (int): The index of the current item in the combobox. item (str): The text for the first item. item (str): The text for the second item. … item (str): The text for the last item.

class omni.ui.Container

Bases: omni.ui._ui.Widget

Base class for all UI containers. Container can hold one or many other Widget s

add_child(self: omni.ui._ui.Container, arg0: omni.ui._ui.Widget)None

Adds widget to this container in a manner specific to the container. If it’s allowed to have one sub-widget only, it will be overwriten.

clear(self: omni.ui._ui.Container)None

Removes the container items from the container.

class omni.ui.CornerFlag(self: omni.ui._ui.CornerFlag, arg0: int)None

Bases: pybind11_builtins.pybind11_object

Members:

NONE

TOP_LEFT

TOP_RIGHT

BOTTOM_LEFT

BOTTOM_RIGHT

TOP

BOTTOM

LEFT

RIGHT

ALL

ALL = CornerFlag.ALL
BOTTOM = CornerFlag.BOTTOM
BOTTOM_LEFT = CornerFlag.BOTTOM_LEFT
BOTTOM_RIGHT = CornerFlag.BOTTOM_RIGHT
LEFT = CornerFlag.LEFT
NONE = CornerFlag.NONE
RIGHT = CornerFlag.RIGHT
TOP = CornerFlag.TOP
TOP_LEFT = CornerFlag.TOP_LEFT
TOP_RIGHT = CornerFlag.TOP_RIGHT
property name

handle) -> str

Type

(self

class omni.ui.Direction(self: omni.ui._ui.Direction, arg0: int)None

Bases: pybind11_builtins.pybind11_object

Members:

LEFT_TO_RIGHT

RIGHT_TO_LEFT

TOP_TO_BOTTOM

BOTTOM_TO_TOP

BACK_TO_FRONT

FRONT_TO_BACK

BACK_TO_FRONT = Direction.BACK_TO_FRONT
BOTTOM_TO_TOP = Direction.BOTTOM_TO_TOP
FRONT_TO_BACK = Direction.FRONT_TO_BACK
LEFT_TO_RIGHT = Direction.LEFT_TO_RIGHT
RIGHT_TO_LEFT = Direction.RIGHT_TO_LEFT
TOP_TO_BOTTOM = Direction.TOP_TO_BOTTOM
property name

handle) -> str

Type

(self

class omni.ui.DockPolicy(self: omni.ui._ui.DockPolicy, arg0: int)None

Bases: pybind11_builtins.pybind11_object

Members:

DO_NOTHING

CURRENT_WINDOW_IS_ACTIVE

TARGET_WINDOW_IS_ACTIVE

CURRENT_WINDOW_IS_ACTIVE = DockPolicy.CURRENT_WINDOW_IS_ACTIVE
DO_NOTHING = DockPolicy.DO_NOTHING
TARGET_WINDOW_IS_ACTIVE = DockPolicy.TARGET_WINDOW_IS_ACTIVE
property name

handle) -> str

Type

(self

class omni.ui.DockPosition(self: omni.ui._ui.DockPosition, arg0: int)None

Bases: pybind11_builtins.pybind11_object

Members:

RIGHT

LEFT

TOP

BOTTOM

SAME

BOTTOM = DockPosition.BOTTOM
LEFT = DockPosition.LEFT
RIGHT = DockPosition.RIGHT
SAME = DockPosition.SAME
TOP = DockPosition.TOP
property name

handle) -> str

Type

(self

class omni.ui.DockPreference(self: omni.ui._ui.DockPreference, arg0: int)None

Bases: pybind11_builtins.pybind11_object

Members:

DISABLED

MAIN

RIGHT

LEFT

RIGHT_TOP

RIGHT_BOTTOM

LEFT_BOTTOM

DISABLED = DockPreference.DISABLED
LEFT = DockPreference.LEFT
LEFT_BOTTOM = DockPreference.LEFT_BOTTOM
MAIN = DockPreference.MAIN
RIGHT = DockPreference.RIGHT
RIGHT_BOTTOM = DockPreference.RIGHT_BOTTOM
RIGHT_TOP = DockPreference.RIGHT_TOP
property name

handle) -> str

Type

(self

class omni.ui.DockSpace(self: omni.ui._ui.DockSpace, arg0: object, **kwargs)None

Bases: pybind11_builtins.pybind11_object

property dock_frame
class omni.ui.FillPolicy(self: omni.ui._ui.FillPolicy, arg0: int)None

Bases: pybind11_builtins.pybind11_object

Members:

STRETCH

PRESERVE_ASPECT_FIT

PRESERVE_ASPECT_CROP

PRESERVE_ASPECT_CROP = FillPolicy.PRESERVE_ASPECT_CROP
PRESERVE_ASPECT_FIT = FillPolicy.PRESERVE_ASPECT_FIT
STRETCH = FillPolicy.STRETCH
property name

handle) -> str

Type

(self

class omni.ui.FloatDrag(self: omni.ui._ui.FloatDrag, model: omni.ui._ui.AbstractValueModel = None, **kwargs)None

Bases: omni.ui._ui.FloatSlider

TODO

class omni.ui.FloatField(self: omni.ui._ui.FloatField, model: omni.ui._ui.AbstractValueModel = None, **kwargs)None

Bases: omni.ui._ui.AbstractField

TODO

class omni.ui.FloatSlider(self: omni.ui._ui.FloatSlider, model: omni.ui._ui.AbstractValueModel = None, **kwargs)None

Bases: omni.ui._ui.AbstractSlider

TODO

property max
property min
property step
class omni.ui.FontStyle(self: omni.ui._ui.FontStyle, arg0: int)None

Bases: pybind11_builtins.pybind11_object

Supported font styles.

Members:

NONE

NORMAL

LARGE

SMALL

EXTRA_LARGE

XXL

XXXL

EXTRA_SMALL

XXS

XXXS

EXTRA_LARGE = FontStyle.EXTRA_LARGE
EXTRA_SMALL = FontStyle.EXTRA_SMALL
LARGE = FontStyle.LARGE
NONE = FontStyle.NONE
NORMAL = FontStyle.NORMAL
SMALL = FontStyle.SMALL
XXL = FontStyle.XXL
XXS = FontStyle.XXS
XXXL = FontStyle.XXL
XXXS = FontStyle.XXXS
property name

handle) -> str

Type

(self

class omni.ui.Fraction(self: omni.ui._ui.Fraction, value: float)None

Bases: omni.ui._ui.Length

Convenience class to express Length in fraction units.

class omni.ui.Frame(self: omni.ui._ui.Frame, **kwargs)None

Bases: omni.ui._ui.Container

The Frame is a widget that can hold one child widget. Frame is used to crop the contents of a child widget or to draw small widget in a big view. The child widget must be specified with addChild().

Keyword Args:

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 specail 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.

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.

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 as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

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 fallow 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 event if is the top most widget setup this options to true to enable you to capture the events so they don’t also get routed to the bellow widgets

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)

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)

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)

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)

drag_fn: Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

accept_drop_fn: 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: Specify that this Widget accepts drops and set the callback to the drop operation.

property 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.

rebuild(self: omni.ui._ui.Frame)None

After this method is called, the next drawing cycle build_fn will be called again to rebuild everything.

property separate_window

A specail 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.

set_build_fn(self: omni.ui._ui.Frame, fn: Callable[[], None])None

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.

property 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.

class omni.ui.FreeBezierCurve(self: omni.ui._ui.FreeBezierCurve, arg0: omni.ui._ui.Widget, arg1: omni.ui._ui.Widget, **kwargs)None

Bases: omni.ui._ui.Shape

Position free Bezier curve. The feature of this widget is the way to set the coordinates of the curve. It ignores the layout. When initializing, it’s necessary to provide two widgets, and the curve is drawn from one widget position to the other.

Keyword Args:

start_tangent_width: This property holds the X coordinate of the start of the curve relative to the width bound of the curve.

start_tangent_height: This property holds the Y coordinate of the start of the curve relative to the width bound of the curve.

end_tangent_width: This property holds the X coordinate of the end of the curve relative to the width bound of the curve.

end_tangent_height: This property holds the Y coordinate of the end of the curve relative to the width bound of the curve.

set_mouse_hovered_fn: Sets the function that will be called when the user use mouse enter/leave on the line. It’s the override to prevent Widget from the bounding box logic. function specification is. void onMouseHovered(bool hovered)

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 as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

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 fallow 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 event if is the top most widget setup this options to true to enable you to capture the events so they don’t also get routed to the bellow widgets

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)

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)

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)

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)

drag_fn: Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

accept_drop_fn: 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: Specify that this Widget accepts drops and set the callback to the drop operation.

property end_tangent_height

This property holds the Y coordinate of the end of the curve relative to the width bound of the curve.

property end_tangent_width

This property holds the X coordinate of the end of the curve relative to the width bound of the curve.

set_mouse_hovered_fn(self: omni.ui._ui.FreeBezierCurve, fn: Callable[[bool], None])None

Sets the function that will be called when the user use mouse enter/leave on the line. It’s the override to prevent Widget from the bounding box logic. function specification is. void onMouseHovered(bool hovered)

property start_tangent_height

This property holds the Y coordinate of the start of the curve relative to the width bound of the curve.

property start_tangent_width

This property holds the X coordinate of the start of the curve relative to the width bound of the curve.

class omni.ui.Grid(self: omni.ui._ui.Grid, arg0: omni.ui._ui.Direction, **kwargs)None

Bases: omni.ui._ui.Stack

Grid is a container that arranges its child views in a grid. The grid vertical/horizontal direction is the direction the grid size grows with creating more children.

Keyword Args:

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.

row_height: 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.

column_count: 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.

row_count: 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.

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 aertical column, from top to bottom. If the Stack’s orientation is eBottomToTop, the widgets are placed in a aertical 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.

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 as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

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 fallow 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 event if is the top most widget setup this options to true to enable you to capture the events so they don’t also get routed to the bellow widgets

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)

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)

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)

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)

drag_fn: Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

accept_drop_fn: 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: Specify that this Widget accepts drops and set the callback to the drop operation.

Constructor.

Args:

direction: Determines the direction the widget grows when adding more children.

property column_count

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.

property 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.

property row_count

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.

property row_height

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.

class omni.ui.HGrid(self: omni.ui._ui.HGrid, **kwargs)None

Bases: omni.ui._ui.Grid

Shortcut for Grid{eLeftToRight}. The grid grows from left to right with the widgets placed.

Keyword Args:

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.

row_height: 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.

column_count: 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.

row_count: 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.

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 aertical column, from top to bottom. If the Stack’s orientation is eBottomToTop, the widgets are placed in a aertical 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.

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 as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

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 fallow 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 event if is the top most widget setup this options to true to enable you to capture the events so they don’t also get routed to the bellow widgets

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)

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)

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)

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)

drag_fn: Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

accept_drop_fn: 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: Specify that this Widget accepts drops and set the callback to the drop operation.

Construct a grid that grow from left to right with the widgets placed.

class omni.ui.HStack(self: omni.ui._ui.HStack, **kwargs)None

Bases: omni.ui._ui.Stack

Shortcut for Stack{eLeftToRight}. The widgets are placed in a row, with suitable sizes.

Keyword Args:

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 aertical column, from top to bottom. If the Stack’s orientation is eBottomToTop, the widgets are placed in a aertical 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.

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 as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

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 fallow 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 event if is the top most widget setup this options to true to enable you to capture the events so they don’t also get routed to the bellow widgets

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)

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)

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)

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)

drag_fn: Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

accept_drop_fn: 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: Specify that this Widget accepts drops and set the callback to the drop operation.

Construct a stack with the widgets placed in a row from left to right.

class omni.ui.Image(*args, **kwargs)

Bases: omni.ui._ui.Widget

The Image widget displays an image. The source of the image is specified as a URL using the source property. By default, specifying the width and height of the item causes the image to be scaled to that size. This behavior can be changed by setting the fill_mode property, allowing the image to be stretched or scaled instead. The property alignment controls where to align the scaled image.

Keyword Args:

alignment: This property holds the alignment of the image when the fill policy is ePreserveAspectFit or ePreserveAspectCrop. By default, the image is centered.

fill_policy: Define what happens when the source image has a different size than the item.

progress_changed_fn: The progress of the image loading.

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 as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

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 fallow 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 event if is the top most widget setup this options to true to enable you to capture the events so they don’t also get routed to the bellow widgets

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)

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)

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)

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)

drag_fn: Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

accept_drop_fn: 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: Specify that this Widget accepts drops and set the callback to the drop operation.

Overloaded function.

  1. __init__(self: omni.ui._ui.Image, arg0: str, **kwargs) -> None

Construct image with given url. If the url is empty, it gets the image URL from styling.

  1. __init__(self: omni.ui._ui.Image, **kwargs) -> None

Construct image with given url. If the url is empty, it gets the image URL from styling.

property alignment

This property holds the alignment of the image when the fill policy is ePreserveAspectFit or ePreserveAspectCrop. By default, the image is centered.

property fill_policy

Define what happens when the source image has a different size than the item.

set_progress_changed_fn(self: omni.ui._ui.Image, fn: Callable[[float], None])None

The progress of the image loading.

property source_url

omni: file:

class omni.ui.ImageProvider(self: omni.ui._ui.ImageProvider, **kwargs)None

Bases: pybind11_builtins.pybind11_object

ImageProvider class, the goal of this class is to provide ImGui reference for the image to be rendered.

doc

property height

Gets image height.

property is_reference_valid

Returns true if ImGui reference is valid, false otherwise.

set_image_data(self: omni.ui._ui.ImageProvider, arg0: capsule, arg1: int, arg2: int, arg3: omni.ui._ui.TextureFormat)None
property width

Gets image width.

class omni.ui.ImageWithProvider(*args, **kwargs)

Bases: omni.ui._ui.Widget

The Image widget displays an image. The source of the image is specified as a URL using the source property. By default, specifying the width and height of the item causes the image to be scaled to that size. This behavior can be changed by setting the fill_mode property, allowing the image to be stretched or scaled instead. The property alignment controls where to align the scaled image.

Keyword Args:

alignment: This property holds the alignment of the image when the fill policy is ePreserveAspectFit or ePreserveAspectCrop. By default, the image is centered.

fill_policy: Define what happens when the source image has a different size than the item.

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 as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

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 fallow 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 event if is the top most widget setup this options to true to enable you to capture the events so they don’t also get routed to the bellow widgets

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)

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)

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)

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)

drag_fn: Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

accept_drop_fn: 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: Specify that this Widget accepts drops and set the callback to the drop operation.

Overloaded function.

  1. __init__(self: omni.ui._ui.ImageWithProvider, arg0: omni::ui::ImageProvider, **kwargs) -> None

Construct image with given url. If the url is empty, it gets the image URL from styling. Alternatively, construct image with an ImageProvider.

  1. __init__(self: omni.ui._ui.ImageWithProvider, arg0: str, **kwargs) -> None

Construct image with given url. If the url is empty, it gets the image URL from styling. Alternatively, construct image with an ImageProvider.

  1. __init__(self: omni.ui._ui.ImageWithProvider, **kwargs) -> None

Construct image with given url. If the url is empty, it gets the image URL from styling. Alternatively, construct image with an ImageProvider.

property alignment

This property holds the alignment of the image when the fill policy is ePreserveAspectFit or ePreserveAspectCrop. By default, the image is centered.

property fill_policy

Define what happens when the source image has a different size than the item.

class omni.ui.IntDrag(self: omni.ui._ui.IntDrag, model: omni.ui._ui.AbstractValueModel = None, **kwargs)None

Bases: omni.ui._ui.IntSlider

The drag widget that looks like a field but it’s possible to change the value with dragging.

Keyword Args:

step: This property control the steping speed on the drag, its float to enable slower speed but off course the value on the Control are still integer.

min: This property holds the slider’s minimum value.

max: This property holds the slider’s maximum value.

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 as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

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 fallow 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 event if is the top most widget setup this options to true to enable you to capture the events so they don’t also get routed to the bellow widgets

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)

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)

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)

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)

drag_fn: Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

accept_drop_fn: 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: Specify that this Widget accepts drops and set the callback to the drop operation.

property step

This property control the steping speed on the drag, its float to enable slower speed but off course the value on the Control are still integer.

class omni.ui.IntField(self: omni.ui._ui.IntField, model: omni.ui._ui.AbstractValueModel = None, **kwargs)None

Bases: omni.ui._ui.AbstractField

TODO

class omni.ui.IntSlider(self: omni.ui._ui.IntSlider, model: omni.ui._ui.AbstractValueModel = None, **kwargs)None

Bases: omni.ui._ui.AbstractSlider

The slider is the classic widget for controlling a bounded value. It lets the user move a slider handle along a horizontal groove and translates the handle’s position into an integer value within the legal range.

Keyword Args:

min: This property holds the slider’s minimum value.

max: This property holds the slider’s maximum value.

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 as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

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 fallow 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 event if is the top most widget setup this options to true to enable you to capture the events so they don’t also get routed to the bellow widgets

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)

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)

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)

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)

drag_fn: Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

accept_drop_fn: 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: Specify that this Widget accepts drops and set the callback to the drop operation.

property max

This property holds the slider’s maximum value.

property min

This property holds the slider’s minimum value.

class omni.ui.InvisibleButton(self: omni.ui._ui.InvisibleButton, **kwargs)None

Bases: omni.ui._ui.Widget

The InvisibleButton widget provides a transparent command button.

Keyword Args:

clicked_fn: 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: 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 as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

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 fallow 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 event if is the top most widget setup this options to true to enable you to capture the events so they don’t also get routed to the bellow widgets

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)

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)

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)

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)

drag_fn: Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

accept_drop_fn: 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: Specify that this Widget accepts drops and set the callback to the drop operation.

Constructor.

Args:

text: The text for the button to use.

set_clicked_fn(self: omni.ui._ui.InvisibleButton, arg0: Callable[[], None])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).

class omni.ui.ItemModelHelper

Bases: pybind11_builtins.pybind11_object

TODO

property model
class omni.ui.IwpFillPolicy(self: omni.ui._ui.IwpFillPolicy, arg0: int)None

Bases: pybind11_builtins.pybind11_object

Members:

IWP_STRETCH

IWP_PRESERVE_ASPECT_FIT

IWP_PRESERVE_ASPECT_CROP

IWP_PRESERVE_ASPECT_CROP = IwpFillPolicy.IWP_PRESERVE_ASPECT_CROP
IWP_PRESERVE_ASPECT_FIT = IwpFillPolicy.IWP_PRESERVE_ASPECT_FIT
IWP_STRETCH = IwpFillPolicy.IWP_STRETCH
property name

handle) -> str

Type

(self

class omni.ui.Label(self: omni.ui._ui.Label, arg0: str, **kwargs)None

Bases: omni.ui._ui.Widget

The Label widget provides a text to display. Label is used for displaying text. No additional to Widget user interaction functionality is provided.

Keyword Args:

alignment: This property holds the alignment of the label’s contents. By default, the contents of the label are left-aligned and vertically-centered.

word_wrap: This property holds the label’s word-wrapping policy. If this property is true then label text is wrapped where necessary at word-breaks; otherwise it is not wrapped at all. By default, word wrap is disabled.

elided_text: When the text of a big length has to be displayed in a small area, it can be useful to give the user a visual hint that not all text is visible. Label can elide text that doesn’t fit in the area. When this property is true, Label elides the middle of the last visible line and replaces it with “…”.

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 as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

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 fallow 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 event if is the top most widget setup this options to true to enable you to capture the events so they don’t also get routed to the bellow widgets

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)

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)

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)

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)

drag_fn: Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

accept_drop_fn: 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: Specify that this Widget accepts drops and set the callback to the drop operation.

Create a label with the given text.

property alignment

This property holds the alignment of the label’s contents. By default, the contents of the label are left-aligned and vertically-centered.

property elided_text

When the text of a big length has to be displayed in a small area, it can be useful to give the user a visual hint that not all text is visible. Label can elide text that doesn’t fit in the area. When this property is true, Label elides the middle of the last visible line and replaces it with “…”.

property text

This property holds the label’s text.

property word_wrap

This property holds the label’s word-wrapping policy. If this property is true then label text is wrapped where necessary at word-breaks; otherwise it is not wrapped at all. By default, word wrap is disabled.

class omni.ui.Length(*args, **kwargs)

Bases: pybind11_builtins.pybind11_object

Length.

Represents any length as a value and unit type.

Examples:

>>> l1 = omni.ui.Length(250, omni.kit.ui.UnitType.PIXEL)
>>> l2 = omni.ui.Pixel(250)
>>> l3 = omni.ui.Percent(30)

l1 and l2 represent the same value: 250 in pixels. l3 is 30%.

Overloaded function.

  1. __init__(self: omni.ui._ui.Length, arg0: float, arg1: omni::ui::UnitType) -> None

  2. __init__(self: omni.ui._ui.Length, arg0: float) -> None

  3. __init__(self: omni.ui._ui.Length, arg0: int) -> None

property unit

(UnitType.) Unit.

property value

(float) Value

class omni.ui.Line(self: omni.ui._ui.Line, **kwargs)None

Bases: omni.ui._ui.Shape

The Line widget provides a colored rectangle to display.

Keyword Args:

alignment: This property holds the alignment of the Line can only LEFT, RIGHT, VCENTER, HCENTER , BOTTOM, TOP. By default, the Line is HCenter.

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 as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

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 fallow 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 event if is the top most widget setup this options to true to enable you to capture the events so they don’t also get routed to the bellow widgets

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)

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)

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)

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)

drag_fn: Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

accept_drop_fn: 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: Specify that this Widget accepts drops and set the callback to the drop operation.

property alignment

This property holds the alignment of the Line can only LEFT, RIGHT, VCENTER, HCENTER , BOTTOM, TOP. By default, the Line is HCenter.

class omni.ui.MainWindow(self: omni.ui._ui.MainWindow, **kwargs)None

Bases: pybind11_builtins.pybind11_object

property cpp_status_bar_enabled
property main_frame
property main_menu_bar
property status_bar_frame
class omni.ui.Menu(self: omni.ui._ui.Menu, arg0: str, **kwargs)None

Bases: omni.ui._ui.Container

TODO

show(self: omni.ui._ui.Menu)None
show_at(self: omni.ui._ui.Menu, arg0: float, arg1: float)None
class omni.ui.MenuBar(self: omni.ui._ui.MenuBar, **kwargs)None

Bases: omni.ui._ui.Container

TODO

class omni.ui.MenuItem(self: omni.ui._ui.MenuItem, arg0: str, **kwargs)None

Bases: omni.ui._ui.Widget

TODO

property checkable
property checked
set_checked_changed_fn(self: omni.ui._ui.MenuItem, arg0: Callable[[bool], None])None
set_triggered_fn(self: omni.ui._ui.MenuItem, arg0: Callable[[], None])None
property text
class omni.ui.MultiFloatDragField(*args, **kwargs)

Bases: omni.ui._ui.AbstractMultiField

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.

Keyword Args:

min: This property holds the drag’s minimum value.

max: This property holds the drag’s maximum value.

step: This property control the steping 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 as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

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 fallow 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 event if is the top most widget setup this options to true to enable you to capture the events so they don’t also get routed to the bellow widgets

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)

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)

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)

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)

drag_fn: Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

accept_drop_fn: 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: Specify that this Widget accepts drops and set the callback to the drop operation.

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

property max

This property holds the drag’s maximum value.

property min

This property holds the drag’s minimum value.

property step

This property control the steping speed on the drag.

class omni.ui.MultiFloatField(*args, **kwargs)

Bases: omni.ui._ui.AbstractMultiField

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.

Overloaded function.

  1. __init__(self: omni.ui._ui.MultiFloatField, **kwargs) -> None

  2. __init__(self: omni.ui._ui.MultiFloatField, arg0: omni.ui._ui.AbstractItemModel, **kwargs) -> None

  3. __init__(self: omni.ui._ui.MultiFloatField, *args, **kwargs) -> None

class omni.ui.MultiIntDragField(*args, **kwargs)

Bases: omni.ui._ui.AbstractMultiField

MultiIntDragField is the widget that has a sub widget (IntDrag) per model item. It’s handy to use it for multi-component data, like for example, int3.

Keyword Args:

min: This property holds the drag’s minimum value.

max: This property holds the drag’s maximum value.

step: This property control the steping 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 as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

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 fallow 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 event if is the top most widget setup this options to true to enable you to capture the events so they don’t also get routed to the bellow widgets

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)

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)

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)

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)

drag_fn: Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

accept_drop_fn: 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: Specify that this Widget accepts drops and set the callback to the drop operation.

Overloaded function.

  1. __init__(self: omni.ui._ui.MultiIntDragField, **kwargs) -> None

  2. __init__(self: omni.ui._ui.MultiIntDragField, arg0: omni.ui._ui.AbstractItemModel, **kwargs) -> None

  3. __init__(self: omni.ui._ui.MultiIntDragField, *args, **kwargs) -> None

property max

This property holds the drag’s maximum value.

property min

This property holds the drag’s minimum value.

property step

This property control the steping speed on the drag.

class omni.ui.MultiIntField(*args, **kwargs)

Bases: omni.ui._ui.AbstractMultiField

MultiIntField is the widget that has a sub widget (IntField) per model item.

It’s handy to use it for multi-component data, like for example, int3.

Overloaded function.

  1. __init__(self: omni.ui._ui.MultiIntField, **kwargs) -> None

  2. __init__(self: omni.ui._ui.MultiIntField, arg0: omni.ui._ui.AbstractItemModel, **kwargs) -> None

  3. __init__(self: omni.ui._ui.MultiIntField, *args, **kwargs) -> None

class omni.ui.MultiStringField(*args, **kwargs)

Bases: omni.ui._ui.AbstractMultiField

MultiStringField is the widget that has a sub widget (StringField) per model item.

It’s handy to use it for string arrays.

Overloaded function.

  1. __init__(self: omni.ui._ui.MultiStringField, **kwargs) -> None

  2. __init__(self: omni.ui._ui.MultiStringField, arg0: omni.ui._ui.AbstractItemModel, **kwargs) -> None

  3. __init__(self: omni.ui._ui.MultiStringField, *args, **kwargs) -> None

class omni.ui.Percent(self: omni.ui._ui.Percent, value: float)None

Bases: omni.ui._ui.Length

Convenience class to express Length in percents.

class omni.ui.Pixel(self: omni.ui._ui.Pixel, value: float)None

Bases: omni.ui._ui.Length

Convenience class to express Length in pixels.

class omni.ui.Placer(self: omni.ui._ui.Placer, **kwargs)None

Bases: omni.ui._ui.Container

TODO

property drag_axis
property draggable
property offset_x
property offset_y
set_offset_x_changed_fn(self: omni.ui._ui.Placer, arg0: Callable[[omni.ui._ui.Length], None])None
set_offset_y_changed_fn(self: omni.ui._ui.Placer, arg0: Callable[[omni.ui._ui.Length], None])None
property stable_size
class omni.ui.Plot(self: omni.ui._ui.Plot, type: omni.ui._ui.Type = Type.LINE, scale_min: float = 3.4028234663852886e+38, scale_max: float = 3.4028234663852886e+38, *args, **kwargs)None

Bases: omni.ui._ui.Widget

The Plot widget plot an image to display.

Keyword Args:

type: This property holds the type of the plot’s image. By default, the image is displayed as line.

scale_min: This property holds the scale min values of the plot’s image. By default, the scale min is FLT_MAX.

scale_max: This property holds the scale max values of the plot’s image. By default, the scale max is FLT_MAX.

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 as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

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 fallow 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 event if is the top most widget setup this options to true to enable you to capture the events so they don’t also get routed to the bellow widgets

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)

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)

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)

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)

drag_fn: Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

accept_drop_fn: 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: Specify that this Widget accepts drops and set the callback to the drop operation.

Plot an image with the given data.

property scale_max

This property holds the scale max values of the plot’s image. By default, the scale max is FLT_MAX.

property scale_min

This property holds the scale min values of the plot’s image. By default, the scale min is FLT_MAX.

set_data(self: omni.ui._ui.Plot, *args)None

Sets the image data.

set_data_provider_fn(self: omni.ui._ui.Plot, arg0: Callable[[int], float], arg1: int)None

Sets the function that will be called when plot image.

property title

This property holds the image title. By default, the title is “”.

property type

This property holds the type of the plot’s image. By default, the image is displayed as line.

property value_offset

This property holds the value offset. By default, the value offset is 0.

property value_stride

This property holds the stride of value list. By default, the value stride is 1.

class omni.ui.ProgressBar(self: omni.ui._ui.ProgressBar, model: omni.ui._ui.AbstractValueModel = None, **kwargs)None

Bases: omni.ui._ui.Widget, omni.ui._ui.ValueModelHelper

TODO

class omni.ui.RadioButton(self: omni.ui._ui.RadioButton, **kwargs)None

Bases: omni.ui._ui.Button

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.

Keyword Args:

radio_collection: This property holds the button’s text.

text: This property holds the button’s text.

image_url: This property holds the button’s optional image URL.

image_width: This property holds the width of the image widget. Do not use this function to find the width of the image.

image_height: This property holds the height of the image widget. Do not use this function to find the height of the image.

spacing: Sets a non-stretchable space in points between image and text.

clicked_fn: 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: 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 as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

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 fallow 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 event if is the top most widget setup this options to true to enable you to capture the events so they don’t also get routed to the bellow widgets

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)

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)

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)

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)

drag_fn: Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

accept_drop_fn: 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: Specify that this Widget accepts drops and set the callback to the drop operation.

property radio_collection

This property holds the button’s text.

class omni.ui.RadioCollection(self: omni.ui._ui.RadioCollection, model: omni.ui._ui.AbstractValueModel = None, **kwargs)None

Bases: omni.ui._ui.ValueModelHelper

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.

Keyword Args:

class omni.ui.RasterImageProvider(self: omni.ui._ui.RasterImageProvider, **kwargs)None

Bases: omni.ui._ui.ImageProvider

doc

doc

property max_mip_levels

Maximum number of mip map levels allowed

property source_url

Sets byte data that the image provider will turn into an image.

class omni.ui.Rectangle(self: omni.ui._ui.Rectangle, **kwargs)None

Bases: omni.ui._ui.Widget

The Rectangle widget provides a colored rectangle to display.

Keyword Args:

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 as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

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 fallow 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 event if is the top most widget setup this options to true to enable you to capture the events so they don’t also get routed to the bellow widgets

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)

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)

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)

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)

drag_fn: Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

accept_drop_fn: 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: Specify that this Widget accepts drops and set the callback to the drop operation.

class omni.ui.ScrollBarPolicy(self: omni.ui._ui.ScrollBarPolicy, arg0: int)None

Bases: pybind11_builtins.pybind11_object

Members:

SCROLLBAR_AS_NEEDED

SCROLLBAR_ALWAYS_OFF

SCROLLBAR_ALWAYS_ON

SCROLLBAR_ALWAYS_OFF = ScrollBarPolicy.SCROLLBAR_ALWAYS_OFF
SCROLLBAR_ALWAYS_ON = ScrollBarPolicy.SCROLLBAR_ALWAYS_ON
SCROLLBAR_AS_NEEDED = ScrollBarPolicy.SCROLLBAR_AS_NEEDED
property name

handle) -> str

Type

(self

class omni.ui.ScrollingFrame(self: omni.ui._ui.ScrollingFrame, **kwargs)None

Bases: omni.ui._ui.Frame

TODO

property horizontal_scrollbar_policy
property scroll_x
property scroll_y
set_scroll_x_changed_fn(self: omni.ui._ui.ScrollingFrame, arg0: Callable[[float], None])None
set_scroll_y_changed_fn(self: omni.ui._ui.ScrollingFrame, arg0: Callable[[float], None])None
property vertical_scrollbar_policy
class omni.ui.Separator(self: omni.ui._ui.Separator, **kwargs)None

Bases: omni.ui._ui.Widget

TODO

class omni.ui.Shape

Bases: omni.ui._ui.Widget

The Shape widget provides a base class for all the Shape Widget currently implemented are Rectangle, Circle, Tiangle, Line TODO: those need to have a special draw overide to deal with intersection better.

Keyword Args:

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 as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

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 fallow 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 event if is the top most widget setup this options to true to enable you to capture the events so they don’t also get routed to the bellow widgets

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)

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)

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)

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)

drag_fn: Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

accept_drop_fn: 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: Specify that this Widget accepts drops and set the callback to the drop operation.

class omni.ui.SimpleBoolModel(self: omni.ui._ui.SimpleBoolModel, default_value: bool = False, **kwargs)None

Bases: omni.ui._ui.AbstractValueModel

A very simple bool model.

get_max(self: omni.ui._ui.SimpleBoolModel)bool
get_min(self: omni.ui._ui.SimpleBoolModel)bool
property max

This property holds the model’s maximum value.

property min

This property holds the model’s minimum value.

set_max(self: omni.ui._ui.SimpleBoolModel, arg0: bool)None
set_min(self: omni.ui._ui.SimpleBoolModel, arg0: bool)None
class omni.ui.SimpleFloatModel(self: omni.ui._ui.SimpleFloatModel, default_value: float = 0.0, **kwargs)None

Bases: omni.ui._ui.AbstractValueModel

A very simple double model.

get_max(self: omni.ui._ui.SimpleFloatModel)float
get_min(self: omni.ui._ui.SimpleFloatModel)float
property max

This property holds the model’s minimum value.

property min

This property holds the model’s minimum value.

set_max(self: omni.ui._ui.SimpleFloatModel, arg0: float)None
set_min(self: omni.ui._ui.SimpleFloatModel, arg0: float)None
class omni.ui.SimpleIntModel(self: omni.ui._ui.SimpleIntModel, default_value: int = 0, **kwargs)None

Bases: omni.ui._ui.AbstractValueModel

A very simple Int model.

get_max(self: omni.ui._ui.SimpleIntModel)int
get_min(self: omni.ui._ui.SimpleIntModel)int
property max

This property holds the model’s minimum value.

property min

This property holds the model’s minimum value.

set_max(self: omni.ui._ui.SimpleIntModel, arg0: int)None
set_min(self: omni.ui._ui.SimpleIntModel, arg0: int)None
class omni.ui.SimpleStringModel(self: omni.ui._ui.SimpleStringModel, defaultValue: str = '')None

Bases: omni.ui._ui.AbstractValueModel

A very simple value model that holds a single string.

class omni.ui.SliderDrawMode(self: omni.ui._ui.SliderDrawMode, arg0: int)None

Bases: pybind11_builtins.pybind11_object

Members:

FILLED

HANDLE

DRAG

DRAG = SliderDrawMode.DRAG
FILLED = SliderDrawMode.FILLED
HANDLE = SliderDrawMode.HANDLE
property name

handle) -> str

Type

(self

class omni.ui.Spacer(self: omni.ui._ui.Spacer, **kwargs)None

Bases: omni.ui._ui.Widget

TODO

class omni.ui.Stack(self: omni.ui._ui.Stack, arg0: omni.ui._ui.Direction, **kwargs)None

Bases: omni.ui._ui.Container

The Stack class lines up child widgets horizontally, vertically or sorted in a Z-order.

Keyword Args:

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 aertical column, from top to bottom. If the Stack’s orientation is eBottomToTop, the widgets are placed in a aertical 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.

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 as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

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 fallow 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 event if is the top most widget setup this options to true to enable you to capture the events so they don’t also get routed to the bellow widgets

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)

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)

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)

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)

drag_fn: Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

accept_drop_fn: 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: Specify that this Widget accepts drops and set the callback to the drop operation.

Constructor.

Args:

direction: Determines the orientation of the Stack.

property content_clipping

Determines if the child widgets should be clipped by the rectangle of this Stack.

property 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 aertical column, from top to bottom. If the Stack’s orientation is eBottomToTop, the widgets are placed in a aertical 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.

property spacing

Sets a non-stretchable space in pixels between child items of this layout.

class omni.ui.StringField(self: omni.ui._ui.StringField, model: omni.ui._ui.AbstractValueModel = None, **kwargs)None

Bases: omni.ui._ui.AbstractField

The StringField widget is a one-line text editor with a string model.

Keyword Args:

password_mode: This property holds the if the field is in the password mode when the entered text is obscured.

read_only: This property holds the if the field is read-only.

multiline: Multiline allows to press enter and and create a new line.

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 as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

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 fallow 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 event if is the top most widget setup this options to true to enable you to capture the events so they don’t also get routed to the bellow widgets

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)

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)

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)

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)

drag_fn: Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

accept_drop_fn: 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: Specify that this Widget accepts drops and set the callback to the drop operation.

property multiline

Multiline allows to press enter and and create a new line.

property password_mode

This property holds the if the field is in the password mode when the entered text is obscured.

property read_only

This property holds the if the field is read-only.

class omni.ui.TextureFormat(self: omni.ui._ui.TextureFormat, arg0: int)None

Bases: pybind11_builtins.pybind11_object

Members:

RGBA8_UNORM

RGBA8_SRGB

RGBA8_SRGB = TextureFormat.RGBA8_SRGB
RGBA8_UNORM = TextureFormat.RGBA8_UNORM
property name

handle) -> str

Type

(self

class omni.ui.ToolBar(self: omni.ui._ui.ToolBar, title: str, **kwargs)None

Bases: omni.ui._ui.Window

TODO: ToolBar is a starting point for every new UI.

property axis
set_axis_changed_fn(self: omni.ui._ui.ToolBar, arg0: Callable[[omni.ui._ui.ToolBarAxis], None])None
class omni.ui.ToolBarAxis(self: omni.ui._ui.ToolBarAxis, arg0: int)None

Bases: pybind11_builtins.pybind11_object

Members:

X

Y

X = ToolBarAxis.X
Y = ToolBarAxis.Y
property name

handle) -> str

Type

(self

class omni.ui.ToolButton(self: omni.ui._ui.ToolButton, model: omni.ui._ui.AbstractValueModel = None, **kwargs)None

Bases: omni.ui._ui.Button, omni.ui._ui.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.

Keyword Args:

text: This property holds the button’s text.

image_url: This property holds the button’s optional image URL.

image_width: This property holds the width of the image widget. Do not use this function to find the width of the image.

image_height: This property holds the height of the image widget. Do not use this function to find the height of the image.

spacing: Sets a non-stretchable space in points between image and text.

clicked_fn: 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: 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 as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

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 fallow 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 event if is the top most widget setup this options to true to enable you to capture the events so they don’t also get routed to the bellow widgets

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)

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)

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)

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)

drag_fn: Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

accept_drop_fn: 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: Specify that this Widget accepts drops and set the callback to the drop operation.

Construct a checkable button with the model. If the bodel is not provided, then the default model is created.

Args:

model: The model that determines if the button is checked.

class omni.ui.TreeView(*args, **kwargs)

Bases: omni.ui._ui.Widget, omni.ui._ui.ItemModelHelper

TreeView 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.

Keyword Args:

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 useul 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 droped between items.

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.

selection_changed_fn: Set the callback that is called when the selection is changed.

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 as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

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 fallow 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 event if is the top most widget setup this options to true to enable you to capture the events so they don’t also get routed to the bellow widgets

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)

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)

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)

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)

drag_fn: Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

accept_drop_fn: 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: Specify that this Widget accepts drops and set the callback to the drop operation.

Overloaded function.

  1. __init__(self: omni.ui._ui.TreeView, **kwargs) -> None

Create TreeView with default model

  1. __init__(self: omni.ui._ui.TreeView, arg0: omni.ui._ui.AbstractItemModel, **kwargs) -> None

Create TreeView with the given model.

Args:

model: The given model.

clear_selection(self: omni.ui._ui.TreeView)None

Deselects all selected items.

property column_widths

Widths of the columns. If not set, the width is Fraction(1).

property columns_resizable

When true, the columns can be resized with the mouse.

dirty_widgets(self: omni.ui._ui.TreeView)None

When called, it will make the delerate to regenerate all visible widgets the next frame.

property drop_between_items

When true, the tree nodes can be droped between items.

property 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.

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.

property header_visible

This property holds if the header is shown or not.

is_expanded(self: omni.ui._ui.TreeView, item: omni.ui._ui.AbstractItem)bool

Returns true if the given item is expanded.

property keep_alive

When true, the tree nodes are never destroyed even if they are disappeared from the model. It’s useul for the temporary filtering if it’s necessary to display thousands of nodes.

property keep_expanded

Expand all the nodes and keep them expanded regardless their state.

property root_visible

This property holds if the root is shown. It can be used to make a single level tree appear like a simple list.

property selection

Set current selection.

set_expanded(self: omni.ui._ui.TreeView, item: omni.ui._ui.AbstractItem, expanded: bool, recursive: bool)None

Sets the given item expanded or collapsed.

Args:

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.

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 selection is changed.

toggle_selection(self: omni.ui._ui.TreeView, item: omni.ui._ui.AbstractItem)None

Switches the selection state of the given item.

class omni.ui.Triangle(self: omni.ui._ui.Triangle, **kwargs)None

Bases: omni.ui._ui.Shape

The Triangle widget provides a colored rectangle to display.

Keyword Args:

alignment: This property holds the alignment of the circle when the fill policy is ePreserveAspectFit or ePreserveAspectCrop. By default, the circle is centered.

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 as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

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 fallow 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 event if is the top most widget setup this options to true to enable you to capture the events so they don’t also get routed to the bellow widgets

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)

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)

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)

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)

drag_fn: Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

accept_drop_fn: 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: Specify that this Widget accepts drops and set the callback to the drop operation.

property alignment

This property holds the alignment of the circle when the fill policy is ePreserveAspectFit or ePreserveAspectCrop. By default, the circle is centered.

class omni.ui.Type(self: omni.ui._ui.Type, arg0: int)None

Bases: pybind11_builtins.pybind11_object

Members:

LINE

HISTOGRAM

HISTOGRAM = Type.HISTOGRAM
LINE = Type.LINE
property name

handle) -> str

Type

(self

class omni.ui.UIntDrag(self: omni.ui._ui.UIntDrag, model: omni.ui._ui.AbstractValueModel = None, **kwargs)None

Bases: omni.ui._ui.UIntSlider

Keyword Args:

step: This property control the steping speed on the drag, its float to enable slower speed but off course the value on the Control are still integer.

min: This property holds the slider’s minimum value.

max: This property holds the slider’s maximum value.

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 as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

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 fallow 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 event if is the top most widget setup this options to true to enable you to capture the events so they don’t also get routed to the bellow widgets

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)

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)

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)

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)

drag_fn: Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

accept_drop_fn: 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: Specify that this Widget accepts drops and set the callback to the drop operation.

property step

This property control the steping speed on the drag, its float to enable slower speed but off course the value on the Control are still integer.

class omni.ui.UIntSlider(self: omni.ui._ui.UIntSlider, model: omni.ui._ui.AbstractValueModel = None, **kwargs)None

Bases: omni.ui._ui.AbstractSlider

The slider is the classic widget for controlling a bounded value. It lets the user move a slider handle along a horizontal groove and translates the handle’s position into an integer value within the legal range. The difference with IntSlider is that UIntSlider has unsigned min/max.

Keyword Args:

min: This property holds the slider’s minimum value.

max: This property holds the slider’s maximum value.

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 as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

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 fallow 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 event if is the top most widget setup this options to true to enable you to capture the events so they don’t also get routed to the bellow widgets

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)

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)

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)

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)

drag_fn: Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

accept_drop_fn: 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: Specify that this Widget accepts drops and set the callback to the drop operation.

property max

This property holds the slider’s maximum value.

property min

This property holds the slider’s minimum value.

class omni.ui.UnitType(self: omni.ui._ui.UnitType, arg0: int)None

Bases: pybind11_builtins.pybind11_object

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

FRACTION = UnitType.FRACTION
PERCENT = UnitType.PERCENT
PIXEL = UnitType.PIXEL
property name

handle) -> str

Type

(self

class omni.ui.VGrid(self: omni.ui._ui.VGrid, **kwargs)None

Bases: omni.ui._ui.Grid

Shortcut for Grid{eTopToBottom}. The grid grows from top to bottom with the widgets placed.

Keyword Args:

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.

row_height: 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.

column_count: 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.

row_count: 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.

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 aertical column, from top to bottom. If the Stack’s orientation is eBottomToTop, the widgets are placed in a aertical 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.

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 as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

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 fallow 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 event if is the top most widget setup this options to true to enable you to capture the events so they don’t also get routed to the bellow widgets

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)

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)

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)

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)

drag_fn: Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

accept_drop_fn: 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: Specify that this Widget accepts drops and set the callback to the drop operation.

Construct a grid that grows from top to bottom with the widgets placed.

class omni.ui.VStack(self: omni.ui._ui.VStack, **kwargs)None

Bases: omni.ui._ui.Stack

Shortcut for Stack{eTopToBottom}. The widgets are placed in a column, with suitable sizes.

Keyword Args:

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 aertical column, from top to bottom. If the Stack’s orientation is eBottomToTop, the widgets are placed in a aertical 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.

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 as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

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 fallow 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 event if is the top most widget setup this options to true to enable you to capture the events so they don’t also get routed to the bellow widgets

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)

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)

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)

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)

drag_fn: Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

accept_drop_fn: 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: Specify that this Widget accepts drops and set the callback to the drop operation.

Construct a stack with the widgets placed in a column from top to bottom.

class omni.ui.ValueModelHelper

Bases: pybind11_builtins.pybind11_object

TODO

property model
class omni.ui.VectorImageProvider(self: omni.ui._ui.VectorImageProvider, **kwargs)None

Bases: omni.ui._ui.ImageProvider

doc

doc

property max_mip_levels

Maximum number of mip map levels allowed

property source_url

Sets the vector image URL. Asset loading doesn’t happen immediately, but rather is started the next time widget is visible, in prepareDraw call.

class omni.ui.Widget

Bases: pybind11_builtins.pybind11_object

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.

Keyword Args:

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 as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

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 fallow 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 event if is the top most widget setup this options to true to enable you to capture the events so they don’t also get routed to the bellow widgets

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)

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)

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)

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)

drag_fn: Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

accept_drop_fn: 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: Specify that this Widget accepts drops and set the callback to the drop operation.

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.

property computed_content_height

Returns the final computed height of the content of the widget. It’s in puplic section. For the explanation why please see the draw() method.

property computed_content_width

Returns the final computed width of the content of the widget. It’s in puplic section. For the explanation why please see the draw() method.

property computed_height

Returns the final computed height of the widget. It includes margins. It’s in puplic section. For the explanation why please see the draw() method.

property computed_width

Returns the final computed width of the widget. It includes margins. It’s in puplic section. For the explanation why please see the draw() method.

property dragging

This property holds if the widget is being dragged.

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.

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.

property name

The name of the widget that user can set.

property opaque_for_mouse_events

if the widgets has callback functions it will by default not capture the events event if is the top most widget setup this options to true to enable you to capture the events so they don’t also get routed to the bellow widgets

property screen_position_x

Returns the X Screen coordinate the widget was last draw this is in Screen Pixel size. It’s float because we need negative numbers and precise position considerring DPI scale factor.

property screen_position_y

Returns the Y Screen coordinate the widget was last draw this is in Screen Pixel size. It’s float because we need negative numbers and precise position considerring DPI scale factor.

scroll_here(self: omni.ui._ui.Widget, center_ratio_x: float = 0.0, center_ratio_y: float = 0.0)None

Adjust scrolling amount in two axes to make current item visible.

Args:

centerRatioX: 0.0: left, 0.5: center, 1.0: right centerRatioY: 0.0: top, 0.5: center, 1.0: bottom

scroll_here_x(self: omni.ui._ui.Widget, center_ratio: float = 0.0)None

Adjust scrolling amount to make current item visible.

Args:

centerRatio: 0.0: left, 0.5: center, 1.0: right

scroll_here_y(self: omni.ui._ui.Widget, center_ratio: float = 0.0)None

Adjust scrolling amount to make current item visible.

Args:

centerRatio: 0.0: top, 0.5: center, 1.0: bottom

property selected

This property holds a flag that specifies the widget has to use eSelected state of the style.

set_accept_drop_fn(self: omni.ui._ui.Widget, fn: Callable[[str], bool])None

Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

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, arg0: Callable[[int, int, bool], None])None

Sets the function that will be called when the user presses the keyboard key when the mouse hovers the widget. void onKeyboardKey(int32_t key, carb::input::KeyboardModifierFlags modifier, bool pressed)

set_mouse_double_clicked_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 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(self: omni.ui._ui.Widget, fn: Callable[[bool], None])None

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(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(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(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 if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

set_mouse_wheel_fn(self: omni.ui._ui.Widget, fn: Callable[[float, float, int], None])None

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_style(self: omni.ui._ui.Widget, arg0: handle)None

Set the current style. The style contains a description of customizations to the widget’s style.

set_tooltip(self: omni.ui._ui.Widget, tooltip_label: str)None

set a basic tooltip for the widget, this will simply be a Label, it will fallow the Tooltip style

set_tooltip_fn(self: omni.ui._ui.Widget, fn: Callable[[], None])None

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.

property 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.

property 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 as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

property 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.

class omni.ui.WidgetMouseDropEvent

Bases: pybind11_builtins.pybind11_object

Holds the data which is sent when a drag and drop action is completed.

property mime_data

The data that was dropped on the widget.

property x

Position where the drop was made.

property y

Position where the drop was made.

class omni.ui.Window(self: omni.ui._ui.Window, title: str, dockPreference: omni.ui._ui.DockPreference = DockPreference.DISABLED, **kwargs)None

Bases: omni.ui._ui.WindowHandle

The Window class represents a window in the underlying windowing system. This window is a child window of main Kit window. And it can be docked.

Keyword Args:

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

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.

Construct the window, add it to the underlying windowing system, and makes it appear.

property auto_resize

setup the window to resize automatically based on its content

deferred_dock_in(self: omni.ui._ui.Window, target_window: str, active_window: omni.ui._ui.DockPolicy = DockPolicy.DO_NOTHING)None

Deferred docking. We need it when we want to dock windows before they was actually created. It’s helpful when extension initialization, before any window is created.

Args:

targetWindowTitle: Dock to window with this title when it appears. activeWindow: Make target or this window active when docked.

dock_in_window(self: omni.ui._ui.Window, title: str, dockPosition: omni.ui._ui.DockPosition, ratio: float = 0.5)bool

place the window in a specific docking position based on a target window nane We will find the target window dock node and insert this window in it, either by spliting on ratio or on top if the window is not found false is return, otherwise true

property docked

Has true if this window is docked. False otherwise. It’s a read-only property.

property exclusive_keyboard

When true, only the current window will receive keyboard events when it’s focused. It’s useful to override the global key bindings.

property flags

This property set the Flags for the Window.

property frame

The main layout of this window.

get_window_callback(self: omni.ui._ui.Window) → omni::ui::windowmanager::IWindowCallback

Returns window set draw callback pointer for the given UI window.

property height

This property holds the window Height.

property menu_bar
property 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

notify_app_window_change(self: omni.ui._ui.Window, arg0: omni::kit::IAppWindow)None

Notifies the window that window set has changed.

property padding_x

This property set the padding to the frame on the X axis.

property padding_y

This property set the padding to the frame on the Y axis.

property 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.

property 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.

setPosition(self: omni.ui._ui.Window, x: float, y: float)None

This property set/get the position of the window in both axis calling the property.

set_docked_changed_fn(self: omni.ui._ui.Window, arg0: Callable[[bool], None])None

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.

set_height_changed_fn(self: omni.ui._ui.Window, arg0: Callable[[float], None])None

This property holds the window Height.

set_key_pressed_fn(self: omni.ui._ui.Window, arg0: Callable[[int, int, bool], None])None

Sets the function that will be called when the user presses the keyboard key on the focused window. void onKeyboardKey(int32_t key, carb::input::KeyboardModifierFlags modifier, bool pressed)

set_position_x_changed_fn(self: omni.ui._ui.Window, arg0: Callable[[float], None])None

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.

set_position_y_changed_fn(self: omni.ui._ui.Window, arg0: Callable[[float], None])None

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.

set_top_modal(self: omni.ui._ui.Window)None

Brings this window to the top level of modal windows.

set_visibility_changed_fn(self: omni.ui._ui.Window, arg0: Callable[[bool], None])None

This property holds whether the window is visible.

set_width_changed_fn(self: omni.ui._ui.Window, arg0: Callable[[float], None])None

This property holds the window Width.

property title

This property holds the window’s title.

property visible

This property holds whether the window is visible.

property width

This property holds the window Width.

class omni.ui.WindowHandle

Bases: pybind11_builtins.pybind11_object

WindowHandle is a handle object to control any of the windows in Kit. It can be created any time, and if it’s destroyed, the source window doesn’t disappear.

Keyword Args:

dock_in(self: omni.ui._ui.WindowHandle, window: omni.ui._ui.WindowHandle, dock_position: omni.ui._ui.DockPosition, ratio: float = 0.5)None

Dock the window to the existing window. It can split the window to two parts or it can convert the window to a docking tab.

property dock_order

The position of the window in the dock.

property dock_tab_bar_visible

Checks if the current docking space has the tab bar.

property docked

True if this window is docked. False otherwise.

focus(self: omni.ui._ui.WindowHandle)None

Brings the window to the top. If it’s a docked window, it makes the window currently visible in the dock.

property height

The height of the window in points.

notify_app_window_change(self: omni.ui._ui.WindowHandle, arg0: omni::kit::IAppWindow)None

Notifies the UI window that the AppWindow it attached to has changed.

property position_x

The position of the window in points.

property position_y

The position of the window in points.

property title

The title of the window.

undock(self: omni.ui._ui.WindowHandle)None

Undock the window and make it floating.

property visible

Returns whether the window is visible.

property width

The width of the window in points.

class omni.ui.Workspace

Bases: pybind11_builtins.pybind11_object

Workspace object provides access to the windows in Kit.

Keyword Args:

static clear()None

Undock all.

static get_docked_neighbours(member: omni.ui._ui.WindowHandle) → List[omni.ui._ui.WindowHandle]

Get all the windows that docked with the given widow.

static get_dpi_scale()float

Returns current DPI Scale.

static get_main_window_height()float

Get the height in points of the current main window.

static get_main_window_width()float

Get the width in points of the current main window.

static get_window(title: str) → omni.ui._ui.WindowHandle

Find Window by name.

static get_window_from_callback(callback: omni::ui::windowmanager::IWindowCallback) → omni.ui._ui.WindowHandle

Find Window by window callback.

static get_windows() → List[omni.ui._ui.WindowHandle]

Returns the list of windows ordered from back to front. If the window is a Omni::UI window, it can be upcasted.

class omni.ui.ZStack(self: omni.ui._ui.ZStack, **kwargs)None

Bases: omni.ui._ui.Stack

Shortcut for Stack{eBackToFront}. The widgets are placed sorted in a Z-order in top right corner with suitable sizes.

Keyword Args:

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 aertical column, from top to bottom. If the Stack’s orientation is eBottomToTop, the widgets are placed in a aertical 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.

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 as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

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 fallow 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 event if is the top most widget setup this options to true to enable you to capture the events so they don’t also get routed to the bellow widgets

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)

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)

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)

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)

drag_fn: Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

accept_drop_fn: 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: Specify that this Widget accepts drops and set the callback to the drop operation.

Construct a stack with the widgets placed in a Z-order with sorting from background to foreground.

omni.ui.dock_window_in_window(arg0: str, arg1: str, arg2: omni.ui._ui.DockPosition, arg3: float)bool

place a named window in a specific docking position based on a target window nane We will find the target window dock node and insert this named window in it, either by spliting on ratio or on top if the windows is not found false is return, otherwise true

omni.ui.get_custom_glyph_code(file_path: str, font_style: omni.ui._ui.FontStyle = FontStyle.NORMAL)str

Get glyph code.

Parameters
  • file_path (str) – Path to svg file

  • font_style (FontStyle) – font style to use.

omni.ui.get_main_window_height()float

Get the height in ponts of the current main window.

omni.ui.get_main_window_width()float

Get the width in ponts of the current main window.