omni.flux.property_widget_builder.model.native#
SPDX-FileCopyrightText: Copyright (c) 2026 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.property_widget_builder.model.native.NativeBuilderList(iterable=(), /)#
Bases:
FieldBuilderListExtension of FieldBuilderList with registration helpers for native Python types.
Parallel to
USDBuilderListbut dispatches byitem.value_type(a Python type) instead of USD attribute metadata.- register_by_value_type(
- *value_types: type,
Register a builder for one or more exact native value types.
- Parameters:
value_types – Exact Python types handled by the registered builder.
- Returns:
Decorator that registers the supplied build function.
- class omni.flux.property_widget_builder.model.native.NativeChoiceModel(
- value_model: ItemValueModel,
- choices: tuple[Any, ...],
Bases:
ItemModelAdapt typed native choices to the ComboBox item-model contract.
- get_item_children(
- item: _ChoiceItem | None = None,
Return the available choices for the model root.
- Parameters:
item – Parent choice, or None for the model root.
- Returns:
All choices for the root and no children for an option.
- get_item_value_model(
- item: _ChoiceItem | None = None,
- column_id: int = 0,
Return the selected-index model or an option label model.
- Parameters:
item – Choice whose label is requested, or None for the selected index.
column_id – Requested model column. Native choices expose one column.
- Returns:
The current-index model for the root or the label model for a choice.
- get_item_value_model_count(
- item: _ChoiceItem | None = None,
Return the single value-model column exposed by native choices.
- Parameters:
item – Item being queried. Native choices always expose one column.
- Returns:
One value-model column.
- get_tool_tip()#
Return the tooltip from the wrapped property value model.
- Returns:
Tooltip text supplied by the wrapped model.
- get_value() Any#
Return the current typed value.
- Returns:
Value stored by the wrapped native property model.
- refresh() None#
Synchronize the selected index with the underlying typed value.
- subscribe_value_changed_fn(
- callback: Callable[[SimpleIntModel], None],
Subscribe to selected-choice changes.
- Parameters:
callback – Function invoked with the selected-index model.
- Returns:
Subscription that owns the callback lifetime.
- class omni.flux.property_widget_builder.model.native.NativeDelegate(
- field_builders: list[FieldBuilder] | None = None,
- right_aligned_labels: bool = True,
Bases:
DelegateDelegate for property widgets displaying native Python-typed data.
Parallel to
USDDelegatebut dispatches field builders based onitem.value_type(a Python type likefloat,bool,str) instead of USD attribute metadata.Any
Itemthat exposes avalue_type: typeproperty will get type-appropriate widgets (FloatDrag, IntDrag, CheckBox, StringField). Items whosevalue_typedoes not match any registered builder fall back to a read-onlyDefaultLabelFieldshowing the type name.