Display text on the render viewport

How could I display text on the render viewport and update it via python api?
(Similar to how the menu and viewport settings are displayed).

Thank you

Hi ,

Although the Viewport is still based on our Previous UI platform that is not as extensible as Omni.UI

We have a feature that enable you to “Layer” omni.ui widgets directly in the viewport

for that you simply create a new window call “Viewport”

window = ui.Window("Viewport)

and that Window Content ( build using Omni.UI ) will be rendered Layer on top of the viewport UI

it is quite easy to do but in case you are encontering some issue just ping here and we can help further or send some sample

What are you trying to display ?

Thanks
damien

Hi Damien,

Thank you for your answer!
I managed to show the text as overlay:

import omni.ui as ui
window = ui.Window("Viewport")
with window.frame:
    with ui.VStack():
        f = ui.Label("text to display")
        f.visible = True
        f.set_style({"background_color": 0x00000000, "font_size": 24}) # transparent background

But if I make the render viewport fullscreen with F11, the label is not visible anymore… How could I suppress that?

Best
Romana

We have run into an issue when trying to place buttons in the viewport that the widgets in stacked viewport windows do not receive clicks unless the items are wrapped in a ScrollingFrame. I assume this has something to do with ScrollingFrames subscribing to mouse input. CollapsableFrames do not work however the color does still change when hovering over the collapse bar and when hovering over buttons.

Sorry that is a know issue with the current setup and there is a workaround, I should have mentioned that here
you need to place your widget that you need to interact with into a “dragable” placer
you placer need to be of fixed size and position so it wont have to move but it will enable the input system to reachout

                with ui.Placer(draggable=True):
                    ui.Button("this Work")

if that doesn’t just fix it share a little more of the code around your widget and we will get you a solution

from @rust

But if I make the render viewport fullscreen with F11, the label is not visible anymore… How could I suppress that?

I have the same problem.
Full screen viewport does not show omni.ui.Label etc.
(Omniverse Create 2021.3.8/Kit 102.1.2)

"ui.Placer(draggable=True) " didn’t seem to solve this problem during fullscreen.
If I use omni.ui.Label with an overlay in the viewport, is there any way to deal with this in fullscreen as well?

Hi,
Is it possible to render this overlay text display in movie capture? Or is there other way to do it? I want to superimpose some texts on the rendered scene.

Hi @qazs! Not currently, but there is a lot of interest in that feature, especially in the realm of XR. I think it’ll be something to look forward to in the future.

Ok thanks!

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