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

  • 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.property_widget_builder.model.native.NativeBuilderList(iterable=(), /)#

Bases: FieldBuilderList

Extension of FieldBuilderList with registration helpers for native Python types.

Parallel to USDBuilderList but dispatches by item.value_type (a Python type) instead of USD attribute metadata.

register_by_value_type(
*value_types: type,
) Callable#

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: ItemModel

Adapt typed native choices to the ComboBox item-model contract.

get_item_children(
item: _ChoiceItem | None = None,
) list[_ChoiceItem]#

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,
) int#

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],
) Subscription#

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: Delegate

Delegate for property widgets displaying native Python-typed data.

Parallel to USDDelegate but dispatches field builders based on item.value_type (a Python type like float, bool, str) instead of USD attribute metadata.

Any Item that exposes a value_type: type property will get type-appropriate widgets (FloatDrag, IntDrag, CheckBox, StringField). Items whose value_type does not match any registered builder fall back to a read-only DefaultLabelField showing the type name.

class omni.flux.property_widget_builder.model.native.NativeItem#

Bases: Item

Base property item whose exact Python type selects a native editor.

abstract property value_type: type#

Return the exact Python type represented by this property.

Returns:

Type used by the native field-builder registry.