SettingsWidgetBuilder
- class omni.kit.widget.settings.settings_widget_builder.SettingsWidgetBuilder
Bases:
object
Widget builder functions.
Methods
createAssetWidget
(model[, ...])Create widget for file asset with filepicker.
createBoolWidget
(model[, ...])Create a boolean widget.
createColorWidget
(model[, comp_count, ...])Create a three color floating-point widget.
createComboboxWidget
(setting_path[, items, ...])Create a Combo Setting widget.
createDoubleArrayWidget
(model, range_min, ...)Create a widget for multiple double-precision floating-point numbers.
createFloatWidget
(model, range_min, range_max)Create a floating point widget.
createIntArrayWidget
(model, range_min, range_max)Create a widget for multiple integer numbers.
createIntWidget
(model, range_min, range_max)Create a integer widget.
createRadiobuttonWidget
(model[, ...])Create a RadioButtons Setting widget.
createVecWidget
(model, range_min, range_max)Create a widget for multiple XYZW float values.
Get checkbox alignment from setting "/ext/omni.kit.window.property/checkboxAlignment" and return True/False
Get label alignment from setting "/ext/omni.kit.window.property/labelAlignment" and return True/False
- __init__()
- classmethod createAssetWidget(model, additional_widget_kwargs=None)
Create widget for file asset with filepicker.
- classmethod createBoolWidget(model, additional_widget_kwargs=None)
Create a boolean widget.
- classmethod createColorWidget(model, comp_count=3, additional_widget_kwargs=None) HStack
Create a three color floating-point widget.
- classmethod createComboboxWidget(setting_path: str, items: Optional[Union[list, dict]] = None, setting_is_index: Optional[bool] = None, additional_widget_kwargs: Optional[dict] = None) Tuple[SettingsComboItemModel, ComboBox]
Create a Combo Setting widget.
This function creates a combo box that shows a provided list of names and it is connected with setting by path specified. Underlying setting values are used from values of `items` dict.
- Parameters
setting_path – Path to the setting to show and edit.
items – Can be either
dict` or :py:obj:`list`. For :py:obj:`dict
keys are UI displayed names, values are actual values set into settings. If it is alist
UI displayed names are equal to setting values.setting_is_index – None - Detect type from setting_path value. If the type is int, set to True. True - setting_path value is index into items list (default) False - setting_path value is string in items list
- classmethod createDoubleArrayWidget(model, range_min, range_max, comp_count=3, additional_widget_kwargs=None)
Create a widget for multiple double-precision floating-point numbers.
- classmethod createFloatWidget(model, range_min, range_max, additional_widget_kwargs=None)
Create a floating point widget.
- classmethod createIntArrayWidget(model, range_min, range_max, comp_count=3, additional_widget_kwargs=None)
Create a widget for multiple integer numbers.
- classmethod createIntWidget(model, range_min, range_max, additional_widget_kwargs=None)
Create a integer widget.
- classmethod createRadiobuttonWidget(model: RadioButtonSettingModel, setting_path: str = '', additional_widget_kwargs: Optional[dict] = None) RadioCollection
Create a RadioButtons Setting widget.
This function creates a Radio Buttons that shows a list of names that are connected with setting by path specified - “{setting_path}/items”.
- Parameters
model – A RadioButtonSettingModel instance.
setting_path – Path to the setting to show and edit.
- Returns
A omni.ui.RadioCollection instance.
- Return type
(omni.ui.RadioCollection)
- classmethod createVecWidget(model, range_min, range_max, comp_count=3, additional_widget_kwargs=None)
Create a widget for multiple XYZW float values.
- classmethod get_checkbox_alignment()
Get checkbox alignment from setting “/ext/omni.kit.window.property/checkboxAlignment” and return True/False
- classmethod get_label_alignment()
Get label alignment from setting “/ext/omni.kit.window.property/labelAlignment” and return True/False