Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a way to take a screenshot of the 3D viewport from the editor #11793

Open
BrokAnkle opened this issue Feb 17, 2025 · 1 comment
Open

Add a way to take a screenshot of the 3D viewport from the editor #11793

BrokAnkle opened this issue Feb 17, 2025 · 1 comment

Comments

@BrokAnkle
Copy link

Describe the project you are working on

VR Simulation for education

Describe the problem or limitation you are having in your project

I wanted to share change I made in the environment, for that I wanted to take a screenshot from the editor directly instead of using Windows screenshot utility (or other third party app) like Unreal Engine so it hides UI overlays and take in the right resolution.
There is a screnshot option inside the Editor toolbar, but it just take a full screenshot, of the whole Godot window while I just wanted the viewport.
There is tutorials and documentation but all are for ingame screenshots or it take the 2D viewport as a the screen to record.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Printscreen or other third party tool doesn't always work correctly, the screenshot shows the ui overlays or other windows that may overlap. A simple button/shortcut can enhanced workflow.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Image
From this option menu, add a suboptionmenu that propose "full editor", "3D viewport", "2D viewport" to take screenshot.

If this enhancement will not be used often, can it be worked around with a few lines of script?

Image

Is there a reason why this should be core and not an add-on in the asset library?

I think taking screenshot is important for game maker to share and promote their projects. Having one embeded in the engine can make their life easier.

@Calinou
Copy link
Member

Calinou commented Feb 17, 2025

I agree we should have ways to quickly take a screenshot of what you're currently seeing in the 2D/3D editor viewport. There are some additional concerns for the feature to really be usable in varied scenarios though:

  • Sometimes, you want gizmos to be displayed, but sometimes you want to hide them just during the screenshot. This can be done by hiding gizmos, waiting for 2 frames to render, taking the screenshot then restoring gizmos.
  • Sometimes, you want the screenshot to be at a different resolution or aspect ratio than the current viewport resolution. You may want a high-resolution screenshot with supersampling to use for promotional purposes, but you may not be using those settings while editing for performance reasons.
  • For 2D scenes, you may want to have a way to take a screenshot of the whole scene (for whole-map screenshots) even if it's outside the camera view. This is probably outside the scope of this proposal though, so I won't cover it here.

Regarding how this should be implemented, it should probably be a MenuButton in the top bar of the 2D editor, and a submenu in the Perspective menu for each 3D viewport in the 3D editor. Each would have several options to choose from:

  • Take Viewport Screenshot
  • Take Viewport Screenshot (No Gizmos)
  • Take Viewport Screenshot (Custom Resolution)
    • Shows a dialog that lets you customize whether to show gizmos, the output resolution and supersampling factor (for high-quality antialiasing). The specified parameters are persisted in editor state so that it's kept across sessions.
      • The aspect ratio is indirectly controlled by the specified resolution.
      • Supersampling works by increasing the resolution the image is created at, then the editor will downsize it before saving it. It can be a factor between 1.0x and 4.0x.

PS: When posting code, please post it as code between triple backticks (```) so that others can copy and paste it.

@Calinou Calinou changed the title Take 3D viewport screenshot from the editor Add a way to take a screenshot of the 3D viewport from the editor Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants