Way to intercept all “display to viewport” commands?

Does anyone know of a quick way to intercept all commands that send ui/widget/hud stuff to “viewport” ? I’m converting a non VR project and it’s quite tedious to go and make a 3D widget for each thing that goes to the viewport. Then I have to terminate all send to viewport commands.

It would be great if anything that was set to “send to viewport” could all just go to a 3D widget I’ve set on the pawn. More or less i think this would be a method to redefine “viewport” as a specific widget component.

Sadly the only method I know of is to make a function library function that determines whether or not you’re in VR and adds the widget to the right place, but if you already have a whole bunch of “Add To Viewport” nodes out there this will require a lot of manual work. But at least with this method you won’t have to implement it over and over :slight_smile:


iTween : Free, smooth, procedural object animation
easyCSV : Read data from any CSV and put them in an easy-to-access string map!
Runtime DataTable : Import and export game data to and from CSV or Google Sheets while your game is running!

I imagine making this function would not be straightforward. But not to bad? If I understand correctly, it would just be something you would use to intercept every “add to viewpoint node.”

This is in contrast to redefining “viewport” as I suggested. Correct?

If I was to make a function…
Is there a way to output all viewport rasterization so that way it could be set to a 3D widget? I’m a noob, I can’t figure out if it’s possible to pull stuff off the viewport. I guess if it was, I’d start there.

So this function would take in a UWidget and a bool as parameters. The Widget being the menu or UI element you want to display and the bool being whether or not you’re in VR.

Inside the function, if bIsVR is false, just add widget to viewport like normal. If bIsVR is true, add a widget component to your player’s camera at a readable distance and set the widget to be the incoming parameter.

Thanks for the tip! I understand how to make 3d widgets Viewable by adding to the pawn. I guess I’m at a loss of how to set something that would generally go to the viewport into the pawn widget. How do you make a general widget that would end up on the viewport become accessible to the player pawn blueprint to set it accordingly?