omni.flux.property_widget_builder.delegates#
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.property_widget_builder.delegates.AbstractDragFieldGroup(
- min_value: int | float | ScalarSequence | None = None,
- max_value: int | float | ScalarSequence | None = None,
- hard_min_value: int | float | ScalarSequence | None = None,
- hard_max_value: int | float | ScalarSequence | None = None,
- step: int | float | ScalarSequence | None = None,
- linkable: bool = False,
- **kwargs,
Abstract base for drag-style delegates with optional min/max bounds and step.
Subclasses must implement
build_drag_widget()to create the actual drag widget instance. Edit events are grouped for undo viabegin_edit()andend_edit().Hard bounds (
hard_min_value/hard_max_value) are forwarded to the widget, which is responsible for value clamping behavior. Soft bounds are drag-range hints only and are not promoted to typed-value clamps. Bounded drag widgets also use a matching hard bound as the drag bound when that soft side is omitted.- API note:
This class was renamed from
AbstractDragFieldtoAbstractDragFieldGroupto make it explicit that it orchestrates one or more drag widgets (for scalar/vector channels) rather than being a single concrete drag widget itself.
- begin_edit(model: ItemModelBase) None
Start an undo group for non-batched edits.
Typed edits use this begin/end pair directly. Drag edits on batch-capable models open and close their undo group from the widget mouse callbacks.
- abstractmethod build_drag_widget(
- model: AbstractValueModel,
- style_type_name_override: str,
- read_only: bool,
- min_val: int | float | None,
- max_val: int | float | None,
- hard_min_val: int | float | None,
- hard_max_val: int | float | None,
- step: int | float | None,
Build the drag widget for one value model.
- Parameters:
model – Value model to bind to the widget.
style_type_name_override – Style name for the widget (e.g. read-only variant).
read_only – Whether the widget should be read-only.
min_val – Minimum value for the widget, or
Nonefor unbounded.max_val – Maximum value for the widget, or
Nonefor unbounded.hard_min_val – Hard minimum value for typed-value clamping, or
Nonefor no lower hard bound.hard_max_val – Hard maximum value for typed-value clamping, or
Nonefor no upper hard bound.step – Step size for the widget, or
Noneto omit.
- Returns:
The built drag widget (typically
FloatBoundedDrag/IntBoundedDragwrappers or otherui.Widget-compatible drag controls).
- build_ui(
- item,
- **kwargs,
Build drag widgets for each element of the item, with undo grouping and tooltips.
- destroy() None
Release resources retained for every built drag-field row.
- end_edit(model: ItemModelBase) None
End the current edit.
For batch-edit models, this closes any active drag batch if needed. For non-batch models, this closes the regular undo group.
- class omni.flux.property_widget_builder.delegates.AbstractField(
- style_name: str = 'PropertiesWidgetField',
- identifier: None | str = None,
AbstractField that stores a style_name attribute to be used within build_ui for styling widgets.
- static set_dynamic_tooltip_fn(
- widget: ui.Widget,
- item_value_model: ItemModelBase,
Helper method to set dynamic tooltip function on a built widget.
- static set_style_state(
- widget: Widget,
- selected: bool | None = None,
- mixed: bool | None = None,
Update selected and mixed suffixes on a field’s style override.
- class omni.flux.property_widget_builder.delegates.BytesToHuman(
- style_name: str = 'PropertiesWidgetField',
- identifier: None | str = None,
Delegate of the tree
- static convert_size(size_bytes, _item_model)
Convert bytes to something more readable
- class omni.flux.property_widget_builder.delegates.ColorField(
- display_precision: int = 2,
- style_name: str = 'ColorsWidgetFieldRead',
- *,
- context_name: str | None = None,
Own color channels and property transactions for a floating picker.
- build_ui(item) list[Widget]
Build the color field and subscribe weakly to its backing value model.
- class omni.flux.property_widget_builder.delegates.ColorGradientField(
- model: GroupedKeysModel,
- group_id: str,
- default_color: tuple[float, float, float, float] | None = None,
- read_only: bool = False,
- time_range: tuple[float, float] = (0.0, 1.0),
- title: str = '',
- *,
- context_name: str | None = None,
- identifier: str | None = None,
- pre_open_fn: Callable[[Callable[[], None]], None] | None = None,
Display an inline Gradient preview that launches independent disposable editors.
- build_ui(
- item: _PropertyWidgetItem | None,
- **kwargs: Any,
Build the color-gradient widget for the value column.
- Parameters:
item – Unused property tree item; the supplied model owns this field’s data.
**kwargs – Additional UI options forwarded by the delegate.
- Returns:
Built UI widgets for this field.
- destroy() None
Disable this launcher and release its references without affecting an open editor.
- class omni.flux.property_widget_builder.delegates.ComboboxField(
- style_name: str = 'PropertiesWidgetField',
- identifier: None | str = None,
Build a ComboBox for an item backed by an AbstractItemModel.
- build_ui(item) list[Widget]
Build the choice field for an item.
- Parameters:
item – Property item whose first value model supplies the choices.
- Returns:
A single-element list containing the built ComboBox widget.
- class omni.flux.property_widget_builder.delegates.CreatorField(
- text: str = 'Create',
- clicked_callback: Callable[[], None] | None = None,
- style_name: str = 'PropertiesWidgetField',
A simple delegate that presents a button that when clicked will trigger the provided callback.
- class omni.flux.property_widget_builder.delegates.DefaultField(
- widget_type: type[Widget],
- style_name: str = 'PropertiesWidgetField',
- identifier: None | str = None,
A default field can be used to create a simple widget(s) for an item’s value_models.
- class omni.flux.property_widget_builder.delegates.DefaultLabelField(
- widget_type_name: str,
- style_name: str = 'PropertiesWidgetField',
- identifier: None | str = None,
Delegate of the tree
- class omni.flux.property_widget_builder.delegates.DragFieldGroupCoordinator
Coordinate linked-row focus and preemption without consumer-specific widget access.
- cancel_active_text_edit() None
Cancel dirty linked text before a link press can move keyboard focus.
- link_changed(
- state: _DragFieldBuildState,
- enabled: bool,
Preempt the active row and drive the current row’s editor lifecycle.
- register(
- state: _DragFieldBuildState,
Register the newest visual build for one linked item.
- reset() None
Cancel deferred work and forget all rows.
- unregister(
- state: _DragFieldBuildState,
Forget a visual build only when it is still the current one.
- class omni.flux.property_widget_builder.delegates.FieldPopupWindow(
- *,
- title: str,
- context_name: str | None,
- pre_open_fn: Callable[[Callable[[], None]], None] | None = None,
Host one disposable property popup, with at most one active window application-wide.
- close() None
Close this window permanently, deferring cleanup only for activated content.
- destroy() None
Close this window permanently through the ordered cleanup path.
- property is_open: bool
Whether this window has visible active content rather than pending or closing content.
- open(
- *,
- preferred_size: tuple[float, float],
- anchor_rect: tuple[float, float, float, float] | None = None,
Prepare this window once, or focus it when already visible.
Geometry is captured before preparation can refresh the row. Continuations are one-shot and invalidated by close or destruction. Only the latest activation-ready request builds after outgoing content detaches and its window is destroyed. Opening a closed window does nothing.
Ordinary closure defers detachment and cleanup by one update. Build failure finalizes never-displayed content immediately. Direct errors propagate; deferred errors are logged with their traceback.
- Parameters:
preferred_size – Initial width and height in logical pixels, clamped to the workspace.
anchor_rect – Launcher left, top, width, and height in logical application coordinates, or None to center.
- class omni.flux.property_widget_builder.delegates.FileAccess(
- style_name: str = 'PropertiesWidgetField',
- identifier: None | str = None,
Delegate of the tree
- class omni.flux.property_widget_builder.delegates.FileFlags(
- style_name: str = 'PropertiesWidgetField',
- identifier: None | str = None,
Delegate of the tree
- class omni.flux.property_widget_builder.delegates.FilePicker(
- file_extension_options: list[tuple[str, str]] | None = None,
- style_name: str = 'PropertiesWidgetField',
- use_relative_paths: bool = False,
- identifier: str | None = None,
- picker_identifier: str | None = None,
- *,
- stage_resolver: Callable[[ItemModelBase], Usd.Stage | None] | None = None,
- class omni.flux.property_widget_builder.delegates.FloatDragFieldGroup(
- min_value: int | float | ScalarSequence | None = None,
- max_value: int | float | ScalarSequence | None = None,
- hard_min_value: int | float | ScalarSequence | None = None,
- hard_max_value: int | float | ScalarSequence | None = None,
- step: int | float | ScalarSequence | None = None,
- **kwargs,
A float drag field delegate with optional min/max bounds and step.
- build_drag_widget(
- model: AbstractValueModel,
- style_type_name_override: str,
- read_only: bool,
- min_val: float | int | None,
- max_val: float | int | None,
- hard_min_val: float | int | None,
- hard_max_val: float | int | None,
- step: float | int | None,
Build a ui.FloatDrag widget, only passing bounds/step that are set.
- property step: int | float | ScalarSequence
Step size; uses explicit step if set, else derives from effective range or falls back to 1.0.
- class omni.flux.property_widget_builder.delegates.IntDragFieldGroup(
- min_value: int | float | ScalarSequence | None = None,
- max_value: int | float | ScalarSequence | None = None,
- hard_min_value: int | float | ScalarSequence | None = None,
- hard_max_value: int | float | ScalarSequence | None = None,
- step: int | float | ScalarSequence | None = None,
- **kwargs,
An integer drag field delegate with optional min/max bounds and step.
- build_drag_widget(
- model: AbstractValueModel,
- style_type_name_override: str,
- read_only: bool,
- min_val: float | int | None,
- max_val: float | int | None,
- hard_min_val: float | int | None,
- hard_max_val: float | int | None,
- step: float | int | None,
Build a ui.IntDrag widget, only passing bounds/step that are set.
- property step: int | float | ScalarSequence
Step size; uses explicit step if set, else derives from effective range or falls back to 1.
- class omni.flux.property_widget_builder.delegates.MultilineField(line_count, style_name: str = 'PropertiesWidgetField')
- class omni.flux.property_widget_builder.delegates.NameField(
- style_name: str = 'PropertiesWidgetField',
- identifier: None | str = None,
Build property name labels with optional selected behavior.
- build_ui(
- item,
- right_aligned: bool = True,
- selected: bool = False,
- subscribe_selected_changed: Callable[[Callable[[bool], None]], object] | None = None,
- register_subscription: Callable[[object], None] | None = None,
Build the property name cell and optional persistent selection behavior.