Scene View Disappears on First Load

I have an extension that creates some 2D UI views at startup. These 2D UI views are created using WidgetComponent and UiContainer from omni.kit.xr.scene_view.utils. For some reason, the first time I load the view, the view briefly shows up as a faint gray window and then disappears:

However, if I disable and re-enable the extension, the view shows up just fine:

The issue seems to only be present the first time the view is enabled. Subsequent disabling/enabling appear to work fine. I have tried introducing delays in between creations of 2D views and/or after, and sometimes it seems to work but sometimes it doesn’t. Sometimes, when it works, the faint gray window shows up and then transitions to the actual 2D view. Am I missing something I’m supposed to do at initialization of these scene views?

I am sorry if I misunderstand, but why are you creating new 2D views when we already have them available ? We supply you already with right, front and top. Can you just not use those? The shortcut key in the command is already available

Hello Richard3D!

I am not referring to views as in camera angles. I am referring to 2D UI widgets within the 3D scene. I have created several 2D widgets to show information in the scene. If you look at the second video, you’ll see an example widget. I wish to put several of these in the scene, but I encounter the issue shown on the first video.

Hope that clarifies things.

Ok understood. I think it is best if you send me your usd file and project so we can take a look directly. It is too hard to diagnose like this.

Took a bit, but I actually got a more understanding of the issue. The 2D widgets are not disappearing. They are simply being positioned at the origin of the scene. This, however, only happens if you activate them when the camera is looking away from them. You can reproduce this issue by doing the following:

  1. Open Omniverse App (has to be a fresh start)
  2. Rotate camera to look away from the origin
  3. Run the attached script

2DWidgetsDisappearingBug.zip (1.4 KB)

  1. Rotate camera to look towards the origin

You will see all the 2D widgets overlapped at the origin.

However, if you repeat the steps 1 & 3, while looking at the origin. You will see they get positioned correctly:

Here is what is even more interesting!

If you uncomment the await lines in the setup function and repeat the initial experiment, you will see that only the last 2D Widget gets wrongly positioned in the origin.

This leads me to believe the issue/bug is the following: The last set of 2D widgets to be created, if not within the user’s viewport, will get wrongly positioned at the origin.

Oh ok. Great find!! I am glad you figured it out.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.