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

  • 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.delegates.AbstractField(
style_name: str = 'PropertiesWidgetField',
identifier: str | None = None,
)#

Bases: Generic[ItemT]

AbstractField that stores a style_name attribute to be used within build_ui for styling widgets.

__init__(
style_name: str = 'PropertiesWidgetField',
identifier: str | None = None,
) None#
abstract build_ui(
item: ItemT,
**kwargs,
) Widget | list[Widget] | None#
static set_dynamic_tooltip_fn(
widget: ui.Widget,
item_value_model: ItemModelBase,
) None#

Helper method to set dynamic tooltip function on a built widget.

class omni.flux.property_widget_builder.delegates.BytesToHuman(
style_name: str = 'PropertiesWidgetField',
identifier: str | None = None,
)#

Bases: AbstractField

Delegate of the tree

build_ui(item) list[Widget]#
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',
)#

Bases: AbstractField

Delegate of the tree

__init__(
display_precision: int = 2,
style_name: str = 'ColorsWidgetFieldRead',
)#
build_ui(item) list[Widget]#
class omni.flux.property_widget_builder.delegates.CreatorField(
text: str = 'Create',
clicked_callback: Callable[[], None] | None = None,
style_name: str = 'PropertiesWidgetField',
)#

Bases: AbstractField

A simple delegate that presents a button that when clicked will trigger the provided callback.

__init__(
text: str = 'Create',
clicked_callback: Callable[[], None] | None = None,
style_name: str = 'PropertiesWidgetField',
) None#
build_ui(item) list[Widget]#
class omni.flux.property_widget_builder.delegates.DefaultField(
widget_type: Type[Widget],
style_name: str = 'PropertiesWidgetField',
identifier: str | None = None,
)#

Bases: AbstractField

A default field can be used to create a simple widget(s) for an item’s value_models.

__init__(
widget_type: Type[Widget],
style_name: str = 'PropertiesWidgetField',
identifier: str | None = None,
)#
build_ui(item) list[Widget]#
class omni.flux.property_widget_builder.delegates.DefaultLabelField(
widget_type_name: str,
style_name: str = 'PropertiesWidgetField',
identifier: str | None = None,
)#

Bases: AbstractField

Delegate of the tree

__init__(
widget_type_name: str,
style_name: str = 'PropertiesWidgetField',
identifier: str | None = None,
)#
build_ui(item) list[Widget]#
class omni.flux.property_widget_builder.delegates.FileAccess(
style_name: str = 'PropertiesWidgetField',
identifier: str | None = None,
)#

Bases: AbstractField

Delegate of the tree

build_ui(item) list[Widget]#
static convert(value, _item_model)#
class omni.flux.property_widget_builder.delegates.FileFlags(
style_name: str = 'PropertiesWidgetField',
identifier: str | None = None,
)#

Bases: AbstractField

Delegate of the tree

build_ui(item) list[Widget]#
static convert(value, _item_model)#
class omni.flux.property_widget_builder.delegates.FilePicker(
file_extension_options: List[Tuple[str, str]] | None = None,
style_name: str = 'PropertiesWidgetField',
)#

Bases: AbstractField

__init__(
file_extension_options: List[Tuple[str, str]] | None = None,
style_name: str = 'PropertiesWidgetField',
)#

A delegate that will show a stringField with a file picker

Parameters:

file_extension_options

A list of filename extension options. Each list element is an (extension name, description) pair.

Examples: (“*.usdc”, “Binary format”) or (“.usd*”, “USD format”) or (“*.png, *.jpg, *.exr”, “Image format”) # noqa

build_ui(item) list[Widget]#
class omni.flux.property_widget_builder.delegates.FloatSliderField(
min_value,
max_value,
step: int | None = None,
style_name: str = 'FloatSliderField',
)#

Bases: AbstractField

__init__(
min_value,
max_value,
step: int | None = None,
style_name: str = 'FloatSliderField',
)#
begin_edit(_)#
build_ui(item) list[Widget]#
end_edit(_)#
property step: int#
class omni.flux.property_widget_builder.delegates.MultilineField(line_count, style_name: str = 'PropertiesWidgetField')#

Bases: AbstractField

__init__(
line_count,
style_name: str = 'PropertiesWidgetField',
) None#
build_ui(item) list[Widget]#
class omni.flux.property_widget_builder.delegates.NameField(
style_name: str = 'PropertiesWidgetField',
identifier: str | None = None,
)#

Bases: AbstractField

build_ui(item, right_aligned: bool = True)#