MaterialListBoxWidget#

class omni.kit.material.library.MaterialListBoxWidget(
icon_path: str,
index: int,
on_click_fn: callable,
theme: str,
filter_fn: callable = None,
get_materials_async_fn: callable = None,
)#

Bases: object

Simulated combobox widget with drop-down list of materials from stage class.

Methods

__init__(icon_path, index, on_click_fn, theme)

Initialize class function.

build_ui()

Build UI for list box widget.

clean()

Clean up widget.

destroy()

Destroy class and cleanup.

set_parent(parent)

Set widget parent

set_selection_on_loading_complete(selection)

When loading material list is complete, select these materials in the list.

__init__(
icon_path: str,
index: int,
on_click_fn: callable,
theme: str,
filter_fn: callable = None,
get_materials_async_fn: callable = None,
)#

Initialize class function.

Parameters:
  • icon_path (str) – path to icons, if None then omni.kit.material.library/data/icons will be used.

  • index (int) – default item in combobox.

  • on_click_fn (callable) – function called when combobox item changed.

  • theme (str) – theme name, should be “NvidiaDark” or “NvidiaLight”. Not wildly supported.

  • filter_fn (callable) – filter function passed to MaterialListModel.

  • get_materials_async_fn (callable) – override for default omni.kit.material.library.get_materials_from_stage_async callback.

build_ui()#

Build UI for list box widget.

clean()#

Clean up widget.

destroy()#

Destroy class and cleanup.

set_parent(parent: Widget)#

Set widget parent

Parameters:

parent (ui.Widget) – parent widget to pin widget to.

set_selection_on_loading_complete(
selection: str,
)#

When loading material list is complete, select these materials in the list.