StageWidget#
- class omni.kit.widget.stage.StageWidget(
- stage: Stage,
- columns_accepted: List[str] = None,
- columns_enabled: List[str] = None,
- lazy_payloads: bool = False,
- **kwargs,
Bases:
object
The Stage widget that represents the stage with a tree view displaying the prim hierarchy with multiple columns. For each treeview item, multiple columns representing different aspects for the prim can be customized and displayed. It also provides context menu items associated with the stage/prims.
Methods
__init__
(stage[, columns_accepted, ...])The constructor for the Stage Widget.
collapse
(path)Set the given path to be collapsed.
destroy
()Called by extension before destroying this object.
expand
(path)Sets the given path to be expanded.
filter_by_abstract_state
(enabled)Filter Abstract On/Off
filter_by_active_state
(enabled)Filter Active On/Off
filter_by_api_type
(api_types, enabled)Set filtering by USD api type.
filter_by_def_state
(enabled)Filter Def On/Off
filter_by_lambda
(filters, enabled)Set filtering by lambda.
filter_by_text
(filter_text)Set the search filter string to the models and widgets
filter_by_type
(usd_types, enabled)Set filtering by USD type.
filter_by_visibility
(enabled)Filter Hidden On/Off
Gets the stage model.
open_stage
(stage)Called when opening a new stage.
Sets the column width for treeview and flat treeview.
Sets the fixed width columns record for treeview and flat treeview.
set_selection_watch
(selection)Sets the selection watch of the current stage widget.
set_widget_visible
(widget, visible)Utility for using in lambdas
Subscribe to columns changed event with fn.
update_filter_menu_state
(filter_type_list)Enable filters.
Attributes
Whether prims are auto loaded.
Whether children re-ordering is supported.
Whether to show abstract prims.
Whether to show all inactive prims.
Whether to show display names for prims.
Whether to show undefined prims.
- __init__(
- stage: Stage,
- columns_accepted: List[str] = None,
- columns_enabled: List[str] = None,
- lazy_payloads: bool = False,
- **kwargs,
The constructor for the Stage Widget.
- Parameters:
stage (Usd.Stage) – The instance of USD stage to be managed by this widget.
- Keyword Arguments:
columns_accepted (List[str]) – The list of columns that are supported. By default, it’s all registered columns if this arg is not provided.
columns_enabled (List[str]) – The list of columns that are enabled when the widget is shown by default.
lazy_payloads (bool) – Whether it should load all payloads when stage items are shown or not. False by default.
children_reorder_supported (bool) – Whether it should enable children reorder support or not. By default, children reorder support is disabled, which means you cannot reorder children in the widget, and renaming name of prim will put the prim at the end of the children list. REMINDER: Enabling this option has performance penalty as it will trigger re-composition to the parent of the reordered/renamed prims.
show_prim_display_name (bool) – Whether it’s to show displayName from prim’s metadata or the name of the prim. By default, it’s False, which means it shows name of the prim.
auto_reload_prims (bool) – Whether it will auto-reload prims if there are any new changes from disk. By default, it’s disabled.
show_undefined_prims (bool) – Whether it’s to show prims that have no def or not. By default, it’s False.
show_inactive_prims (bool) – Whether it’s to show prims that have active=False. By default, it’s True.
show_abstract_prims (bool) – Whether it’s to show prims that have are abstract. By default, it’s True.
- Other:
All other arguments inside kwargs except the above 3 will be passed as params to the ui.Frame for the stage widget.
- collapse(path: Path)#
Set the given path to be collapsed.
- Parameters:
path (Sdf.Path) – Path to be collapsed.
- destroy()#
Called by extension before destroying this object. It doesn’t happen automatically. Without this hot reloading doesn’t work.
- expand(path: Path)#
Sets the given path to be expanded.
- Parameters:
path (Sdf.Path) – Path to be expanded.
- filter_by_abstract_state(enabled)#
Filter Abstract On/Off
- filter_by_active_state(enabled)#
Filter Active On/Off
- filter_by_api_type(api_types, enabled)#
Set filtering by USD api type.
- Parameters:
api_types – The api type or the list of types it’s necessary to add or remove from filters.
enabled – True to add to filters, False to remove them from the filter list.
- filter_by_def_state(enabled)#
Filter Def On/Off
- filter_by_lambda(filters: dict, enabled)#
Set filtering by lambda.
- Parameters:
filters – The dictionary of this form: {“type_name_string”, lambda prim: True}. When lambda is True, the prim will be shown.
enabled – True to add to filters, False to remove them from the filter list.
- filter_by_text(filter_text: str)#
Set the search filter string to the models and widgets
- filter_by_type(usd_types, enabled)#
Set filtering by USD type.
- Parameters:
usd_types – The type or the list of types it’s necessary to add or remove from filters.
enabled – True to add to filters, False to remove them from the filter list.
- filter_by_visibility(enabled)#
Filter Hidden On/Off
- get_model() StageModel #
Gets the stage model.
- Returns:
If the treeview is visible, returns the treeview stage model, otherwise returns None.
- Return type:
Optional[StageModel]
- open_stage(stage: Stage)#
Called when opening a new stage.
- Parameters:
stage (Usd.Stage) – The stage that is being opened.
- set_columns_widths()#
Sets the column width for treeview and flat treeview.
- set_fixed_width_columns()#
Sets the fixed width columns record for treeview and flat treeview.
- set_selection_watch(selection)#
Sets the selection watch of the current stage widget.
- Parameters:
selection (omni.kit.widget.stage.DefaultSelectionWatch) – The selection watch.
- static set_widget_visible(widget: Widget, visible)#
Utility for using in lambdas
- subscribe_columns_changed(
- fn: Callable[[List[Tuple[str, bool]]], None],
Subscribe to columns changed event with fn.
- Parameters:
fn (Callable[[List[Tuple[str, bool]]], None]) – The event handler for the subscription.
- Returns:
The event subscription object.
- Return type:
EventSubscription
Enable filters.
- Parameters:
filter_type_list (list) – List of usd types to be enabled. If not all usd types are pre-defined, hide filter
button. (button and Reset in the options)
- property auto_reload_prims: bool#
Whether prims are auto loaded.
- Returns:
bool
- property children_reorder_supported: bool#
Whether children re-ordering is supported.
- Returns:
bool
- property show_abstract_prims: bool#
Whether to show abstract prims.
- Returns:
bool
- property show_inactive_prims: bool#
Whether to show all inactive prims.
- Returns:
bool
- property show_prim_display_name: bool#
Whether to show display names for prims.
- Returns:
bool
- property show_undefined_prims: bool#
Whether to show undefined prims.
- Returns:
bool