Plugins#
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.stage_manager.factory.plugins.ColumnWidth(*args: Any, **kwargs: Any)#
Bases:
BaseModel
- unit: LengthUnit = Ellipsis#
- value: float = Ellipsis#
- class omni.flux.stage_manager.factory.plugins.LengthUnit(value)#
Bases:
Enum
An enumeration.
- FRACTION = 'Fraction'#
- PERCENT = 'Percent'#
- PIXEL = 'Pixel'#
- class omni.flux.stage_manager.factory.plugins.StageManagerColumnPlugin(*args: Any, **kwargs: Any)#
Bases:
StageManagerUIPluginBase
,ABC
A plugin that allows the grouping of multiple widgets in a column
- build_header()#
Build the UI for the given column header.
- abstract build_overview_ui(
- model: _StageManagerTreeModel,
Build the result UI for the given column. The result UI is displayed at the bottom the TreeView widget. It should be used to display additional information about all the items in the column.
- abstract build_ui(
- model: _StageManagerTreeModel,
- item: _StageManagerTreeItem,
- level: int,
- expanded: bool,
Build the UI for the given column. This function will be used within a delegate and should therefore only build the UI for a single element.
- centered_title: bool = False#
- display_name: str = Ellipsis#
- tooltip: str = ''#
- widgets: list[StageManagerWidgetPlugin] = Ellipsis#
- class omni.flux.stage_manager.factory.plugins.StageManagerContextPlugin(*args: Any, **kwargs: Any)#
Bases:
StageManagerPluginBase
,ABC
A plugin that allows setting up a context for the other Stage Manager plugins to use afterward.
There should only ever be one context plugin active at any time.
- check_unique_listeners(v)#
- class property data_type: StageManagerDataTypes#
The data type that this plugin provides.
- abstract class property display_name: str#
The string to display when displaying the plugin in the UI
- abstract get_items() list[StageManagerItem] #
Get the items that should be used by the other plugins. This will be called whenever the interaction plugin needs updated data.
- Returns:
A list of items to be used by the other plugins.
- listeners: list[StageManagerListenerPlugin] = Ellipsis#
- setup()#
Set up the context. This will be called once by the core.
- subscribe_listener_event_occurred(
- event_type: type,
- function: Callable[[Any], None],
Subscribe to any listener that utilizes a matching event type.
- Parameters:
event_type – The event type to listen to
function – The callback to execute when an event of the given type is executed
- Raises
ValueError: If no listener is compatible with the given event type
- Returns:
A list of Event Subscriptions that will unsubscribe automatically on deletion
- class omni.flux.stage_manager.factory.plugins.StageManagerFilterPlugin(*args: Any, **kwargs: Any)#
Bases:
StageManagerUIPluginBase
,ABC
A plugin that allows filtering a list of items based on parameters controlled within the plugin
- display: bool = True#
- abstract filter_predicate(
- item: StageManagerItem,
- Parameters:
item – The Stage Manager item to filter.
- Returns:
Whether the item should be kept or not.
- subscribe_filter_items_changed(
- callback: Callable[[], None],
Return the object that will automatically unsubscribe when destroyed.
- class omni.flux.stage_manager.factory.plugins.StageManagerInteractionPlugin(*args: Any, **kwargs: Any)#
Bases:
StageManagerUIPluginBase
,ABC
A plugin that encompasses other plugins in the Stage Manager. The Interaction Plugin builds the TreeWidget and uses the filter, column & widget plugins to build the contents.
- class Config#
Bases:
Config
- fields = {'compatible_data_type': {'exclude': True}, 'compatible_filters': {'exclude': True}, 'compatible_trees': {'exclude': True}, 'compatible_widgets': {'exclude': True}, 'display_name': {'exclude': True}, 'tooltip': {'exclude': True}, 'tree': {'exclude': True}}#
- __init__(**kwargs)#
- alternate_row_colors: bool = True#
- build_ui()#
The method used to build the UI for the plugin.
- Raises:
ValueError – If the plugin was not initialized before building the UI.
- check_plugin_compatibility(values)#
- check_positive_frame_count(v)#
- check_unique_filters(v)#
- check_valid_percent_available_core_usage(
- v,
- columns: list[StageManagerColumnPlugin] = []#
- class property compatible_data_type: StageManagerDataTypes#
The data type this plugin supports
- abstract class property compatible_filters: list[str]#
Get the list of filter plugins compatible with this interaction plugin
- abstract class property compatible_trees: list[str]#
Get the list of tree plugins compatible with this interaction plugin
- abstract class property compatible_widgets: list[str]#
Get the list of widget plugins compatible with this interaction plugin
- context_filters: list[StageManagerFilterPlugin] = []#
- debounce_frames: int = 5#
- destroy()#
- filters: list[StageManagerFilterPlugin] = []#
- header_height: int = 28#
- include_invalid_parents: bool = True#
- internal_context_filters: list[StageManagerFilterPlugin] = []#
- percent_available_core_usage: float | None = None#
- row_height: int = 28#
- set_active(value: bool)#
Whether the interaction plugin is active or not. Only 1 interaction plugin should be active at a time. Active status should be managed by the widget
- Parameters:
value – whether the interaction plugin is active or not
- setup(
- value: StageManagerContextPlugin,
Set up the interaction plugin with the given context.
- Parameters:
value – the context the interaction plugin should use
- subscribe_context_items_changed(
- callback: Callable[[], None],
Execute the callback when context items are updated.
- Parameters:
callback – The callback to execute
- Returns:
Return an object that will automatically unsubscribe when destroyed.
- abstract class property tree: StageManagerTreePlugin#
The tree plugin defining the model and delegate
- class omni.flux.stage_manager.factory.plugins.StageManagerListenerPlugin(*args: Any, **kwargs: Any)#
Bases:
StageManagerPluginBase
,Generic
[T
],ABC
A plugin that allows listening to a source and notify any plugin listening
- __init__(**kwargs)#
- class property compatible_data_type#
An enumeration.
- abstract class property event_type: type#
The type of event that this listener subscribes to
- abstract setup()#
A method called during the context initialization to initialize the listener
- subscribe_event_occurred(
- callback: Callable[[T], None],
Return the object that will automatically unsubscribe when destroyed.
- class omni.flux.stage_manager.factory.plugins.StageManagerTreePlugin(*args: Any, **kwargs: Any)#
Bases:
StageManagerPluginBase
,ABC
A plugin that provides a TreeView model and delegate
- abstract class property delegate: StageManagerTreeDelegate#
- abstract class property model: StageManagerTreeModel#
- class omni.flux.stage_manager.factory.plugins.StageManagerWidgetPlugin(*args: Any, **kwargs: Any)#
Bases:
StageManagerUIPluginBase
,ABC
A plugin that provides a widget for the TreeView
- abstract build_overview_ui(
- model: _StageManagerTreeModel,
- abstract build_ui(
- model: _StageManagerTreeModel,
- item: _StageManagerTreeItem,
- level: int,
- expanded: bool,
The method used to build the UI for the plugin.
- subscribe_item_clicked(
- callback: Callable[[int, bool, _StageManagerTreeModel, _StageManagerTreeItem], None],
Subscribe to the event that is triggered when a widget is clicked.
- Parameters:
callback – A function that will be called when the widget is clicked.
- Returns:
An object that will automatically unsubscribe when destroyed.