omni.kit.settings module

Settings Omniverse Kit API

Module to work with Settings in the Kit. It is built on top of carb.settings generic setting system.

Example code to create omni.kit.ui.Widget to show and edit particular setting:

>>> import omni.kit.settings
>>> import omni.kit.ui
>>> widget = omni.kit.settings.create_setting_widget("some/path/to/param", SettingType.FLOAT)
class omni.kit.settings.SettingType

Bases: object

Supported setting types

BOOL = 3
COLOR3 = 2
DOUBLE2 = 7
DOUBLE3 = 5
FLOAT = 0
INT = 1
INT2 = 6
STRING = 4
class omni.kit.settings.UiModel(self: omni.kit.ui._ui.Model)None

Bases: omni.kit.ui._ui.Model

begin_change_group()
end_change_group()
get_array_size(path, meta)
get_key(path, meta, index)
get_key_count(path, meta)
get_type(self: omni.kit.ui._ui.Model, arg0: str, arg1: str) → omni.kit.ui._ui.ModelNodeType
get_value(path, meta, index, is_time_sampled, time)
on_subscribe_to_change(path, meta, stream)
on_unsubscribe_to_change(path, meta, stream)
set_array_size(path, meta, size, is_time_sampled, time, info)
set_value(path, meta, value, index, is_time_sampled, time, info)
omni.kit.settings.create_setting_widget(setting_path: str, setting_type: omni.kit.settings.ui.SettingType, range_from=0, range_to=0, speed=1, **kwargs) → omni.kit.ui._ui.Widget

Create a UI widget connected with a setting.

If range_from >= range_to there is no limit. Undo/redo operations are also supported, because changing setting goes through the omni.kit.commands module, using ChangeSettingCommand.

Parameters
  • setting_path – Path to the setting to show and edit.

  • setting_type – Type of the setting to expect.

  • range_from – Limit setting value lower bound.

  • range_to – Limit setting value upper bound.

Returns

omni.kit.ui.Widget connected with the setting on the path specified.

omni.kit.settings.create_setting_widget_combo(setting_path: str, items: Union[list, dict])

Creating 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 list. For dict keys are UI displayed names, values are actual values set into settings. If it is a list UI displayed names are equal to setting values.

omni.kit.settings.get_ui_model() → omni.kit.settings.model.UiModel

Returns UiModel singleton