AbstractValueModel

class omni.ui.AbstractValueModel

Bases: pybind11_object

Methods

__init__(self)

Constructs AbstractValueModel.

add_begin_edit_fn(self, arg0)

Adds the function that will be called every time the user starts the editing.

add_end_edit_fn(self, arg0)

Adds the function that will be called every time the user finishes the editing.

add_value_changed_fn(self, arg0)

Adds the function that will be called every time the value changes.

begin_edit(self)

Called when the user starts the editing.

end_edit(self)

Called when the user finishes the editing.

get_value_as_bool(self)

Return the bool representation of the value.

get_value_as_float(self)

Return the float representation of the value.

get_value_as_int(self)

Return the int representation of the value.

get_value_as_string(self)

Return the string representation of the value.

remove_begin_edit_fn(self, arg0)

Remove the callback by its id.

remove_end_edit_fn(self, arg0)

Remove the callback by its id.

remove_value_changed_fn(self, arg0)

Remove the callback by its id.

set_value(*args, **kwargs)

Overloaded function.

subscribe_begin_edit_fn(self, arg0)

Adds the function that will be called every time the user starts the editing.

subscribe_end_edit_fn(self, arg0)

Adds the function that will be called every time the user finishes the editing.

subscribe_item_changed_fn(self, arg0)

subscribe_value_changed_fn(self, arg0)

Adds the function that will be called every time the value changes.

Attributes

as_bool

Return the bool representation of the value.

as_float

Return the float representation of the value.

as_int

Return the int representation of the value.

as_string

Return the string representation of the value.

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

Constructs AbstractValueModel.

`kwargsdict`

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.

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.

### Arguments:

`id :`

The id that addBeginEditFn returns.

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

Remove the callback by its id.

### Arguments:

`id :`

The id that addEndEditFn returns.

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

Remove the callback by its id.

### Arguments:

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

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.