-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
Keep looking when a preview plugin returns an empty image. #96260
Conversation
4ec3c3b
to
975039e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The behavior matches the documentation now indeed. 👍
Returning an empty texture is an OK way to fail and let another generator take care. |
Not fully sure whether we indeed want to prevent zero-size previews though. cc @KoBeWi
Well, zero-size textures are a convenient way to make empty previews, though not sure if there is use-case for that. |
I could see it going either way. Im not too picky as along as I can write a previewer for PackedScene when the builtin one returns null. |
I believe "empty texture" in the docs was referring to IMO it's clearer if the way to bail out is to return |
975039e
to
4ec3c3b
Compare
Seems like consensus is to allow zero size previews, so I reverted it to the original null-check only version. |
Indeed.
Which makes my first comment hold. The docs could be clarified by changing "Returning an empty texture (...)" to "Returning [code]null[/code] (...)".
|
Almost good, please squash your commits (should be a single commit). See the PR workflow docs. |
Can do. For some reason I thought he rebase on merge option in github was turned on here. |
EditorResourcePreviewGenerator::_generate says that "Returning an empty texture is an OK way to fail and let another generator take care." This patch enables that behavior.
84055a7
to
28e7069
Compare
Thanks! |
The documentation for EditorResourcePreviewGenerator::_generate says that "Returning an empty texture is an OK way to fail and let another generator take care."
This patch enables that behavior.