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

Generate thumbnails on imported scenes. #96544

Merged
merged 1 commit into from
Nov 27, 2024

Conversation

SaracenOne
Copy link
Member

@SaracenOne SaracenOne commented Sep 4, 2024

godot windows editor dev x86_64_OmkGxF9AY3

Ends a somewhat long-standing discontinuity of the imported scenes (FBX, GLTF, Collada, ect.) not having any thumbnail previews like regular Godot scenes. It does this by providing a hook step where they can be generated and cached upon reimport.

Keeping this in draft for now since it could probably benefit from further refactoring, improving bounds calculations for skinned meshes, and adding displayable gizmos for the cases where no mesh instances could be found (animation or collision-only imports, for example).

@JekSun97
Copy link
Contributor

JekSun97 commented Sep 4, 2024

In editor_inteface.cpp error in the comment on line 300

@fire
Copy link
Member

fire commented Nov 21, 2024

@SaracenOne Do you think this can be done for the 4.4 cycle?

Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

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

Tested locally (rebased on top of master f952bfe), it works as expected.

1 2 3 4
image image image image

Note that you must reimport the scene for the preview to be generated (existing projects won't have one automatically created). Also, it can take a few seconds for the icon to appear in the FileSystem dock after reimporting.

For some assets, it results in a gray preview, presumably due to skinning resulting in a different AABB than needed. This happens with player.glb from the 3D Platformer demo:

image

Also, cube.glb from the Global Illumination demo is too zoomed in:

image

zdm2.glb from the same demo is fine though:

image

@fire
Copy link
Member

fire commented Nov 22, 2024

Going to do a rebase and push it.

@fire fire force-pushed the import_thumbnails branch 2 times, most recently from 26297cc to 00e6791 Compare November 22, 2024 19:53
@fire

This comment was marked as outdated.

@fire fire force-pushed the import_thumbnails branch 4 times, most recently from 5efd7b6 to fce7fa3 Compare November 23, 2024 07:39
@fire
Copy link
Member

fire commented Nov 24, 2024

We discussed how the thumbnail in imported scenes needs features added.

  1. AABB estimation related to skinned meshes has also proven a pain point for the advanced importer.
  2. Provide an API allowing more thumbnail generation customization for regular Godot scenes.

What do you think about greenlighting the pull request as is and revisiting thumbnails in imported scenes feature enhancements later to see if it can be improved?

@fire fire marked this pull request as ready for review November 24, 2024 18:03
@fire fire requested review from a team as code owners November 24, 2024 18:03
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.

Please take a look at the previous comment for the summary.

@Calinou mentioned that we should not wait for the entire feature list to be implemented since it's already an improvement over what we have now.

editor/editor_interface.cpp Outdated Show resolved Hide resolved
editor/editor_interface.cpp Outdated Show resolved Hide resolved
editor/editor_interface.h Outdated Show resolved Hide resolved
editor/editor_interface.cpp Outdated Show resolved Hide resolved
editor/import/3d/resource_importer_scene.cpp Outdated Show resolved Hide resolved
@fire fire force-pushed the import_thumbnails branch from cf698a4 to 74611a7 Compare November 24, 2024 18:24
Copy link
Contributor

@Repiteo Repiteo left a comment

Choose a reason for hiding this comment

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

Accepting with the expectation that this will be followed up on soon™ with the aforementioned features

@Repiteo Repiteo merged commit 1c78b09 into godotengine:master Nov 27, 2024
21 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Nov 27, 2024

Thanks!

@fire fire deleted the import_thumbnails branch November 28, 2024 19:43
demolke added a commit to demolke/godot that referenced this pull request Nov 29, 2024
EditorNode is a very heavy object that current test harness cannot create, so after godotengine#96544 editor import cannot be tested.

Split off from godotengine#98909
demolke added a commit to demolke/godot that referenced this pull request Nov 29, 2024
EditorNode is a very heavy object that current test harness cannot create, so after godotengine#96544 editor import cannot be tested.

Split off from godotengine#98909
demolke added a commit to demolke/godot that referenced this pull request Dec 1, 2024
EditorNode is a very heavy object that current test harness cannot create, so after godotengine#96544 editor import cannot be tested.

Split off from godotengine#98909
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.

Display scene resource thumbnails in the FileSystem dock
6 participants