omni.flux.selection_history_tree.widget#

  • SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.

  • SPDX-License-Identifier: Apache-2.0

  • Licensed under the Apache License, Version 2.0 (the “License”);

  • you may not use this file except in compliance with the License.

  • You may obtain a copy of the License at

  • https://www.apache.org/licenses/LICENSE-2.0

  • Unless required by applicable law or agreed to in writing, software

  • distributed under the License is distributed on an “AS IS” BASIS,

  • WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

  • See the License for the specific language governing permissions and

  • limitations under the License.

class omni.flux.selection_history_tree.widget.SelectionHistoryDelegate#
build_widget(
self: omni.ui._ui.AbstractItemDelegate,
model: omni.ui._ui.AbstractItemModel,
item: omni.ui._ui.AbstractItem = None,
index: int = 0,
level: int = 0,
expanded: bool = False,
) None#

This pure abstract method must be reimplemented to generate custom widgets for specific item in the model.

get_path_scroll_frames()#

Get the scroll frames used in the delegates. This can be used to control the scrolling of the items externally.

Returns:

A list of the scroll frames displayed in the tree widget

class omni.flux.selection_history_tree.widget.SelectionHistoryItem(title: str, data=None, tooltip: str = '')#
property data: str#

Any data that the item needs to carry.

is_valid() bool#

Return True is the item is valid or not

property title: str#

The title is the property that will be displayed in the tree widget

property tooltip#

Tooltip of the item

class omni.flux.selection_history_tree.widget.SelectionHistoryModel#
get_active_items() list[Any]#

Get the currently active item. For USD this could be the selected viewport item

Returns:

A list of all active items

get_item_children(
item: SelectionHistoryItem | None = None,
)#

Returns all the children when the widget asks it.

get_item_value_model(
item: SelectionHistoryItem | None = None,
)#

Return value model. It’s the object that tracks the specific value.

get_item_value_model_count(
item: SelectionHistoryItem | None = None,
)#

The number of columns

insert_items(
items: list[SelectionHistoryItem],
idx: int = 0,
) None#

Insert items at the given position

Parameters:
  • items – the items to insert

  • idx – the index on the list

refresh() None#

Force a refresh of the model.

reset()#

Reset the model

set_active_items(
items: list[SelectionHistoryItem],
) None#

Set the currently active item. For USD this could be the selected viewport item

Parameters:

items – the items to set as active

subscribe_on_active_items_changed(
function: Callable[[list[SelectionHistoryItem]], Any],
)#

Subscribe to the on_active_items_changed event.

Parameters:

function – the callback to execute when the event is triggered

Returns:

An object that will automatically unsubscribe when destroyed.