Replicating Godot's 3D Interface

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By stormreaver

I have an application that is best presented very similarly to Godot’s 3D view, with a 3D view embedded within an otherwise 2D interface. I have seen passing references to this during incidental Web browsing, but now I can’t locate any information on how to accomplish this.

In general, I want to replicate Godot’s main 3D layout.

Can anyone point me in the direction of any tutorials that explain how to accomplish this?

Replicating the entire 3D editor functionality in a project would require months of full-time work, if not years. It’s likely better to be more specific about what you want to reimplement. Could you describe the exact desired functionality here (in a comment)?

As for rendering a 3D viewport within a 2D project, see the 3D in 2D demo.

Calinou | 2021-07-26 12:38

Thanks for the reply. They are always appreciated. However, my question isn’t about replicating the 3D editor’s functionality. It’s just about replicating the layout, which I’ve just about finished since posting my question. Almost everything automatically resizes to fit their parents, with all the splitter functionality working as desired.

The only thing that remains is getting the viewport in the center to automatically fill its parent.

In the center is a panel, which automatically resizes to fill its parent. In that panel is a ViewportContainer which contains a Viewport. The viewport container doesn’t automatically resize, but rather shows the resize grab points. And the Viewport doesn’t automatically fill the ViewportContainer when I change the ViewportContainer’s size.

I have the horizontal and vertical SizeFlags set to both Fill and Expand, but they are having no effect. In the 3D editor, the 3D Viewport automatically fills the parent, which is the functionality I want to replicate. But if I set any size to the Viewport, that also becomes the size of the ViewportContainer.

I’m re-reviewing the 3D in 2D examples.

stormreaver | 2021-07-26 13:03

I now have the ViewportContainer filling its parent. I had to change its parent from a Panel to a VBoxContainer, ortherwise ViewportContainer wasn’t managed by the container system.

So now I have the problem of the Viewport node not filling the ViewportContainer. Isn’t the ViewportContainer supposed to automatically resize the Viewport node to match the ViewportContainer’s size?

stormreaver | 2021-07-26 18:11

:bust_in_silhouette: Reply From: stormreaver

I have it fully replicated now. Here’s the main layout I used:

enter image description here

This is the layout for ProjectView:

enter image description here

And that results in: