lightspeed.trex.source_layer_picker.window#
SPDX-FileCopyrightText: Copyright (c) 2026 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 lightspeed.trex.source_layer_picker.window.SearchableLayerModel(**kwargs)#
LayerModel with a case-insensitive substring filter on layer basenames.
Only the TreeView render path (
get_item_childrenwithoutrecursive=True) is filtered. Internal layer-tree refresh calls userecursive=Trueto restore expansion/selection state and must see the full set; we pass those through unchanged so the host widget’s bookkeeping stays consistent with what USD actually contains.- get_item_children(
- parent=None,
- recursive: bool = False,
- item=None,
Get the model’s items or item’s children.
- Parameters:
parent – if this is not None, it will return the parent’s children
recursive – whether the items should be listed recursively or only top-level
item – optional
TreeModelBase-compatible alias for parent. Overrides parent when provided.
- Returns:
The items in the model or children in the parent
- class lightspeed.trex.source_layer_picker.window.SourceLayerPicker(
- context_name: str,
- mod_layer_ids: frozenset[str],
- selected_ids: set[str] | None,
Standalone window for choosing which mod sublayers drive the Edit-State filter.
Reuses the same scrollable tree primitive as the layer-tree widget and overlays per-row checkboxes via
SourceLayerPickerDelegate. Layer-management actions are blocked through model excludes plus a disabled context menu, so the picker is structurally read-only.
- class lightspeed.trex.source_layer_picker.window.SourceLayerPickerDelegate(
- selected_ids: set[str] | None,
- mod_layer_ids: frozenset[str],
LayerDelegate that swaps the per-row layer-management icons for a single checkbox.
Rows for layers in the replacement subtree (mod.usda + recursive sublayers) get an enabled checkbox driving the picker’s draft selection. Other layers stay visible for context but render no checkbox; the filter only cares about mod layers once the draft is applied.
- refresh_gradient_color(
- item,
- model,
- deferred: bool = True,
Refresh the item gradient based on selection, hover state, etc.
- Parameters:
item – the item to refresh
model – the model
deferred – whether the refresh should be deferred to a future frame
SPDX-FileCopyrightText: Copyright (c) 2026 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 lightspeed.trex.source_layer_picker.window.source_layer_picker.SourceLayerPicker(
- context_name: str,
- mod_layer_ids: frozenset[str],
- selected_ids: set[str] | None,
Standalone window for choosing which mod sublayers drive the Edit-State filter.
Reuses the same scrollable tree primitive as the layer-tree widget and overlays per-row checkboxes via
SourceLayerPickerDelegate. Layer-management actions are blocked through model excludes plus a disabled context menu, so the picker is structurally read-only.
SPDX-FileCopyrightText: Copyright (c) 2026 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 lightspeed.trex.source_layer_picker.window.model.SearchableLayerModel(**kwargs)#
LayerModel with a case-insensitive substring filter on layer basenames.
Only the TreeView render path (
get_item_childrenwithoutrecursive=True) is filtered. Internal layer-tree refresh calls userecursive=Trueto restore expansion/selection state and must see the full set; we pass those through unchanged so the host widget’s bookkeeping stays consistent with what USD actually contains.- get_item_children(
- parent=None,
- recursive: bool = False,
- item=None,
Get the model’s items or item’s children.
- Parameters:
parent – if this is not None, it will return the parent’s children
recursive – whether the items should be listed recursively or only top-level
item – optional
TreeModelBase-compatible alias for parent. Overrides parent when provided.
- Returns:
The items in the model or children in the parent
SPDX-FileCopyrightText: Copyright (c) 2026 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 lightspeed.trex.source_layer_picker.window.delegate.SourceLayerPickerDelegate(
- selected_ids: set[str] | None,
- mod_layer_ids: frozenset[str],
LayerDelegate that swaps the per-row layer-management icons for a single checkbox.
Rows for layers in the replacement subtree (mod.usda + recursive sublayers) get an enabled checkbox driving the picker’s draft selection. Other layers stay visible for context but render no checkbox; the filter only cares about mod layers once the draft is applied.
- refresh_gradient_color(
- item,
- model,
- deferred: bool = True,
Refresh the item gradient based on selection, hover state, etc.
- Parameters:
item – the item to refresh
model – the model
deferred – whether the refresh should be deferred to a future frame