omni.kit.window.property: Property Window Extension

Property Window

omni.kit.window.property.get_window()

Property Widget

class omni.kit.window.property.property_widget.PropertyWidget(title: str)

Bases: object

Base class to create a group of widgets in Property Window

build(filter: Optional[PropertyFilter] = None)
abstract build_impl()

Main function to creates the UI elements.

abstract clean()

Clean up function to be called before destorying the object.

abstract on_new_payload(payload) bool

Called when a new payload is delivered. PropertyWidget can take this opportunity to update its ui models, or schedule full UI rebuild.

Parameters

payload – The new payload to refresh UI or update model.

Returns

True if the UI needs to be rebuilt. build_impl will be called as a result. False if the UI does not need to be rebuilt. build_impl will not be called.

abstract reset()

Clean up function to be called when previously built widget is no longer visible given new scheme/payload

Property Scheme Delegate

class omni.kit.window.property.property_scheme_delegate.PropertySchemeDelegate

Bases: object

PropertySchemeDelegate is a class to test given payload and determine what widgets to be drawn in what order.

get_unwanted_widgets(payload) List[str]

Tests the payload and returns a list of widget names which this delegate does not want to include. Note that if there is another PropertySchemeDelegate returning widget in its get_widgets that conflicts with names in get_unwanted_widgets, get_widgets always wins (i.e. the Widget will be drawn).

This function is optional.

abstract get_widgets(payload) List[str]

Tests the payload and gathers widgets in interest to be drawn in specific order.

Property Widgets Templates

class omni.kit.window.property.templates.GroupHeaderContextMenu

Bases: object

destroy()
classmethod on_mouse_event(event: GroupHeaderContextMenuEvent)
class omni.kit.window.property.templates.GroupHeaderContextMenuEvent(group_id: str, payload: Any)

Bases: object

class omni.kit.window.property.templates.PropertyWidget(title: str)

Bases: object

Base class to create a group of widgets in Property Window

build(filter: Optional[PropertyFilter] = None)
abstract build_impl()

Main function to creates the UI elements.

abstract clean()

Clean up function to be called before destorying the object.

abstract on_new_payload(payload) bool

Called when a new payload is delivered. PropertyWidget can take this opportunity to update its ui models, or schedule full UI rebuild.

Parameters

payload – The new payload to refresh UI or update model.

Returns

True if the UI needs to be rebuilt. build_impl will be called as a result. False if the UI does not need to be rebuilt. build_impl will not be called.

abstract reset()

Clean up function to be called when previously built widget is no longer visible given new scheme/payload

class omni.kit.window.property.templates.SimplePropertyWidget(title: str, collapsed: bool = False, collapsable: bool = True)

Bases: PropertyWidget

SimplePropertyWidget provides a simple vertical list of “Label” -> “Value widget” pair layout.

add_item(label: str, value)

This function is supposed to be called inside of build_items function. Adds a “Label” -> “Value widget” pair item to the widget. “value” will be an uneditable string in a StringField.

Parameters
  • label (str) – The label text of the entry.

  • value – The value to be stringified and displayed in a StringField.

add_item_with_model(label: str, model, editable: bool = False, identifier: Optional[str] = None)

This function is supposed to be called inside of build_items function. Adds a “Label” -> “Value widget with model” pair item to the widget. “value” will be an editable string in a StringField backed by supplied model.

Parameters
  • label (str) – The label text of the entry.

  • model – The model to be used by the string field.

  • editable – If the StringField generated from model should be editable. Default is False.

add_label(label: str)

Add a Label with a highlight text based on current filter

build_impl()

See PropertyWidget.build_impl

build_items()

When deriving from SimplePropertyWidget, override this function to build your items.

clean()

See PropertyWidget.clean

on_new_payload(payload, ignore_large_selection=False) bool

See PropertyWidget.on_new_payload

request_rebuild()

Request the widget to rebuild. It will be rebuilt on next frame.

reset()

See PropertyWidget.reset