API#
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
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#
Bases:
AbstractItemDelegate
- __init__(
- self: omni.ui._ui.AbstractItemDelegate,
Constructs AbstractItemDelegate.
- kwargs : dict
See below
### Keyword Arguments:
- 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,
This pure abstract method must be reimplemented to generate custom widgets for specific item in the model.
- destroy()#
- 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
- on_item_selected(selected_items, all_items)#
- refresh_gradient_color(item, deferred=True)#
- reset()#
- class omni.flux.selection_history_tree.widget.SelectionHistoryItem(title: str, data=None, tooltip: str = '')#
Bases:
AbstractItem
- __init__(self: omni.ui._ui.AbstractItem) None #
- 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#
Bases:
AbstractItemModel
- MAX_LIST_LENGTH = 200#
- __init__(
- self: omni.ui._ui.AbstractItemModel,
Constructs AbstractItemModel.
- kwargs : dict
See below
### Keyword Arguments:
- 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,
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],
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.
- class omni.flux.selection_history_tree.widget.SelectionHistoryWidget(
- model: SelectionHistoryModel | None = None,
- delegate: SelectionHistoryDelegate | None = None,
Bases:
object
- __init__(
- model: SelectionHistoryModel | None = None,
- delegate: SelectionHistoryDelegate | None = None,
- destroy()#
- show(value: bool)#
Let the widget know if it’s visible or not. Keep it for the pattern.