UI Utilities [omni.isaac.ui]
The Isaac Sim UI Utilities extension provides a helper functions for creating robot-centric UI elements.
Builder Functions
- ui_utils.btn_builder(type='button', text='button', tooltip='', on_clicked_fn=None)
Creates a stylized button.
- Parameters
label (str, optional) – Label to the left of the UI element. Defaults to “”.
type (str, optional) – Type of UI element. Defaults to “button”.
text (str, optional) – Text rendered on the button. Defaults to “button”.
tooltip (str, optional) – Tooltip to display over the Label. Defaults to “”.
on_clicked_fn (Callable, optional) – Call-back function when clicked. Defaults to None.
- Returns
Button
- Return type
ui.Button
- ui_utils.state_btn_builder(type='state_button', a_text='STATE A', b_text='STATE B', tooltip='', on_clicked_fn=None)
Creates a State Change Button that changes text when pressed.
- Parameters
label (str, optional) – Label to the left of the UI element. Defaults to “”.
type (str, optional) – Type of UI element. Defaults to “button”.
a_text (str, optional) – Text rendered on the button for State A. Defaults to “STATE A”.
b_text (str, optional) – Text rendered on the button for State B. Defaults to “STATE B”.
tooltip (str, optional) – Tooltip to display over the Label. Defaults to “”.
on_clicked_fn (Callable, optional) – Call-back function when clicked. Defaults to None.
- ui_utils.multi_btn_builder(type='multi_button', count=2, text=['button', 'button'], tooltip=['', '', ''], on_clicked_fn=[None, None])
Creates a Row of Stylized Buttons
- Parameters
label (str, optional) – Label to the left of the UI element. Defaults to “”.
type (str, optional) – Type of UI element. Defaults to “multi_button”.
count (int, optional) – Number of UI elements to create. Defaults to 2.
text (list, optional) – List of text rendered on the UI elements. Defaults to [“button”, “button”].
tooltip (list, optional) – List of tooltips to display over the UI elements. Defaults to [“”, “”, “”].
on_clicked_fn (list, optional) – List of call-backs function when clicked. Defaults to [None, None].
- Returns
List of Buttons
- Return type
list(ui.Button)
- ui_utils.cb_builder(type='checkbox', default_val=False, tooltip='', on_clicked_fn=None)
Creates a Stylized Checkbox
- Parameters
label (str, optional) – Label to the left of the UI element. Defaults to “”.
type (str, optional) – Type of UI element. Defaults to “checkbox”.
default_val (bool, optional) – Checked is True, Unchecked is False. Defaults to False.
tooltip (str, optional) – Tooltip to display over the Label. Defaults to “”.
on_clicked_fn (Callable, optional) – Call-back function when clicked. Defaults to None.
- Returns
model
- Return type
ui.SimpleBoolModel
- ui_utils.multi_cb_builder(type='multi_checkbox', count=2, text=[' ', ' '], default_val=[False, False], tooltip=['', '', ''], on_clicked_fn=[None, None])
Creates a Row of Stylized Checkboxes.
- Parameters
label (str, optional) – Label to the left of the UI element. Defaults to “”.
type (str, optional) – Type of UI element. Defaults to “multi_checkbox”.
count (int, optional) – Number of UI elements to create. Defaults to 2.
text (list, optional) – List of text rendered on the UI elements. Defaults to [” “, ” “].
default_val (list, optional) – List of default values. Checked is True, Unchecked is False. Defaults to [False, False].
tooltip (list, optional) – List of tooltips to display over the UI elements. Defaults to [“”, “”, “”].
on_clicked_fn (list, optional) – List of call-backs function when clicked. Defaults to [None, None].
- Returns
List of models
- Return type
list(ui.SimpleBoolModel)
- ui_utils.str_builder(type='stringfield', default_val=' ', tooltip='', on_clicked_fn=None, use_folder_picker=False, read_only=False, item_filter_fn=None, bookmark_label=None, bookmark_path=None, folder_dialog_title='Select Output Folder', folder_button_title='Select Folder')
Creates a Stylized Stringfield Widget
- Parameters
label (str, optional) – Label to the left of the UI element. Defaults to “”.
type (str, optional) – Type of UI element. Defaults to “stringfield”.
default_val (str, optional) – Text to initialize in Stringfield. Defaults to ” “.
tooltip (str, optional) – Tooltip to display over the UI elements. Defaults to “”.
use_folder_picker (bool, optional) – Add a folder picker button to the right. Defaults to False.
read_only (bool, optional) – Prevents editing. Defaults to False.
item_filter_fn (Callable, optional) – filter function to pass to the FilePicker
bookmark_label (str, optional) – bookmark label to pass to the FilePicker
bookmark_path (str, optional) – bookmark path to pass to the FilePicker
- Returns
model of Stringfield
- Return type
AbstractValueModel
- ui_utils.int_builder(type='intfield', default_val=0, tooltip='', min=- 9223372036854775807, max=9223372036854775807)
Creates a Stylized Intfield Widget
- Parameters
label (str, optional) – Label to the left of the UI element. Defaults to “”.
type (str, optional) – Type of UI element. Defaults to “intfield”.
default_val (int, optional) – Default Value of UI element. Defaults to 0.
tooltip (str, optional) – Tooltip to display over the UI elements. Defaults to “”.
min (int, optional) – Minimum limit for int field. Defaults to sys.maxsize * -1
max (int, optional) – Maximum limit for int field. Defaults to sys.maxsize * 1
- Returns
model
- Return type
AbstractValueModel
- ui_utils.float_builder(type='floatfield', default_val=0, tooltip='', min=- inf, max=inf, step=0.1, format='%.2f')
Creates a Stylized Floatfield Widget
- Parameters
label (str, optional) – Label to the left of the UI element. Defaults to “”.
type (str, optional) – Type of UI element. Defaults to “floatfield”.
default_val (int, optional) – Default Value of UI element. Defaults to 0.
tooltip (str, optional) – Tooltip to display over the UI elements. Defaults to “”.
- Returns
model
- Return type
AbstractValueModel
- ui_utils.combo_cb_str_builder(type='checkbox_stringfield', default_val=[False, ' '], tooltip='', on_clicked_fn=<function <lambda>>, use_folder_picker=False, read_only=False, folder_dialog_title='Select Output Folder', folder_button_title='Select Folder')
Creates a Stylized Checkbox + Stringfield Widget
- Parameters
label (str, optional) – Label to the left of the UI element. Defaults to “”.
type (str, optional) – Type of UI element. Defaults to “checkbox_stringfield”.
default_val (str, optional) – Text to initialize in Stringfield. Defaults to [False, ” “].
tooltip (str, optional) – Tooltip to display over the UI elements. Defaults to “”.
use_folder_picker (bool, optional) – Add a folder picker button to the right. Defaults to False.
read_only (bool, optional) – Prevents editing. Defaults to False.
- Returns
(cb_model, str_field_model)
- Return type
Tuple(ui.SimpleBoolModel, AbstractValueModel)
- ui_utils.dropdown_builder(type='dropdown', default_val=0, items=['Option 1', 'Option 2', 'Option 3'], tooltip='', on_clicked_fn=None)
Creates a Stylized Dropdown Combobox
- Parameters
label (str, optional) – Label to the left of the UI element. Defaults to “”.
type (str, optional) – Type of UI element. Defaults to “dropdown”.
default_val (int, optional) – Default index of dropdown items. Defaults to 0.
items (list, optional) – List of items for dropdown box. Defaults to [“Option 1”, “Option 2”, “Option 3”].
tooltip (str, optional) – Tooltip to display over the Label. Defaults to “”.
on_clicked_fn (Callable, optional) – Call-back function when clicked. Defaults to None.
- Returns
model
- Return type
AbstractItemModel
- ui_utils.multi_dropdown_builder(type='multi_dropdown', count=2, default_val=[0, 0], items=[['Option 1', 'Option 2', 'Option 3'], ['Option A', 'Option B', 'Option C']], tooltip='', on_clicked_fn=[None, None])
Creates a Stylized Multi-Dropdown Combobox
- Returns
model
- Return type
AbstractItemModel
- Parameters
label (str, optional) – Label to the left of the UI element. Defaults to “”.
type (str, optional) – Type of UI element. Defaults to “multi_dropdown”.
count (int, optional) – Number of UI elements. Defaults to 2.
default_val (list(int), optional) – List of default indices of dropdown items. Defaults to 0.. Defaults to [0, 0].
items (list(list), optional) – List of list of items for dropdown boxes. Defaults to [[“Option 1”, “Option 2”, “Option 3”], [“Option A”, “Option B”, “Option C”]].
tooltip (str, optional) – Tooltip to display over the Label. Defaults to “”.
on_clicked_fn (list(Callable), optional) – List of call-back function when clicked. Defaults to [None, None].
- Returns
list(models)
- Return type
list(AbstractItemModel)
- ui_utils.combo_cb_dropdown_builder(type='checkbox_dropdown', default_val=[False, 0], items=['Option 1', 'Option 2', 'Option 3'], tooltip='', on_clicked_fn=[<function <lambda>>, None])
Creates a Stylized Dropdown Combobox with an Enable Checkbox
- Parameters
label (str, optional) – Label to the left of the UI element. Defaults to “”.
type (str, optional) – Type of UI element. Defaults to “checkbox_dropdown”.
default_val (list, optional) – list(cb_default, dropdown_default). Defaults to [False, 0].
items (list, optional) – List of items for dropdown box. Defaults to [“Option 1”, “Option 2”, “Option 3”].
tooltip (str, optional) – Tooltip to display over the Label. Defaults to “”.
on_clicked_fn (list, optional) – List of callback functions. Defaults to [lambda x: None, None].
- Returns
(cb_model, combobox)
- Return type
Tuple(ui.SimpleBoolModel, ui.ComboBox)
- ui_utils.combo_intfield_slider_builder(type='intfield_stringfield', default_val=0.5, min=0, max=1, step=0.01, tooltip=['', ''])
Creates a Stylized IntField + Stringfield Widget
- Parameters
label (str, optional) – Label to the left of the UI element. Defaults to “”.
type (str, optional) – Type of UI element. Defaults to “intfield_stringfield”.
default_val (float, optional) – Default Value. Defaults to 0.5.
min (int, optional) – Minimum Value. Defaults to 0.
max (int, optional) – Maximum Value. Defaults to 1.
step (float, optional) – Step. Defaults to 0.01.
tooltip (list, optional) – List of tooltips. Defaults to [“”, “”].
- Returns
(flt_field_model, flt_slider_model)
- Return type
Tuple(AbstractValueModel, IntSlider)
- ui_utils.combo_floatfield_slider_builder(type='floatfield_stringfield', default_val=0.5, min=0, max=1, step=0.01, tooltip=['', ''])
Creates a Stylized FloatField + FloatSlider Widget
- Parameters
label (str, optional) – Label to the left of the UI element. Defaults to “”.
type (str, optional) – Type of UI element. Defaults to “floatfield_stringfield”.
default_val (float, optional) – Default Value. Defaults to 0.5.
min (int, optional) – Minimum Value. Defaults to 0.
max (int, optional) – Maximum Value. Defaults to 1.
step (float, optional) – Step. Defaults to 0.01.
tooltip (list, optional) – List of tooltips. Defaults to [“”, “”].
- Returns
(flt_field_model, flt_slider_model)
- Return type
Tuple(AbstractValueModel, IntSlider)
- ui_utils.scrolling_frame_builder(type='scrolling_frame', default_val='No Data', tooltip='')
Creates a Labeled Scrolling Frame with CopyToClipboard button
- Parameters
label (str, optional) – Label to the left of the UI element. Defaults to “”.
type (str, optional) – Type of UI element. Defaults to “scrolling_frame”.
default_val (str, optional) – Default Text. Defaults to “No Data”.
tooltip (str, optional) – Tooltip to display over the Label. Defaults to “”.
- Returns
label
- Return type
ui.Label
- ui_utils.combo_cb_scrolling_frame_builder(type='cb_scrolling_frame', default_val=[False, 'No Data'], tooltip='', on_clicked_fn=<function <lambda>>)
Creates a Labeled, Checkbox-enabled Scrolling Frame with CopyToClipboard button
- Parameters
label (str, optional) – Label to the left of the UI element. Defaults to “”.
type (str, optional) – Type of UI element. Defaults to “cb_scrolling_frame”.
default_val (list, optional) – List of Checkbox and Frame Defaults. Defaults to [False, “No Data”].
tooltip (str, optional) – Tooltip to display over the Label. Defaults to “”.
on_clicked_fn (Callable, optional) – Callback function when clicked. Defaults to lambda x : None.
- Returns
(model, label)
- Return type
list(SimpleBoolModel, ui.Label)
- ui_utils.xyz_builder(tooltip='', axis_count=3, default_val=[0.0, 0.0, 0.0, 0.0], min=- inf, max=inf, step=0.001, on_value_changed_fn=[None, None, None, None])
[summary]
- Parameters
label (str, optional) – Label to the left of the UI element. Defaults to “”.
type (str, optional) – Type of UI element. Defaults to “”.
axis_count (int, optional) – Number of Axes to Display. Max 4. Defaults to 3.
default_val (list, optional) – List of default values. Defaults to [0.0, 0.0, 0.0, 0.0].
min (float, optional) – Minimum Float Value. Defaults to float(“-inf”).
max (float, optional) – Maximum Float Value. Defaults to float(“inf”).
step (float, optional) – Step. Defaults to 0.001.
on_value_changed_fn (list, optional) – List of callback functions for each axes. Defaults to [None, None, None, None].
- Returns
list(model)
- Return type
list(AbstractValueModel)
- ui_utils.color_picker_builder(type='color_picker', default_val=[1.0, 1.0, 1.0, 1.0], tooltip='Color Picker')
Creates a Color Picker Widget
- Parameters
label (str, optional) – Label to the left of the UI element. Defaults to “”.
type (str, optional) – Type of UI element. Defaults to “color_picker”.
default_val (list, optional) – List of (R,G,B,A) default values. Defaults to [1.0, 1.0, 1.0, 1.0].
tooltip (str, optional) – Tooltip to display over the Label. Defaults to “Color Picker”.
- Returns
ui.ColorWidget.model
- Return type
AbstractItemModel
- ui_utils.progress_bar_builder(type='progress_bar', default_val=0, tooltip='Progress')
Creates a Progress Bar Widget
- Parameters
label (str, optional) – Label to the left of the UI element. Defaults to “”.
type (str, optional) – Type of UI element. Defaults to “progress_bar”.
default_val (int, optional) – Starting Value. Defaults to 0.
tooltip (str, optional) – Tooltip to display over the Label. Defaults to “Progress”.
- Returns
ui.ProgressBar().model
- Return type
AbstractValueModel
Plotting Functions
- ui_utils.plot_builder(data=None, min=- 1, max=1, type=Type.LINE, value_stride=1, color=None, tooltip='')
Creates a stylized static plot
- Parameters
label (str, optional) – Label to the left of the UI element. Defaults to “”.
data (list(float), optional) – Data to plot. Defaults to None.
min (int, optional) – Minimum Y Value. Defaults to -1.
max (int, optional) – Maximum Y Value. Defaults to 1.
type (ui.Type, optional) – Plot Type. Defaults to ui.Type.LINE.
value_stride (int, optional) – Width of plot stride. Defaults to 1.
color (int, optional) – Plot color. Defaults to None.
tooltip (str, optional) – Tooltip to display over the Label. Defaults to “”.
- Returns
plot
- Return type
ui.Plot
- ui_utils.combo_cb_plot_builder(default_val=False, on_clicked_fn=<function <lambda>>, data=None, min=-1, max=1, type=Type.LINE, value_stride=1, color=None, tooltip='')
Creates a Checkbox-Enabled dyanamic plot
- Parameters
label (str, optional) – Label to the left of the UI element. Defaults to “”.
default_val (bool, optional) – Checkbox default. Defaults to False.
on_clicked_fn (Callable, optional) – Checkbox Callback function. Defaults to lambda x: None.
data (list(), optional) – Data to plat. Defaults to None.
min (int, optional) – Min Y Value. Defaults to -1.
max (int, optional) – Max Y Value. Defaults to 1.
type (ui.Type, optional) – Plot Type. Defaults to ui.Type.LINE.
value_stride (int, optional) – Width of plot stride. Defaults to 1.
color (int, optional) – Plot color. Defaults to None.
tooltip (str, optional) – Tooltip to display over the Label. Defaults to “”.
- Returns
(cb_model, plot)
- Return type
list(SimpleBoolModel, ui.Plot)
- ui_utils.xyz_plot_builder(data=[], min=- 1, max=1, tooltip='')
Creates a stylized static XYZ plot
- Parameters
label (str, optional) – Label to the left of the UI element. Defaults to “”.
data (list(float), optional) – Data to plot. Defaults to [].
min (int, optional) – Minimum Y Value. Defaults to -1.
max (int, optional) – Maximum Y Value. Defaults to “”.
tooltip (str, optional) – Tooltip to display over the Label.. Defaults to “”.
- Returns
list(x_plot, y_plot, z_plot)
- Return type
list(ui.Plot)
- ui_utils.combo_cb_xyz_plot_builder(default_val=False, on_clicked_fn=<function <lambda>>, data=[], min=-1, max=1, type=Type.LINE, value_stride=1, tooltip='')
[summary]
- Parameters
label (str, optional) – Label to the left of the UI element. Defaults to “”.
default_val (bool, optional) – Checkbox default. Defaults to False.
on_clicked_fn (Callable, optional) – Checkbox Callback function. Defaults to lambda x: None.
list (data) – Data to plat. Defaults to None.
min (int, optional) – Min Y Value. Defaults to -1.
max (int, optional) – Max Y Value. Defaults to 1.
type (ui.Type, optional) – Plot Type. Defaults to ui.Type.LINE.
value_stride (int, optional) – Width of plot stride. Defaults to 1.
tooltip (str, optional) – Tooltip to display over the Label. Defaults to “”.
- Returns
([plot_0, plot_1, plot_2], [val_model_x, val_model_y, val_model_z])
- Return type
Tuple(list(ui.Plot), list(AbstractValueModel))
Aesthetic Functions
- ui_utils.add_separator()
Aesthetic element to adds a Line Separator.