NameColumnDelegate#

class omni.kit.widget.stage.NameColumnDelegate#

Bases: AbstractStageColumnDelegate

The column delegate that represents the type column

Methods

__init__()

build_header(**kwargs)

Build the header

build_widget(_, **kwargs)

Builds the widget for the given path.

build_widget_sync(_, **kwargs)

Build the type widget

destroy()

Place to release resources.

get_type_icon(node_type[, prim_path, stage])

Convert USD Type to icon file name.

on_header_hovered(hovered)

Callback when header area is hovered.

on_stage_items_destroyed(items)

Called when stage items are destroyed to give the opportunity for delegates to release corresponding resources.

rename_item(item)

set_highlighting([enable, text])

Specify if the widgets should consider highlighting.

Attributes

initial_width

The width of the column

minimum_width

The minimum width of the column.

order

The order to sort columns.

sort_policy

sortable

Whether this column is sortable or not.

__init__()#
build_header(**kwargs)#

Build the header

async build_widget(_, **kwargs)#

Builds the widget for the given path. Works inside a ui.Frame in async mode. Once the widget is created, it will replace the content of the frame. It allows to await something for a while and creates the widget when the result is available.

Parameters:

item (StageColumnItem) – DEPRECATED. It includes the non-cached simple prim information. It’s better to use keyword argument `stage_item` instead, which provides cached rich information about the prim influened by this column.

Keyword Arguments:
  • stage_model (StageModel) – The instance of current StageModel.

  • stage_item (StageItem) – The current StageItem to build. It’s possible that stage_item is None when TreeView enabled display of root node.

build_widget_sync(_, **kwargs)#

Build the type widget

destroy()#

Place to release resources.

get_type_icon(
node_type,
prim_path=None,
stage=None,
)#

Convert USD Type to icon file name.

Parameters:
  • node_type – The USD prim type name.

  • prim_path – Optional prim path for per-prim icon overrides.

  • stage – Optional USD stage for per-prim icon overrides.

on_header_hovered(hovered)#

Callback when header area is hovered.

Parameters:

hovered (bool) – Whether the header area is hovered.

on_stage_items_destroyed(
items: List[StageItem],
)#

Called when stage items are destroyed to give the opportunity for delegates to release corresponding resources.

Parameters:

items (List[StageItem]) – Stage items to be destroyed.

set_highlighting(
enable: bool = None,
text: str = None,
)#

Specify if the widgets should consider highlighting. Also set the text that should be highlighted in flat mode.

property initial_width#

The width of the column

property minimum_width#

The minimum width of the column.

Returns:

Minimum column width

Return type:

Union[ui.Pixel, ui.Fraction, ui.Percent]

property order#

The order to sort columns. The columns are sorted in ascending order from left to right of the stage widget. So the smaller the order is, the closer the column is to the left of the stage widget.

Returns:

sort order

Return type:

int

property sortable#

Whether this column is sortable or not. When it’s True, stage widget will build header widget with hover and selection state to tell user it’s sortable. This is only used to indicate to users that this column is sortable from the UX point of view.

Returns:

sortable or not

Return type:

bool