Repository navigation
Fixes XR instruction widget: scene_view.xr_utils, Fabric CopyFabricPrim support - #4795
Conversation
Greptile SummaryThis PR fixes the XR instruction widget by migrating from the deprecated
Confidence Score: 3/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["show_instruction()"] --> B{prim_path_source\nprovided?}
B -- No --> G[space_stack = empty]
B -- Yes --> C{Fabric enabled?\n/app/useFabricSceneDelegate}
C -- Yes --> D["DeleteFabricPrims\nat target_prim_path\n(if exists in rt_stage)"]
D --> E["CopyFabricPrim\nprim_path_source → target_prim_path"]
E -- success=True --> F[copy_succeeded = True]
E -- exception/failure --> H["Fallback: delete USD prim\nat target_prim_path (if valid)"]
C -- No --> H
H --> I["CopyPrim\nprim_path_source → target_prim_path"]
I -- success --> F
I -- failure --> G
F --> J["Deselect target_prim_path\n(Fabric + USD source types)"]
J --> G
G --> K["Build space_stack\n+ translation + look-at-camera"]
K --> L["UiContainer(XRSceneView, widget_component,\nspace_stack=space_stack)"]
L --> M["Schedule auto-hide timer\n(if display_duration set)"]
M --> N[Return UiContainer]
Last reviewed commit: a717d37 |
| @@ -125,7 +128,7 @@ def compute_widget_dimensions( | |||
| def show_instruction( | |||
| text: str, | |||
| prim_path_source: str | None = None, | |||
| translation: Gf.Vec3d = Gf.Vec3d(0, 0, 0), | |||
| translation: Vec3Type = (0, 0, 0), | |||
There was a problem hiding this comment.
translation default type doesn't match Vec3Type annotation
Vec3Type is defined as Gf.Vec3f | Gf.Vec3d, but the default value (0, 0, 0) is a plain Python tuple, which is outside that union. Since from __future__ import annotations makes all annotations lazy strings, this causes no runtime error — but static type checkers (mypy/pyright) will flag it, and the docstring below still describes the parameter as Gf.Vec3d.
Either:
- Broaden
Vec3Typeto includetuple[float, float, float]/Sequence[float], or - Keep the default as a
Gf.Vec3d:translation: Vec3Type = Gf.Vec3d(0, 0, 0)(moving the import out ofTYPE_CHECKINGfor the default expression), or - Update the docstring to reflect the new accepted types.
…im support, and selection clear to avoid null prim on reset
2adbbab to
0234e92
Compare
Description
Fixes XR instruction widget for Fabric and current scene view APIs
omni.kit.xr.scene_view.utils
preserved in XR; add omni.fabric.commands kit dependency
invalid null prim" on env reset
Fixes # (issue)
Type of change
Screenshots
Please attach before and after screenshots of the change if applicable.
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there