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.

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

AbstractItemDelegate is used to generate widgets that display and edit data items from a model.

Constructs AbstractItemDelegate.

Parameters

kwargs (dict) – See below

Keyword Arguments

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

This pure abstract method must be reimplemented to generate custom collapse/expand button.

build_header(self: omni.ui._ui.AbstractItemDelegate, column_id: int = 0)None

This pure abstract method must be reimplemented to generate custom widgets for the header table.

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

This pure abstract method must be reimplemented to generate custom widgets for specific item in the model.

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. The overall architecture is described in the following drawing: # 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.

Constructs AbstractItemModel.

Parameters

kwargs (dict) – See below

Keyword Arguments

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.

Parameters

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.

Parameters

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.

Parameters
  • 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.

Parameters

id – The id that addBeginEditFn returns.

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

Remove the callback by its id.

Parameters

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.

Parameters

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.

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

The abstract widget that is base for drags and sliders.

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

Bases: pybind11_builtins.pybind11_object

Constructs AbstractValueModel.

Parameters

kwargs (dict) – See below

Keyword Arguments

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.

Parameters

id – The id that addBeginEditFn returns.

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

Remove the callback by its id.

Parameters

id – The id that addEndEditFn returns.

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

Remove the callback by its id.

Parameters

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:

UNDEFINED

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
UNDEFINED = Alignment.UNDEFINED
V_CENTER = Alignment.V_CENTER
property name

handle) -> str

Type

(self

class omni.ui.ArrowHelper

Bases: pybind11_builtins.pybind11_object

The Arrow class provides a colored arrow to display.

property begin_arrow_height

This property holds the height of the begin Arrow. By default, the height is 8.

property begin_arrow_type

This property holds the type of the begin Arrow can only NONE or ARROW. By default, the type is NONE.

property begin_arrow_width

This property holds the width of the begin Arrow. By default, the width is 8.

property end_arrow_height

This property holds the height of the end Arrow. By default, the height is 8.

property end_arrow_type

This property holds the type of the end Arrow can only NONE or ARROW .By default, the type is NONE.

property end_arrow_width

This property holds the width of the end Arrow. By default, the width is 8.

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

Bases: pybind11_builtins.pybind11_object

Members:

NONE

ARROW

ARROW = ArrowType.ARROW
NONE = ArrowType.NONE
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.BezierCurve(self: omni.ui._ui.BezierCurve, **kwargs)None

Bases: omni.ui._ui.Shape, omni.ui._ui.ArrowHelper

Smooth curve that can be scaled indefinitely.

call_mouse_hovered_fn(self: omni.ui._ui.BezierCurve, arg0: bool)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. The function specification is: void onMouseHovered(bool hovered)

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.

has_mouse_hovered_fn(self: omni.ui._ui.BezierCurve)bool

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. The function specification is: void onMouseHovered(bool hovered)

set_mouse_hovered_fn(self: omni.ui._ui.BezierCurve, 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. The 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.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.

Construct a button with a text on it.

Parameters
  • text – The text for the button to use.

  • kwargs (dict) – See below

Keyword Arguments
  • text (str) – This property holds the button’s text.

  • image_url (str) – This property holds the button’s optional image URL.

  • image_width (float) – This property holds the width of the image widget. Do not use this function to find the width of the image.

  • image_height (float) – This property holds the height of the image widget. Do not use this function to find the height of the image.

  • spacing (float) – Sets a non-stretchable space in points between image and text.

  • clicked_fn (Callable[[], None]) – Sets the function that will be called when when the button is activated (i.e., pressed down then released while the mouse cursor is inside the button).

  • width (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

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: sequence, sizes: List[int], format: omni.ui._ui.TextureFormat = TextureFormat.???, stride: int = -1)None

Sets Python sequence as byte data. The image provider will recognize flattened color values, or sequence within sequence and convert it into an image.

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

[DEPRECATED FUNCTION]

set_raw_bytes_data(self: omni.ui._ui.ByteImageProvider, raw_bytes: capsule, sizes: List[int], format: omni.ui._ui.TextureFormat = TextureFormat.RGBA8_UNORM, stride: int = - 1)None

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

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.

Constructs CanvasFrame.

Parameters

kwargs (dict) – See below

Keyword Arguments
  • 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 (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

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 smooth_zoom

When true, zoom is smooth like in Bifrost even if the user is using mouse wheen that doesn’t provide smooth scrolling.

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.

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

Parameters

kwargs (dict) – See below

Keyword Arguments
  • width (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

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

Bases: omni.ui._ui.Shape

Constructs Circle.

Parameters

kwargs (dict) – See below

Keyword Arguments
  • 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 (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

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.

Constructs CollapsableFrame.

Parameters
  • text – The text for the caption of the frame.

  • kwargs (dict) – See below

Keyword Arguments
  • 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 (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

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.

call_build_header_fn(self: omni.ui._ui.CollapsableFrame, arg0: bool, arg1: str)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.

property collapsed

The state of the CollapsableFrame.

has_build_header_fn(self: omni.ui._ui.CollapsableFrame)bool

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_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.ColorStore

Bases: pybind11_builtins.pybind11_object

A singleton that stores all the UI Style color properties of omni.ui.

static find(name: str)int

Return the index of the color with specific name.

static store(name: str, color: int)None

Save the color by name.

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 to change the 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

Construct ColorWidget.

Parameters

kwargs (dict) – See below

Keyword Arguments
  • width (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

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. The ComboBox is implemented using the model-view pattern. The model is the central component of this system. The root of the item model should contain the index of currently selected items, and the children of the root include all the items of the combo box.

Construct ComboBox.

Parameters
  • model – The model that determines if the button is checked.

  • kwargs (dict) – See below

Keyword Arguments
  • arrow_only (bool) – Determines if it’s necessary to hide the text of the ComboBox.

  • width (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

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

The DockSpace class represents Dock Space for the OS Window.

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

Parameters

kwargs (dict) – See below

Keyword Arguments

property dock_frame

This represent Styling opportunity for the Window background.

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

Bases: omni.ui._ui.Shape

Constructs Ellipse.

Parameters

kwargs (dict) – See below

Keyword Arguments
  • width (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

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

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

Construct FloatDrag.

Parameters

kwargs (dict) – See below

Keyword Arguments
  • min (float) – This property holds the slider’s minimum value.

  • max (float) – This property holds the slider’s maximum value.

  • step (float) – This property controls the stepping speed on drag.

  • format (str) – This property overrides the display format given a printf-like string (i.e. ‘%.2f’).

An empty string disables the override.
  • width (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

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

Bases: omni.ui._ui.AbstractField

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

Construct FloatField.

Parameters

kwargs (dict) – See below

Keyword Arguments
  • width (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

class omni.ui.FloatSlider(self: omni.ui._ui.FloatSlider, 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 a float value within the legal range.

Construct FloatSlider.

Parameters

kwargs (dict) – See below

Keyword Arguments
  • min (float) – This property holds the slider’s minimum value.

  • max (float) – This property holds the slider’s maximum value.

  • step (float) – This property controls the stepping speed on drag.

  • format (str) – This property overrides the display format given a printf-like string (i.e. ‘%.2f’).

An empty string disables the override.
  • width (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

property format

This property overrides the display format given a printf-like string (i.e. ‘%.2f’). An empty string disables the override.

property max

This property holds the slider’s maximum value.

property min

This property holds the slider’s minimum value.

property step

This property controls the stepping speed on drag.

class omni.ui.FloatStore

Bases: pybind11_builtins.pybind11_object

A singleton that stores all the UI Style float properties of omni.ui.

static find(name: str)float

Return the index of the color with specific name.

static store(name: str, value: float)None

Save the color by name.

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

ULTRA

EXTRA_LARGE = FontStyle.EXTRA_LARGE
EXTRA_SMALL = FontStyle.EXTRA_SMALL
LARGE = FontStyle.LARGE
NONE = FontStyle.NONE
NORMAL = FontStyle.NORMAL
SMALL = FontStyle.SMALL
ULTRA = FontStyle.ULTRA
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

Fraction length is made to take the space of the parent widget, divides it up into a row of boxes, and makes each child widget fill one box.

Construct Fraction.

Parameters

kwargs (dict) – See below

Keyword Arguments

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().

Constructs Frame.

Parameters

kwargs (dict) – See below

Keyword Arguments
  • 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 (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

call_build_fn(self: omni.ui._ui.Frame)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.

has_build_fn(self: omni.ui._ui.Frame)bool

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

Smooth curve that can be scaled indefinitely.

The free widget is the widget that is independent of the layout. It means it is stuck to other widgets. When initializing, it’s necessary to provide two widgets, and the shape is drawn from one widget position to the another.

The free widget is the widget that is independent of the layout. It means it is stuck to other widgets. When initializing, it’s necessary to provide two widgets, and the shape is drawn from one widget position to the another.

Initialize the the shape with bounds limited to the positions of the given widgets.

Parameters
  • start – The bound corder is in the center of this given widget.

  • end – The bound corder is in the center of this given widget.

  • kwargs (dict) – See below

Keyword Arguments

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. The function specification is: void onMouseHovered(bool hovered)

  • width (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

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

Bases: omni.ui._ui.Circle

The Circle widget provides a colored rectangle to display.

The free widget is the widget that is independent of the layout. It means it is stuck to other widgets. When initializing, it’s necessary to provide two widgets, and the shape is drawn from one widget position to the another.

The free widget is the widget that is independent of the layout. It means it is stuck to other widgets. When initializing, it’s necessary to provide two widgets, and the shape is drawn from one widget position to the another.

Initialize the the shape with bounds limited to the positions of the given widgets.

Parameters
  • start – The bound corder is in the center of this given widget.

  • end – The bound corder is in the center of this given widget.

  • kwargs (dict) – See below

Keyword Arguments
  • 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 (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

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

Bases: omni.ui._ui.Ellipse

The Ellipse widget provides a colored ellipse to display.

The free widget is the widget that is independent of the layout. It means it is stuck to other widgets. When initializing, it’s necessary to provide two widgets, and the shape is drawn from one widget position to the another.

The free widget is the widget that is independent of the layout. It means it is stuck to other widgets. When initializing, it’s necessary to provide two widgets, and the shape is drawn from one widget position to the another.

Initialize the the shape with bounds limited to the positions of the given widgets.

Parameters
  • start – The bound corder is in the center of this given widget.

  • end – The bound corder is in the center of this given widget.

  • kwargs (dict) – See below

Keyword Arguments
  • width (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

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

Bases: omni.ui._ui.Line

The Line widget provides a colored rectangle to display.

The free widget is the widget that is independent of the layout. It means it is stuck to other widgets. When initializing, it’s necessary to provide two widgets, and the shape is drawn from one widget position to the another.

The free widget is the widget that is independent of the layout. It means it is stuck to other widgets. When initializing, it’s necessary to provide two widgets, and the shape is drawn from one widget position to the another.

Initialize the the shape with bounds limited to the positions of the given widgets.

Parameters
  • start – The bound corder is in the center of this given widget.

  • end – The bound corder is in the center of this given widget.

  • kwargs (dict) – See below

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

  • width (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

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

Bases: omni.ui._ui.Rectangle

The Rectangle widget provides a colored rectangle to display.

The free widget is the widget that is independent of the layout. It means it is stuck to other widgets. When initializing, it’s necessary to provide two widgets, and the shape is drawn from one widget position to the another.

The free widget is the widget that is independent of the layout. It means it is stuck to other widgets. When initializing, it’s necessary to provide two widgets, and the shape is drawn from one widget position to the another.

Initialize the the shape with bounds limited to the positions of the given widgets.

Parameters
  • start – The bound corder is in the center of this given widget.

  • end – The bound corder is in the center of this given widget.

  • kwargs (dict) – See below

Keyword Arguments
  • width (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

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

Bases: omni.ui._ui.Triangle

The Triangle widget provides a colored rectangle to display.

The free widget is the widget that is independent of the layout. It means it is stuck to other widgets. When initializing, it’s necessary to provide two widgets, and the shape is drawn from one widget position to the another.

The free widget is the widget that is independent of the layout. It means it is stuck to other widgets. When initializing, it’s necessary to provide two widgets, and the shape is drawn from one widget position to the another.

Initialize the the shape with bounds limited to the positions of the given widgets.

Parameters
  • start – The bound corder is in the center of this given widget.

  • end – The bound corder is in the center of this given widget.

  • kwargs (dict) – See below

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

  • width (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

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.

Constructor.

Parameters
  • direction – Determines the direction the widget grows when adding more children.

  • kwargs (dict) – See below

Keyword Arguments
  • 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 (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

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.

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

Parameters

kwargs (dict) – See below

Keyword Arguments
  • 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 (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

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.

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

Parameters

kwargs (dict) – See below

Keyword Arguments
  • direction – This type is used to determine the direction of the layout. If the Stack’s orientation is eLeftToRight the widgets are placed in a horizontal row, from left to right. If the Stack’s orientation is eRightToLeft the widgets are placed in a horizontal row, from right to left. If the Stack’s orientation is eTopToBottom, the widgets are placed in a 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 (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

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.

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.

Parameters

kwargs (dict) – See below

Keyword Arguments
  • 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 (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

  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.

  • kwargs (dict) – See below

Keyword Arguments
  • 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 (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

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.

Overloaded function.

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

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

  3. __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. :type kwargs: dict :param kwargs: See below

Keyword Arguments
  • 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 (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

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

Bases: pybind11_builtins.pybind11_object

Inspector is the helper to check the internal state of the widget. It’s not recommended to use it for the routine UI.

static get_children(widget: omni.ui._ui.Widget) → List[omni.ui._ui.Widget]

Get the children of the given Widget.

static get_resolved_style(widget: omni.ui._ui.Widget) → omni::ui::StyleContainer

Get the resolved style of the given Widget.

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.

Constructs IntDrag.

Parameters
  • model – The widget’s model. If the model is not assigned, the default model is created.

  • kwargs (dict) – See below

Keyword Arguments
  • 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 (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

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

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

Construct IntField.

Parameters

kwargs (dict) – See below

Keyword Arguments
  • width (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

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.

Constructs IntSlider.

Parameters
  • model – The widget’s model. If the model is not assigned, the default model is created.

  • kwargs (dict) – See below

Keyword Arguments
  • min – This property holds the slider’s minimum value.

  • max – This property holds the slider’s maximum value.

  • width (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

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.

Constructor.

Parameters

kwargs (dict) – See below

Keyword Arguments
  • clicked_fn (Callable[[], None]) – Sets the function that will be called when when the button is activated (i.e., pressed down then released while the mouse cursor is inside the button).

  • width (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

call_clicked_fn(self: omni.ui._ui.InvisibleButton)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).

has_clicked_fn(self: omni.ui._ui.InvisibleButton)bool

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

set_clicked_fn(self: omni.ui._ui.InvisibleButton, fn: 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

The ItemModelHelper class provides the basic functionality for item widget classes.

property model

Returns the current 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.

Create a label with the given text.

Parameters
  • text – The text for the label.

  • kwargs (dict) – See below

Keyword Arguments
  • 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 (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

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

OMNI.UI has several different units for expressing a length. Many widget properties take “Length” values, such as width, height, minWidth, minHeight, etc. Pixel is the absolute length unit. Percent and Fraction are relative length units, and they specify a length relative to the parent length. Relative length units are scaled with the parent.

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

Construct Length.

Parameters

kwargs (dict) – See below

Keyword Arguments

property unit

(UnitType.) Unit.

property value

(float) Value

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

Bases: omni.ui._ui.Shape, omni.ui._ui.ArrowHelper

The Line widget provides a colored rectangle to display.

Constructs Line.

Parameters

kwargs (dict) – See below

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

  • width (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

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

The MainWindow class represents Main Window for the Application, draw optional MainMenuBar and StatusBar.

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

Parameters

kwargs (dict) – See below

Keyword Arguments

property cpp_status_bar_enabled

Workaround to reserve space for C++ status bar.

property main_frame

This represent Styling opportunity for the Window background.

property main_menu_bar

The main MenuBar for the application.

property status_bar_frame

The StatusBar Frame is empty by default and is meant to be filled by other part of the system.

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

Bases: omni.ui._ui.Container

The Menu class provides a menu widget for use in menu bars, context menus, and other popup menus. It can be either a pull-down menu in a menu bar or a standalone context menu. Pull-down menus are shown by the menu bar when the user clicks on the respective item. Context menus are usually invoked by some special keyboard key or by right-clicking.

Construct Menu.

Parameters
  • text – The text for the menu.

  • kwargs (dict) – See below

Keyword Arguments
  • width (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

show(self: omni.ui._ui.Menu)None

Create a popup window and show the menu in it. It’s usually used for context menus that are typically invoked by some special keyboard key or by right-clicking.

show_at(self: omni.ui._ui.Menu, arg0: float, arg1: float)None

Create a popup window and show the menu in it. This enable to popup the menu at specific position. X and Y are in points to make it easier to the Python users.

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

Bases: omni.ui._ui.Container

The MenuBar class provides a MenuBar at the top of the Window, could also be the MainMenuBar of the MainWindow. it can only contain Menu, at the moment there is no way to remove item appart from clearing it all together

Construct MenuBar.

Parameters

kwargs (dict) – See below

Keyword Arguments
  • width (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

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

Bases: omni.ui._ui.Widget

A MenuItem represents the items the Menu consists of. MenuItem can be inserted only once in the menu.

Construct MenuItem.

Parameters

kwargs (dict) – See below

Keyword Arguments
  • text (str) – This property holds the menu’s text.

  • hotkey_text (str) – This property holds the menu’s hotkey text.

  • checkable (bool) – This property holds whether this menu item is checkable. A checkable item is one which has an on/off state.

  • checked (bool) – Holds whether the menu item is checked. Only checkable items can be checked.

  • checked_changed_fn (Callable[[bool], None]) – Holds whether the menu item is checked. Only checkable items can be checked.

  • triggered_fn (void) – Sets the function that is called when an action is activated by the user; for example, when the user clicks a menu option, or presses an action’s shortcut key combination.

  • width (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

call_triggered_fn(self: omni.ui._ui.MenuItem)None

Sets the function that is called when an action is activated by the user; for example, when the user clicks a menu option, or presses an action’s shortcut key combination.

property checkable

This property holds whether this menu item is checkable. A checkable item is one which has an on/off state.

property checked

Holds whether the menu item is checked. Only checkable items can be checked.

has_triggered_fn(self: omni.ui._ui.MenuItem)bool

Sets the function that is called when an action is activated by the user; for example, when the user clicks a menu option, or presses an action’s shortcut key combination.

property hotkey_text

This property holds the menu’s hotkey text.

set_checked_changed_fn(self: omni.ui._ui.MenuItem, arg0: Callable[[bool], None])None

Holds whether the menu item is checked. Only checkable items can be checked.

set_triggered_fn(self: omni.ui._ui.MenuItem, fn: Callable[], None])None

Sets the function that is called when an action is activated by the user; for example, when the user clicks a menu option, or presses an action’s shortcut key combination.

property text

This property holds the menu’s 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.

Overloaded function.

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

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

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

Constructs MultiFloatDragField.

Parameters
  • model – The widget’s model. If the model is not assigned, the default model is created.

  • kwargs (dict) – See below

Keyword Arguments
  • min – This property holds the drag’s minimum value.

  • max – This property holds the drag’s maximum value.

  • step – This property 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 (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

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

Constructor.

Parameters

kwargs (dict) – See below

Keyword Arguments
  • 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 (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

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.

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

Constructs MultiIntDragField.

Parameters
  • model – The widget’s model. If the model is not assigned, the default model is created.

  • kwargs (dict) – See below

Keyword Arguments
  • min – This property holds the drag’s minimum value.

  • max – This property holds the drag’s maximum value.

  • step – This property 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 (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

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

Constructor.

Parameters

kwargs (dict) – See below

Keyword Arguments
  • 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 (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

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

Constructor.

Parameters

kwargs (dict) – See below

Keyword Arguments
  • 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 (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

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

Bases: omni.ui._ui.Length

Percent is the length in percents from the parent widget.

Construct Percent.

Parameters

kwargs (dict) – See below

Keyword Arguments

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

Bases: omni.ui._ui.Length

Pixel length is exact length in pixels.

Construct Pixel.

Parameters

kwargs (dict) – See below

Keyword Arguments

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

Bases: omni.ui._ui.Container

The Placer class place a single widget to a particular position based on the offet.

Construct Placer.

Parameters

kwargs (dict) – See below

Keyword Arguments
  • offset_x (toLength) – offsetX define the offset placement for the child widget relative to the Placer

  • offset_y (toLength) – offsetY define the offset placement for the child widget relative to the Placer

  • draggable (bool) – Provides a convenient way to make an item draggable.

  • drag_axis (Axis) – Sets if dragging can be horizontally or vertically.

  • stable_size (bool) – The placer size depends on the position of the child when false.

  • offset_x_changed_fn (Callable[[ui.Length], None]) – offsetX define the offset placement for the child widget relative to the Placer

  • offset_y_changed_fn (Callable[[ui.Length], None]) – offsetY define the offset placement for the child widget relative to the Placer

  • width (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

property drag_axis

Sets if dragging can be horizontally or vertically.

property draggable

Provides a convenient way to make an item draggable.

property offset_x

offsetX define the offset placement for the child widget relative to the Placer

property offset_y

offsetY define the offset placement for the child widget relative to the Placer

set_offset_x_changed_fn(self: omni.ui._ui.Placer, arg0: Callable[[omni.ui._ui.Length], None])None

offsetX define the offset placement for the child widget relative to the Placer

set_offset_y_changed_fn(self: omni.ui._ui.Placer, arg0: Callable[[omni.ui._ui.Length], None])None

offsetY define the offset placement for the child widget relative to the Placer

property stable_size

The placer size depends on the position of the child when false.

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 provides a line/histogram to display.

Construct Plot.

Parameters
  • type – The type of the image, can be line or histogram.

  • scaleMin – The minimal scale value.

  • scaleMax – The maximum scale value.

  • valueList – The list of values to draw the image.

  • kwargs (dict) – See below

Keyword Arguments
  • value_offset (int) – This property holds the value offset. By default, the value is 0.

  • value_stride (int) – This property holds the stride to get value list. By default, the value is 1.

  • title (str) – This property holds the title of the image.

  • width (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

property scale_max

This property holds the max scale values. By default, the value is FLT_MAX.

property scale_min

This property holds the min scale values. By default, the value is FLT_MAX.

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

Sets the image data value.

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

Sets the function that will be called when when data required.

property title

This property holds the title of the image.

property type

This property holds the type of the image, can only line or histogram. By default, the type is line.

property value_offset

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

property value_stride

This property holds the stride to get value list. By default, the value 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

A progressbar is a classic widget for showing the progress of an operation.

Construct ProgressBar.

Parameters
  • model – The model that determines if the button is checked.

  • kwargs (dict) – See below

Keyword Arguments
  • width (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

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.

Constructs RadioButton.

Parameters

kwargs (dict) – See below

Keyword Arguments
  • radio_collection – This property holds the button’s text.

  • text (str) – This property holds the button’s text.

  • image_url (str) – This property holds the button’s optional image URL.

  • image_width (float) – This property holds the width of the image widget. Do not use this function to find the width of the image.

  • image_height (float) – This property holds the height of the image widget. Do not use this function to find the height of the image.

  • spacing (float) – Sets a non-stretchable space in points between image and text.

  • clicked_fn (Callable[[], None]) – Sets the function that will be called when when the button is activated (i.e., pressed down then released while the mouse cursor is inside the button).

  • width (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

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.

Constructs RadioCollection.

Parameters

kwargs (dict) – See below

Keyword Arguments

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.

Constructs Rectangle.

Parameters

kwargs (dict) – See below

Keyword Arguments
  • width (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

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

The ScrollingFrame class provides the ability to scroll onto another widget. ScrollingFrame is used to display the contents of a child widget within a frame. If the widget exceeds the size of the frame, the frame can provide scroll bars so that the entire area of the child widget can be viewed. The child widget must be specified with addChild().

Construct ScrollingFrame.

Parameters

kwargs (dict) – See below

Keyword Arguments
  • scroll_x (float) – The horizontal position of the scroll bar. When it’s changed, the contents will be scrolled accordingly.

  • scroll_x_changed_fn (Callable[[float], None]) – The horizontal position of the scroll bar. When it’s changed, the contents will be scrolled accordingly.

  • scroll_y (float) – The vertical position of the scroll bar. When it’s changed, the contents will be scrolled accordingly.

  • scroll_y_changed_fn (Callable[[float], None]) – The vertical position of the scroll bar. When it’s changed, the contents will be scrolled accordingly.

  • horizontal_scrollbar_policy (ui.ScrollBarPolicy) – This property holds the policy for the horizontal scroll bar.

  • vertical_scrollbar_policy (ui.ScrollBarPolicy) – This property holds the policy for the vertical scroll bar.

  • horizontal_clipping – When the content of the frame is bigger than the frame the exceeding part is not drawn if the clipping is on. It only works for horizontal direction.

  • vertical_clipping – When the content of the frame is bigger than the frame the exceeding part is not drawn if the clipping is on. It only works for vertial direction.

  • separate_window – A 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 (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

property horizontal_scrollbar_policy

This property holds the policy for the horizontal scroll bar.

property scroll_x

The horizontal position of the scroll bar. When it’s changed, the contents will be scrolled accordingly.

property scroll_y

The vertical position of the scroll bar. When it’s changed, the contents will be scrolled accordingly.

set_scroll_x_changed_fn(self: omni.ui._ui.ScrollingFrame, arg0: Callable[[float], None])None

The horizontal position of the scroll bar. When it’s changed, the contents will be scrolled accordingly.

set_scroll_y_changed_fn(self: omni.ui._ui.ScrollingFrame, arg0: Callable[[float], None])None

The vertical position of the scroll bar. When it’s changed, the contents will be scrolled accordingly.

property vertical_scrollbar_policy

This property holds the policy for the vertical scroll bar.

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

Bases: omni.ui._ui.Widget

The Separator class provides blank space. Normally, it’s used to create separator line in the UI elements

Construct Separator.

Parameters

kwargs (dict) – See below

Keyword Arguments
  • width (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

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.

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

The Spacer class provides blank space. Normally, it’s used to place other widgets correctly in a layout.

Construct Spacer.

Parameters

kwargs (dict) – See below

Keyword Arguments
  • width (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

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.

Constructor.

Parameters
  • direction – Determines the orientation of the Stack.

  • kwargs (dict) – See below

Keyword Arguments
  • direction – This type is used to determine the direction of the layout. If the Stack’s orientation is eLeftToRight the widgets are placed in a horizontal row, from left to right. If the Stack’s orientation is eRightToLeft the widgets are placed in a horizontal row, from right to left. If the Stack’s orientation is eTopToBottom, the widgets are placed in a 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 (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

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.

Constructs StringField.

Parameters
  • model – The widget’s model. If the model is not assigned, the default model is created.

  • kwargs (dict) – See below

Keyword Arguments
  • 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 (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

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

Bases: pybind11_builtins.pybind11_object

A singleton that stores all the UI Style string properties of omni.ui.

static find(name: str)str

Return the index of the color with specific name.

static store(name: str, string: str)None

Save the color by name.

class omni.ui.Style

Bases: pybind11_builtins.pybind11_object

A singleton that controls the global style of the session.

property default

Set the default root style. It’s the style that is preselected when no alternative is specified.

static get_instance() → omni.ui._ui.Style

Get the instance of this singleton object.

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

Bases: pybind11_builtins.pybind11_object

Members:

R8_UNORM

R8_SNORM

R8_UINT

R8_SINT

RG8_UNORM

RG8_SNORM

RG8_UINT

RG8_SINT

BGRA8_UNORM

BGRA8_SRGB

RGBA8_UNORM

RGBA8_SNORM

RGBA8_UINT

RGBA8_SINT

RGBA8_SRGB

R16_UNORM

R16_SNORM

R16_UINT

R16_SINT

R16_SFLOAT

RG16_UNORM

RG16_SNORM

RG16_UINT

RG16_SINT

RG16_SFLOAT

RGBA16_UNORM

RGBA16_SNORM

RGBA16_UINT

RGBA16_SINT

RGBA16_SFLOAT

R32_UINT

R32_SINT

R32_SFLOAT

RG32_UINT

RG32_SINT

RG32_SFLOAT

RGB32_UINT

RGB32_SINT

RGB32_SFLOAT

RGBA32_UINT

RGBA32_SINT

RGBA32_SFLOAT

R10_G10_B10_A2_UNORM

R10_G10_B10_A2_UINT

R11_G11_B10_UFLOAT

R9_G9_B9_E5_UFLOAT

B5_G6_R5_UNROM

B5_G5_R5_A1_UNORM

BC1_RGBA_UNORM

BC1_RGBA_SRGB

BC2_RGBA_UNORM

BC2_RGBA_SRGB

BC3_RGBA_UNORM

BC3_RGBA_SRGB

BC4_R_UNORM

BC4_R_SNORM

BC5_RG_UNORM

BC5_RG_SNORM

BC6H_RGB_UFLOAT

BC6H_RGB_SFLOAT

BC7_RGBA_UNORM

BC7_RGBA_SRGB

D16_UNORM

D24_UNORM_S8_UINT

D32_SFLOAT

D32_SFLOAT_S8_UINT_X24

R24_UNORM_X8

X24_R8_UINT

X32_R8_UINT_X24

R32_SFLOAT_X8_X24

SAMPLER_FEEDBACK_MIN_MIP

SAMPLER_FEEDBACK_MIP_REGION_USED

B5_G5_R5_A1_UNORM = TextureFormat.B5_G5_R5_A1_UNORM
B5_G6_R5_UNROM = TextureFormat.B5_G6_R5_UNROM
BC1_RGBA_SRGB = TextureFormat.BC1_RGBA_SRGB
BC1_RGBA_UNORM = TextureFormat.BC1_RGBA_UNORM
BC2_RGBA_SRGB = TextureFormat.BC2_RGBA_SRGB
BC2_RGBA_UNORM = TextureFormat.BC2_RGBA_UNORM
BC3_RGBA_SRGB = TextureFormat.BC3_RGBA_SRGB
BC3_RGBA_UNORM = TextureFormat.BC3_RGBA_UNORM
BC4_R_SNORM = TextureFormat.BC4_R_SNORM
BC4_R_UNORM = TextureFormat.BC4_R_UNORM
BC5_RG_SNORM = TextureFormat.BC5_RG_SNORM
BC5_RG_UNORM = TextureFormat.BC5_RG_UNORM
BC6H_RGB_SFLOAT = TextureFormat.BC6H_RGB_SFLOAT
BC6H_RGB_UFLOAT = TextureFormat.BC6H_RGB_UFLOAT
BC7_RGBA_SRGB = TextureFormat.BC7_RGBA_SRGB
BC7_RGBA_UNORM = TextureFormat.BC7_RGBA_UNORM
BGRA8_SRGB = TextureFormat.BGRA8_SRGB
BGRA8_UNORM = TextureFormat.BGRA8_UNORM
D16_UNORM = TextureFormat.D16_UNORM
D24_UNORM_S8_UINT = TextureFormat.D24_UNORM_S8_UINT
D32_SFLOAT = TextureFormat.D32_SFLOAT
D32_SFLOAT_S8_UINT_X24 = TextureFormat.D32_SFLOAT_S8_UINT_X24
R10_G10_B10_A2_UINT = TextureFormat.R10_G10_B10_A2_UINT
R10_G10_B10_A2_UNORM = TextureFormat.R10_G10_B10_A2_UNORM
R11_G11_B10_UFLOAT = TextureFormat.R11_G11_B10_UFLOAT
R16_SFLOAT = TextureFormat.R16_SFLOAT
R16_SINT = TextureFormat.R16_SINT
R16_SNORM = TextureFormat.R16_SNORM
R16_UINT = TextureFormat.R16_UINT
R16_UNORM = TextureFormat.R16_UNORM
R24_UNORM_X8 = TextureFormat.R24_UNORM_X8
R32_SFLOAT = TextureFormat.R32_SFLOAT
R32_SFLOAT_X8_X24 = TextureFormat.R32_SFLOAT_X8_X24
R32_SINT = TextureFormat.R32_SINT
R32_UINT = TextureFormat.R32_UINT
R8_SINT = TextureFormat.R8_SINT
R8_SNORM = TextureFormat.R8_SNORM
R8_UINT = TextureFormat.R8_UINT
R8_UNORM = TextureFormat.R8_UNORM
R9_G9_B9_E5_UFLOAT = TextureFormat.R9_G9_B9_E5_UFLOAT
RG16_SFLOAT = TextureFormat.RG16_SFLOAT
RG16_SINT = TextureFormat.RG16_SINT
RG16_SNORM = TextureFormat.RG16_SNORM
RG16_UINT = TextureFormat.RG16_UINT
RG16_UNORM = TextureFormat.RG16_UNORM
RG32_SFLOAT = TextureFormat.RG32_SFLOAT
RG32_SINT = TextureFormat.RG32_SINT
RG32_UINT = TextureFormat.RG32_UINT
RG8_SINT = TextureFormat.RG8_SINT
RG8_SNORM = TextureFormat.RG8_SNORM
RG8_UINT = TextureFormat.RG8_UINT
RG8_UNORM = TextureFormat.RG8_UNORM
RGB32_SFLOAT = TextureFormat.RGB32_SFLOAT
RGB32_SINT = TextureFormat.RGB32_SINT
RGB32_UINT = TextureFormat.RGB32_UINT
RGBA16_SFLOAT = TextureFormat.RGBA16_SFLOAT
RGBA16_SINT = TextureFormat.RGBA16_SINT
RGBA16_SNORM = TextureFormat.RGBA16_SNORM
RGBA16_UINT = TextureFormat.RGBA16_UINT
RGBA16_UNORM = TextureFormat.RGBA16_UNORM
RGBA32_SFLOAT = TextureFormat.RGBA32_SFLOAT
RGBA32_SINT = TextureFormat.RGBA32_SINT
RGBA32_UINT = TextureFormat.RGBA32_UINT
RGBA8_SINT = TextureFormat.RGBA8_SINT
RGBA8_SNORM = TextureFormat.RGBA8_SNORM
RGBA8_SRGB = TextureFormat.RGBA8_SRGB
RGBA8_UINT = TextureFormat.RGBA8_UINT
RGBA8_UNORM = TextureFormat.RGBA8_UNORM
SAMPLER_FEEDBACK_MIN_MIP = TextureFormat.SAMPLER_FEEDBACK_MIN_MIP
SAMPLER_FEEDBACK_MIP_REGION_USED = TextureFormat.SAMPLER_FEEDBACK_MIP_REGION_USED
X24_R8_UINT = TextureFormat.X24_R8_UINT
X32_R8_UINT_X24 = TextureFormat.X32_R8_UINT_X24
property name

handle) -> str

Type

(self

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

Bases: omni.ui._ui.Window

The ToolBar class represents a window in the underlying windowing system that as some fixed size property.

Construct ToolBar.

Parameters

kwargs (dict) – See below

Keyword Arguments
  • axis (ui.Axis) – @breif axis for the toolbar

  • axis_changed_fn (Callable[[ui.Axis], None]) – @breif axis for the toolbar

  • flags – This property set the Flags for the Window.

  • visible – This property holds whether the window is visible.

  • title – This property holds the window’s title.

  • padding_x – This property set the padding to the frame on the X axis.

  • padding_y – This property set the padding to the frame on the Y axis.

  • width – This property holds the window Width.

  • height – This property holds the window Height.

  • position_x – This property set/get the position of the window in the X Axis. The default is kWindowFloatInvalid because we send the window position to the underlying system only if the position is explicitly set by the user. Otherwise the underlying system decides the position.

  • position_y – This property set/get the position of the window in the Y Axis The default is kWindowFloatInvalid because we send the window position to the underlying system only if the position is explicitly set by the user. Otherwise the underlying system decides the position.

  • auto_resize – setup the window to resize automatically based on its content

  • noTabBar – setup the visibility of the TabBar Handle, this is the small triangle at the corner of the view If it is not shown then it is not possible to undock that window and it need to be closed/moved programatically

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

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.

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

Parameters
  • model – The model that determines if the button is checked.

  • kwargs (dict) – See below

Keyword Arguments
  • text (str) – This property holds the button’s text.

  • image_url (str) – This property holds the button’s optional image URL.

  • image_width (float) – This property holds the width of the image widget. Do not use this function to find the width of the image.

  • image_height (float) – This property holds the height of the image widget. Do not use this function to find the height of the image.

  • spacing (float) – Sets a non-stretchable space in points between image and text.

  • clicked_fn (Callable[[], None]) – Sets the function that will be called when when the button is activated (i.e., pressed down then released while the mouse cursor is inside the button).

  • width (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

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.

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.

Parameters
  • model – The given model.

  • kwargs (dict) – See below

Keyword Arguments
  • delegate – The Item delegate that generates a widget per item.

  • header_visible – This property holds if the header is shown or not.

  • selection – Set current selection.

  • expand_on_branch_click – This flag allows to prevent expanding when the user clicks the plus icon. It’s used in the case the user wants to control how the items expanded or collapsed.

  • keep_alive – When true, the tree nodes are never destroyed even if they are disappeared from the model. It’s 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.

  • root_expanded – The expanded state of the root item. Changing this flag doesn’t make the children repopulated.

  • width (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

call_selection_changed_fn(self: omni.ui._ui.TreeView, arg0: List[omni.ui._ui.AbstractItem])None

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

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.

has_selection_changed_fn(self: omni.ui._ui.TreeView)bool

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

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_expanded

The expanded state of the root item. Changing this flag doesn’t make the children repopulated.

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.

Parameters
  • 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.

Constructs Triangle.

Parameters

kwargs (dict) – See below

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

  • width (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

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

Constructs UIntDrag.

Parameters
  • model – The widget’s model. If the model is not assigned, the default model is created.

  • kwargs (dict) – See below

Keyword Arguments
  • 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 (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

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.

Constructs UIntSlider.

Parameters
  • model – The widget’s model. If the model is not assigned, the default model is created.

  • kwargs (dict) – See below

Keyword Arguments
  • min – This property holds the slider’s minimum value.

  • max – This property holds the slider’s maximum value.

  • width (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

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.

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

Parameters

kwargs (dict) – See below

Keyword Arguments
  • 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 (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

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.

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

Parameters

kwargs (dict) – See below

Keyword Arguments
  • direction – This type is used to determine the direction of the layout. If the Stack’s orientation is eLeftToRight the widgets are placed in a horizontal row, from left to right. If the Stack’s orientation is eRightToLeft the widgets are placed in a horizontal row, from right to left. If the Stack’s orientation is eTopToBottom, the widgets are placed in a 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 (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

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.

FLAG_WANT_CAPTURE_KEYBOARD = 1073741824
call_accept_drop_fn(self: omni.ui._ui.Widget, arg0: str)bool

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

call_computed_content_size_changed_fn(self: omni.ui._ui.Widget)None

Called when the size of the widget is changed.

call_drag_fn(self: omni.ui._ui.Widget)str

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

call_drop_fn(self: omni.ui._ui.Widget, arg0: omni.ui._ui.WidgetMouseDropEvent)None

Specify that this Widget accepts drops and set the callback to the drop operation.

call_key_pressed_fn(self: omni.ui._ui.Widget, arg0: int, arg1: int, arg2: bool)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)

call_mouse_double_clicked_fn(self: omni.ui._ui.Widget, arg0: float, arg1: float, arg2: int, arg3: int)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)

call_mouse_hovered_fn(self: omni.ui._ui.Widget, arg0: bool)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)

call_mouse_moved_fn(self: omni.ui._ui.Widget, arg0: float, arg1: float, arg2: int, arg3: bool)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)

call_mouse_pressed_fn(self: omni.ui._ui.Widget, arg0: float, arg1: float, arg2: int, arg3: int)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.

call_mouse_released_fn(self: omni.ui._ui.Widget, arg0: float, arg1: float, arg2: int, arg3: int)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)

call_mouse_wheel_fn(self: omni.ui._ui.Widget, arg0: float, arg1: float, arg2: int)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)

call_tooltip_fn(self: omni.ui._ui.Widget)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 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.

destroy(self: omni.ui._ui.Widget)None

Removes all the callbacks and circular references.

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.

has_accept_drop_fn(self: omni.ui._ui.Widget)bool

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

has_computed_content_size_changed_fn(self: omni.ui._ui.Widget)bool

Called when the size of the widget is changed.

has_drag_fn(self: omni.ui._ui.Widget)bool

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

has_drop_fn(self: omni.ui._ui.Widget)bool

Specify that this Widget accepts drops and set the callback to the drop operation.

has_key_pressed_fn(self: omni.ui._ui.Widget)bool

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)

has_mouse_double_clicked_fn(self: omni.ui._ui.Widget)bool

Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

has_mouse_hovered_fn(self: omni.ui._ui.Widget)bool

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)

has_mouse_moved_fn(self: omni.ui._ui.Widget)bool

Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

has_mouse_pressed_fn(self: omni.ui._ui.Widget)bool

Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

has_mouse_released_fn(self: omni.ui._ui.Widget)bool

Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

has_mouse_wheel_fn(self: omni.ui._ui.Widget)bool

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)

has_tooltip_fn(self: omni.ui._ui.Widget)bool

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

Parameters
  • 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.

Parameters

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.

Parameters

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

Called when the size of the widget is changed.

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

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

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

Specify that this Widget accepts drops and set the callback to the drop operation.

set_key_pressed_fn(self: omni.ui._ui.Widget, fn: Callable[[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 follow 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

setStyle()

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.

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

Parameters
  • title – The window title. It’s also used as an internal window ID.

  • dockPrefence – In the old Kit determines where the window should be docked. In Kit Next it’s unused.

  • kwargs (dict) – See below

Keyword Arguments
  • flags – This property set the Flags for the Window.

  • visible – This property holds whether the window is visible.

  • title – This property holds the window’s title.

  • padding_x – This property set the padding to the frame on the X axis.

  • padding_y – This property set the padding to the frame on the Y axis.

  • width – This property holds the window Width.

  • height – This property holds the window Height.

  • position_x – This property set/get the position of the window in the X Axis. The default is kWindowFloatInvalid because we send the window position to the underlying system only if the position is explicitly set by the user. Otherwise the underlying system decides the position.

  • position_y – This property set/get the position of the window in the Y Axis The default is kWindowFloatInvalid because we send the window position to the underlying system only if the position is explicitly set by the user. Otherwise the underlying system decides the position.

  • auto_resize – setup the window to resize automatically based on its content

  • noTabBar – setup the visibility of the TabBar Handle, this is the small triangle at the corner of the view If it is not shown then it is not possible to undock that window and it need to be closed/moved programatically

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

property auto_resize

setup the window to resize automatically based on its content

call_key_pressed_fn(self: omni.ui._ui.Window, arg0: int, arg1: int, arg2: bool)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)

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.

Parameters
  • targetWindowTitle – Dock to window with this title when it appears.

  • activeWindow – Make target or this window active when docked.

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

Removes all the callbacks and circular references.

property detachable

If the window is able to be separated from the main application window.

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

has_key_pressed_fn(self: omni.ui._ui.Window)bool

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)

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.

property selected_in_dock

Read only property that is true when the window is focused.

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

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

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

Callback invoked when the window in focus changes.

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

Return true is the window is the current window in the docking area.

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.

property dock_id

Returns ID of the dock node this window is docked to.

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_enabled

Checks if the current docking space is disabled. The disabled docking tab bar can’t be shown by the user.

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.

is_selected_in_dock(self: omni.ui._ui.WindowHandle)bool

Return true is the window is the current window in the docking area.

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.

static clear()None

Undock all.

dump_workspace()

Capture current workspace and return the dict with the description of the docking state and window size.

static get_dock_children_id(dock_id: int)object

Get two dock children of the given dock ID.

Parameters
  • dockId – the given dock ID

  • first – output. the first child dock ID

  • second – output. the second child dock ID

true if the given dock ID has children

static get_dock_position(dock_id: int) → omni.ui._ui.DockPosition

Returns the position of the given dock ID. Left/Right/Top/Bottom.

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_docked_windows(dock_id: int) → List[omni.ui._ui.WindowHandle]

Get all the windows of the given dock ID.

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_selected_window_index(dock_id: int)int

Get the currently selected windown index.

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.

restore_workspace()

Dock the windows according to the workspace description

static set_show_window_fn(title: str, fn: Callable[[bool], None])None

Add the callback to create a window with the given title. When the callback’s argument is true, it’s necessary to create the window. Otherwise remove.

static set_window_created_callback(fn: Callable[[omni.ui._ui.WindowHandle], None])None

Add the callback to let us know when a new window has been created.

static show_window(title: str, show: bool = True)bool

Makes the window visible or create the window with the callback provided with set_show_window_fn.

Parameters
  • title – the given window title

  • show – true to show, false to hide

true if the window is already created, otherwise it’s necessary to wait one frame.

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.

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

Parameters

kwargs (dict) – See below

Keyword Arguments
  • direction – This type is used to determine the direction of the layout. If the Stack’s orientation is eLeftToRight the widgets are placed in a horizontal row, from left to right. If the Stack’s orientation is eRightToLeft the widgets are placed in a horizontal row, from right to left. If the Stack’s orientation is eTopToBottom, the widgets are placed in a 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 (ui.Length) – This property holds the width of the widget relative to its parent. Do not use this function to find the width of a screen.

  • height (ui.Length) – This property holds the height of the widget relative to its parent. Do not use this function to find the height of a screen.

  • name (str) – The name of the widget that user can set.

  • style_type_name_override (str) – By default, we use typeName to look up the style. But sometimes it’s necessary to use a custom name. For example, when a widget as a part of another widget. (Label is a part of Button) This property can override the name to use in style.

  • visible (bool) – This property holds whether the widget is visible.

  • visibleMin (float) – If the current zoom factor and DPI is less than this value, the widget is not visible.

  • visibleMax (float) – If the current zoom factor and DPI is bigger than this value, the widget is not visible.

  • tooltip (str) – set a basic tooltip for the widget, this will simply be a Label, it will follow the Tooltip style

  • tooltip_fn (Callable) – set dynamic tooltip that will be created dynamiclly the first time it is needed. the function is called inside a ui.Frame scope that the widget will be parented correctly.

  • tooltip_offset_x (float) – Set the X tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • tooltip_offset_y (float) – Set the Y tooltip offset in points. In a normal state, the tooltip position is linked to the mouse position. If the tooltip offset is non zero, the top left corner of the tooltip is linked to the top left corner of the widget, and this property defines the relative position the tooltip should be shown.

  • enabled (bool) – This property holds whether the widget is enabled. In general an enabled widget handles keyboard and mouse events; a disabled widget does not. And widgets display themselves differently when they are disabled.

  • selected (bool) – This property holds a flag that specifies the widget has to use eSelected state of the style.

  • checked (bool) – This property holds a flag that specifies the widget has to use eChecked state of the style. It’s on the Widget level because the button can have sub-widgets that are also should be checked.

  • dragging (bool) – This property holds if the widget is being dragged.

  • opaque_for_mouse_events (bool) – if the widgets has callback functions it will by default not capture the events 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 (bool) – The flag that specifies if it’s necessary to bypass the whole draw cycle if the bounding box is clipped with a scrolling frame. It’s needed to avoid the limitation of 65535 primitives in a single draw list.

  • mouse_moved_fn (Callable) – Sets the function that will be called when the user moves the mouse inside the widget. Mouse move events only occur if a mouse button is pressed while the mouse is being moved. void onMouseMoved(float x, float y, int32_t modifier)

  • mouse_pressed_fn (Callable) – Sets the function that will be called when the user presses the mouse button inside the widget. The function should be like this: void onMousePressed(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier) Where: ‘button’ is the number of the mouse button pressed. ‘modifier’ is the flag for the keyboard modifier key.

  • mouse_released_fn (Callable) – Sets the function that will be called when the user releases the mouse button if this button was pressed inside the widget. void onMouseReleased(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_double_clicked_fn (Callable) – Sets the function that will be called when the user presses the mouse button twice inside the widget. The function specification is the same as in setMousePressedFn. void onMouseDoubleClicked(float x, float y, int32_t button, carb::input::KeyboardModifierFlags modifier)

  • mouse_wheel_fn (Callable) – Sets the function that will be called when the user uses mouse wheel on the focused window. The function specification is the same as in setMousePressedFn. void onMouseWheel(float x, float y, carb::input::KeyboardModifierFlags modifier)

  • mouse_hovered_fn (Callable) – Sets the function that will be called when the user use mouse enter/leave on the focused window. function specification is the same as in setMouseHovedFn. void onMouseHovered(bool hovered)

  • drag_fn (Callable) – Specify that this Widget is draggable, and set the callback that is attached to the drag operation.

  • accept_drop_fn (Callable) – Specify that this Widget can accept specific drops and set the callback that is called to check if the drop can be accepted.

  • drop_fn (Callable) – Specify that this Widget accepts drops and set the callback to the drop operation.

  • computed_content_size_changed_fn (Callable) – Called when the size of the widget is changed.

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.

omni.ui.set_shade(shade_name: Optional[str] = None)