Using omni.ui.scene extension with a very simple example

Hello,

I am testing the omni.ui.scene extension using the following script, an adaptation from the documentation:

from omni.kit.viewport.utility import get_active_viewport_and_window
import omni.ui.scene as sc

viewport, window = get_active_viewport_and_window()
scene_view = sc.SceneView()

with window.get_frame("test123"):
  with scene_view.scene:
    sc.Line([-0.5,-0.5,0], [-0.5, 0.5, 0])
    sc.Line([-0.5,-0.5,0], [0.5, -0.5, 0])
    sc.Arc(0.5)
  viewport.add_scene_view(scene_view)

I was hoping to see something on the viewport, but I was unable to see anything. I am aware that there is a GH repository with some examples (GitHub - NVIDIA-Omniverse/kit-extension-sample-ui-scene: Sample Repository to create Kit Extension using the ui.scene API), but the examples on that repository is a bit too complex and fail to run for various reasons.

Is there a simple example which I could see omni.ui.scene extension in action?

Thanks!

This is a perfect time to follow the amazing Learn With Me series that we did that covers “your first extension”.
Resources from the “Learn With Me” Streaming Series - Getting Started / Tutorials & Guides - NVIDIA Developer Forums

@Richard3D, thanks for the quick reply. Could you please show me which one of those tutorials in the Learn With Me series is covering the usage of omni.ui.scene.SceneView?

I do not have a specific example. I am sorry. I just meant that Ashley does a lot with understanding how to set up extensions, and how to get started with it in general.

Let me see if I can get some more specific help.

Thanks @Richard3D, I appreciate the help.

I believe the name of the extensions, omni.ui and omni.ui.scene, makes it a bit confusing. I was trying to add UI elements to an existing Viewport using SceneView and hoping to mix omni.ui and omni.ui.scene widgets together in a SceneView object. As far as I understand from the documentation, this could be possible, but I might be wrong as well.