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.navigator.widget.NavigatorWidget
Bases:
object
- __init__()
- destroy()
- get_current_selected_id()
Get the ID of the currently selected widget
- get_widgets()
Get the dictionary of registered widgets
- go_down()
Select the nearest widget under the current selected item.
The registered widgets must have at least 1 pixel spacing between each other, or the nearest neighbor will be filtered out.
- Returns
The id of the new selected object
- go_left()
Select the nearest widget to the left of the current selected item.
The registered widgets must have at least 1 pixel spacing between each other, or the nearest neighbor will be filtered out.
- Returns
The id of the new selected object
- go_right()
Select the nearest widget to the right of the current selected item.
The registered widgets must have at least 1 pixel spacing between each other, or the nearest neighbor will be filtered out.
- Returns
The id of the new selected object
- go_up()
Select the nearest widget over the current selected item.
The registered widgets must have at least 1 pixel spacing between each other, or the nearest neighbor will be filtered out.
- Returns
The id of the new selected object
- register_widgets(widgets: Dict[str, omni.ui._ui.Widget])
Register the navigable widgets.
The registered widgets must have at least 1 pixel spacing between each other, or the nearest neighbor will be filtered out.
- Parameters
widgets – dictionary of widget ids and widgets to register to the navigator
- set_current_selected_id(widget_id)
Set the ID of the currently selected widget
- unregister_widgets(ids: Optional[List[str]] = None)
Unregister the navigable widgets.
- Parameters
ids – list of widget ids to unregister from the navigator, if None all the widgets will be unregistered