SceneViewManager#
- class omni.kit.scene_view.xr_utils.SceneViewManager(
- scene_view_type: type[_TSceneView],
- scene_view_args: dict = {},
- attach_mode: SceneViewAttachMode = SceneViewAttachMode.ATTACH_TO_MAIN_VIEWPORT,
Bases:
Generic[_TSceneView]A utility class to help create and manage UI scene views for your extension.
Methods
__init__(scene_view_type[, scene_view_args, ...])Create a new instance of the utility class.
delete_later(item)Queue this instance for deletion at a later time.
find_scene_view(element_path)Find a scene view by its element path.
Update only scene view transforms to ensure they are up-to-date and synced with (especially) XR transforms.
update_manual_scene_views(event)Update all scene views, including input events, etc.
Attributes
Get the SceneView instance associated with the class specified when this instance was created
- __init__(
- scene_view_type: type[_TSceneView],
- scene_view_args: dict = {},
- attach_mode: SceneViewAttachMode = SceneViewAttachMode.ATTACH_TO_MAIN_VIEWPORT,
Create a new instance of the utility class.
This is a lightweight container around a singleton dictionary of SceneView types, and will automatically create up to one SceneView of each SceneView-descended class.
Deleting or allowing this object to be deleted has no real affect on the overall system, so feel free to create and remove them as needed, or to hold on to one.
When the utility extension is unloaded, all associated scene views will be cleaned up and removed.
- Parameters:
scene_view_type (type[_TSceneView]) – Class / type of omni.ui.scene.SceneView or child to create using this utility. Each utility instance can only manage one type of SceneView, so if you need multiple for some reason (likely not), you would need multiple instances.
scene_view_args (dict) – Dictionary of arguments to pass to the SceneView constructor. (Default: {})
attach_mode (SceneViewAttachMode) – Whether to attach the scene view to the viewport or not. (Default: ATTACH_TO_MAIN_VIEWPORT)
- classmethod delete_later(item: Any)#
Queue this instance for deletion at a later time.
This is useful when you want to delete an instance, but you are currently in a state where it is unsafe to do so.
- classmethod find_scene_view(
- element_path: str,
Find a scene view by its element path.
- Parameters:
element_path (str) – The USD path (string) to the desired element.
- Returns:
The scene view if found, otherwise None.
- Return type:
_TSceneView | None
- classmethod update_manual_scene_view_transforms(
- event: IEvent,
Update only scene view transforms to ensure they are up-to-date and synced with (especially) XR transforms. This gets called during the XR sync loop.
- classmethod update_manual_scene_views(
- event: IEvent,
Update all scene views, including input events, etc. This shouldn’t be called during the XR sync loop, as that should only be updating transforms.
- property scene_view: _TSceneView#
Get the SceneView instance associated with the class specified when this instance was created
- Returns:
the scene view associated with the class specified at creation time
- Return type:
scene_view (_TSceneView)