omni.flux.property_widget_builder.model.usd#
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.model.usd.ComboboxField(
- style_name: str = 'PropertiesWidgetField',
- identifier: str | None = None,
- class omni.flux.property_widget_builder.model.usd.DisableAllListenersBlock(listener_instance)#
Use to disable all listeners
Example
If you add multiple entity at the same time, you can do:
>>> with DisableAllListenersBlock(usd_listener_instance): >>> for i in range(100): >>> pass # usd action
- class omni.flux.property_widget_builder.model.usd.FileTexturePicker(
- file_extension_options: List[Tuple[str, str]] | None = None,
- style_name: str = 'PropertiesWidgetField',
- regex_hash: Pattern[str] | None = None,
Delegate of the tree
- class omni.flux.property_widget_builder.model.usd.USDAttrListItem(
- context_name: str,
- attribute_paths: List[Path],
- default_value: str,
- options: List[str],
- read_only: bool = False,
- value_type_name: ValueTypeName | None = None,
- metadata: dict | None = None,
- display_attr_names: List[str] | None = None,
- display_attr_names_tooltip: List[str] | None = None,
- metadata_key: str | None = None,
Item of the model
- value_model_class#
alias of
UsdListModelAttrValueModel
- class omni.flux.property_widget_builder.model.usd.USDAttributeDef(
- path: Path,
- attr_type: ValueTypeNames,
- op: XformOp | None = None,
- value: Any | None = None,
- exists: bool = False,
- documentation: str | None = None,
- display_group: str | None = None,
Holds arguments for a USD attribute that may be created at a later time.
- class omni.flux.property_widget_builder.model.usd.USDAttributeItem(
- context_name: str,
- attribute_paths: List[Path],
- display_attr_names: List[str] | None = None,
- display_attr_names_tooltip: List[str] | None = None,
- read_only: bool = False,
- value_type_name: ValueTypeName | None = None,
Item of the model
- property element_count#
Number of channel the attribute has (for example, float3 is 3 channels)
- class omni.flux.property_widget_builder.model.usd.USDAttributeItemStub(
- name: str,
- context_name: str,
- attribute_defs: Sequence[USDAttributeDef],
Holds USD attribute(s) that may be created at a later time.
- create_attributes()#
Create the USD attributes.
- refresh()#
Trigger a task to determine if the attributes should be created.
This can happen if the attributes are created by some mechanism besides interacting with widgets presented in the TreeView.
- subscribe_create_attributes_begin(function)#
Return the object that will automatically unsubscribe when destroyed.
- subscribe_create_attributes_end(function)#
Return the object that will automatically unsubscribe when destroyed.
- class omni.flux.property_widget_builder.model.usd.USDAttributeXformItem(
- context_name: str,
- attribute_paths: List[Path],
- display_attr_names: List[str] | None = None,
- display_attr_names_tooltip: List[str] | None = None,
- read_only: bool = False,
- value_type_name: ValueTypeName | None = None,
- class omni.flux.property_widget_builder.model.usd.USDAttributeXformItemStub(
- name: str,
- context_name: str,
- attribute_defs: Sequence[USDAttributeDef],
Holds USD XForm attribute(s) that may be created at a later time.
- class omni.flux.property_widget_builder.model.usd.USDBuilderList(iterable=(), /)#
An extension of the FieldBuilderList that has some additional USD specific registration helpers for constructing FieldBuilder instances.
- append_builder_by_attr_name(
- names: str | Iterable[str],
- build_func: Callable[[_Item], Widget | list[Widget] | None],
A simple helper which allows users to register a FieldBuilder with just attribute names and a build_func.
- static claim_by_name(
- *names: str,
Get a FieldBuilder claim_func that will claim items that use any USD attributes that match names.
- register_by_name(*names)#
Decorator to simplify registering a build function for USDAttributeItem for specific attribute name(s).
- register_by_type(*types)#
Decorator to simplify registering a build function for USDAttributeItem of specific type(s).
- class omni.flux.property_widget_builder.model.usd.USDDelegate(
- field_builders: list[FieldBuilder] | None = None,
- right_aligned_labels: bool = True,
Delegate of the tree
- build_branch(
- model: _USDModel,
- item: _Item,
- column_id: int = 0,
- level: int = 0,
- expanded: bool = False,
Create a branch widget that opens or closes the subtree for item that can have children, or the default & override widgets for items that can’t.
- reset()#
Resets any state stored on the delegate.
This method is called when the parent widget is hidden.
- property selection: list[_Item]#
Get the currently selected items
- value_model_updated(item: _Item)#
Callback ran whenever an item’s value model updates.
- class omni.flux.property_widget_builder.model.usd.USDFloatSliderField(
- min_value,
- max_value,
- step: int | None = None,
- style_name: str = 'FloatSliderField',
A FloatSliderField that will attempt to adjust it’s min/max range using USD attribute metadata.
- adjust_min_max_range(
- item: USDAttributeItem,
Attempts to adjust the sliders min/max range by inspecting the USD metadata.
- class omni.flux.property_widget_builder.model.usd.USDMetadataListItem(
- context_name: str,
- attribute_paths: List[Path],
- default_value: str,
- options: List[str],
- read_only: bool = False,
- value_type_name: ValueTypeName | None = None,
- metadata: dict | None = None,
- display_attr_names: List[str] | None = None,
- display_attr_names_tooltip: List[str] | None = None,
- metadata_key: str | None = None,
Item of the model
- value_model_class#
alias of
UsdListModelAttrMetadataValueModel
- class omni.flux.property_widget_builder.model.usd.USDModel(context_name: str = '')#
Basic list model
- property context_name: str#
The current used context
- property prim_paths: List[Path]#
The current used attribute paths
- set_items(
- items: List[_ItemGroup | USDAttributeItem],
Set the items to show
- Parameters:
items – the items to show
- set_prim_paths(value: List[Path])#
The current used attribute paths
- property stage: Stage#
The current used stage
- subscribe_attribute_created(function)#
Return the object that will automatically unsubscribe when destroyed.
- subscribe_item_model_end_edit(function)#
Return the object that will automatically unsubscribe when destroyed.
- subscribe_override_removed(function)#
Return the object that will automatically unsubscribe when destroyed.
- class omni.flux.property_widget_builder.model.usd.USDPropertyWidget(
- context_name: str = '',
- model: _Model | None = None,
- delegate: _Delegate | None = None,
- tree_column_widths: List[Length] = None,
- columns_resizable: bool = False,
- refresh_callback: Callable[[], None] | Callable[[], Awaitable[None]] | None = None,
Widget that let you build property widget(s) from any data
- class omni.flux.property_widget_builder.model.usd.USDPropertyWidgetExtension#
Create Final Configuration
- class omni.flux.property_widget_builder.model.usd.USDRelationshipItem(
- context_name: str,
- relationship_paths: List[Path],
- display_attr_names: List[str] | None = None,
- display_attr_names_tooltip: List[str] | None = None,
- read_only: bool = False,
- ui_metadata: dict[str, Any] | None = None,
Item representing USD relationship properties.
Parallel to USDAttributeItem but uses UsdRelationshipValueModel. Relationships are always single-target (element_count = 1).
- property ui_metadata: dict[str, Any]#
Get UI metadata hints for field builders.
- Returns:
Dict of UI hints (e.g., picker configuration). Framework stores this opaquely; consumers interpret the contents.
- class omni.flux.property_widget_builder.model.usd.VirtualUSDAttrListItem(
- context_name: str,
- attribute_paths: List[Path],
- default_value: str,
- options: List[str],
- read_only: bool = False,
- value_type_name: ValueTypeName | None = None,
- metadata: dict | None = None,
- display_attr_names: List[str] | None = None,
- display_attr_names_tooltip: List[str] | None = None,
- metadata_key: str | None = None,
Item of the model
- value_model_class#
alias of
VirtualUsdListModelAttrValueModel
- class omni.flux.property_widget_builder.model.usd.VirtualUSDAttributeItem(
- context_name: str,
- attribute_paths: List[Path],
- value_type_name: ValueTypeName,
- default_value: Any,
- display_attr_names: List[str] | None = None,
- display_attr_names_tooltip: List[str] | None = None,
- read_only: bool = False,
- metadata: dict | None = None,
- create_callback: Callable[[Any], None] | None = None,
Item of the model