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 an option to capture scene thumbnails with fixed view #102263

Closed

Conversation

daniel080400
Copy link

@daniel080400 daniel080400 commented Jan 31, 2025

Add a setting docks/filesystem/scene_thumbnail_capture_method to toggle between FREE / FIXED thumbnail captures, FREE is the default behavior, which captures scene thumbnail by the current camera view. This PR adds a FIXED option to always capture scene thumbnails with a 3/4 fixed view (in 3d), also ensures all visual elements are within the capture.

scene_thumbnail_fixed

scene_thumbnail_fixed.mp4

TODO:

  • Set fixed camera zoom / fov when capturing
  • Hide gizmo when capturing thumbnails
  • Exclude node types that are generally not concerned in thumbnails from AABB calculation (light, particles, probes, skeletons, colliders)
  • Implement FIXED thumbnail capturing for 2d scenes
  • Check if performance is okay for large scenes with large number of nodes

@Calinou
Copy link
Member

Calinou commented Jan 31, 2025

This looks like a great start 🙂

However, I think this feature should always be enabled, with a way to manually override camera settings for specific scenes. This way, all team members will always see the same thumbnails when working on a project. Therefore, I don't think editor settings should be added here.

One way to implement this would be an Override Scene Thumbnail action in the Perspective menu, which would set some editor-only metadata on the scene's root node with the camera mode (perspective/orthogonal), position, rotation and FOV. (Editor-only metadata is metadata whose name starts with a _.)

There would also be a Reset Scene Thumbnail action below it, which would remove this metadata. (This action would be grayed out if the scene thumbnail hasn't been overridden yet.)

  • Hide gizmo when capturing thumbnails

This should be feasible by hiding all gizmos, waiting 2 frames, taking the screenshot and restoring the previous gizmo state.

@fire fire requested a review from a team January 31, 2025 23:57
@fire
Copy link
Member

fire commented Jan 31, 2025

I also think this feature should always be enabled.

Copy link
Member

@fire fire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you run precommit?

python install pre-commit
# in godot engine directory
pre-commit run -a

Alternatively you can try copying the diff patch from the repository and git apply diff.patch manually.

@fire
Copy link
Member

fire commented Feb 1, 2025

Then try godot.exe --doctool after compiling.

@daniel080400 daniel080400 deleted the scn-thumbnail-centered branch February 1, 2025 08:35
@daniel080400 daniel080400 restored the scn-thumbnail-centered branch February 1, 2025 08:36
@daniel080400 daniel080400 reopened this Feb 1, 2025
@daniel080400
Copy link
Author

Continue with a better approach at #102313

@YeldhamDev YeldhamDev removed this from the 4.x milestone Feb 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants