Extension: omni.kit.scene_view.xr_utils-1.0.2 |
Documentation Generated: Jul 18, 2026 |
Migration#
The previous SceneWidgetManipulator class is deprecated and slated for
removal. Constructing one now emits a DeprecationWarning, and it is no
longer exported from omni.kit.scene_view.xr_utils’s __all__. New code
should use UiContainer +
WidgetComponent; existing code
should plan to migrate before the next major release of this extension.
Argument-by-argument translation#
Old |
New equivalent |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
There is no direct replacement for “construct, hand to a scene”. You now
construct a UiContainer with a scene_view_type argument, and the
container creates the SceneView itself; the SceneViewManager handles
sharing one view across multiple containers transparently.
A side-by-side example#
# Old
sw = SceneWidgetManipulator(
widget_type=MyPanel,
title="hello",
)
sw.size = Float2(40, 20)
sw.resolution_scale = 4.0
sw.unit_pixel_scale = 2.0
sw.update_policy = scene.Widget.UpdatePolicy.ON_MOUSE_HOVERED
sw.add_transform({
"transform": Matrix44.get_translation_matrix(0.0, 150.0, -80.0),
})
# New
from pxr import Gf
from omni.kit.scene_view.xr import XRSceneView
from omni.kit.scene_view.xr_utils import (
UiContainer, WidgetComponent, UpdatePolicy, SpatialSource,
)
panel_component = WidgetComponent(
widget_type=MyPanel,
widget_kwargs={"title": "hello"},
width=40.0,
height=20.0,
resolution_scale=4.0,
unit_to_pixel_scale=2.0,
update_policy=UpdatePolicy.ON_MOUSE_HOVERED,
)
panel = UiContainer(
scene_view_type=XRSceneView,
initial_component=panel_component,
space_stack=SpatialSource.new_translation_source(
Gf.Vec3f(0.0, 150.0, -80.0)
),
)
Common patterns#
Static world placement#
Use a single translation source — see Examples (01_basic_scene_ui.py).
Camera-facing HUD#
Compose translation with a look-at-camera source —
SpatialSource.new_look_at_camera_source
— see 02_camera_facing_ui.py.
Prim-anchored label#
Lead with
SpatialSource.new_prim_path_source,
then stack relative offsets — see 03_prim_anchored_ui.py.
Runtime rotation#
Where the old code reached into set_rotation_degrees, the new code can
drive the manipulator directly:
from carb import Float3
container.manipulator.rotation_degrees = Float3(0.0, 45.0, 0.0)
The container’s TransformableManipulator is the same object whether you
constructed it implicitly via UiContainer or referenced it via
container.manipulator.
Triggering a redraw#
redraw() becomes scene_widget.invalidate() on the relevant
WidgetComponent:
component.scene_widget.invalidate()