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

Editor: Fix AtlasTexture editor previews for compressed textures #102559

Merged
merged 1 commit into from
Feb 13, 2025

Conversation

stuartcarnie
Copy link
Contributor

@stuartcarnie stuartcarnie commented Feb 7, 2025

This PR resolves errors in the Godot Editor when working with an AtlasTexture resource that uses a compressed image format. The specific error is:

Cannot blit_rect in compressed or custom image formats.

When the texture is compressed, the preview in the File Manager and the Inspector are black:

before after
CleanShot 2025-02-08 at 08 15 46@2x CleanShot 2025-02-08 at 08 13 22@2x

MRP

mpr.zip

@akien-mga akien-mga changed the title editor: Fix AtlasTexture editor previews for compressed textures Editor: Fix AtlasTexture editor previews for compressed textures Feb 7, 2025
Copy link
Contributor

@arkology arkology left a comment

Choose a reason for hiding this comment

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

Will not work for nested AtlasTexture. while loop will be required.

@AThousandShips AThousandShips added this to the 4.4 milestone Feb 8, 2025
@KoBeWi
Copy link
Member

KoBeWi commented Feb 8, 2025

tbh we need a helper method to get final atlas of AtlasTexture. There are more places where we don't support nested AtlasTextures.
Then again, you shouldn't nest them, because there is just no reason to do so.

@KoBeWi
Copy link
Member

KoBeWi commented Feb 13, 2025

I don't see any preview.
image

Copy link
Member

@KoBeWi KoBeWi left a comment

Choose a reason for hiding this comment

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

I can't reproduce black preview (or any preview at all), but it fixes the error.

@stuartcarnie
Copy link
Contributor Author

@KoBeWi I've added an MRP for you. If you select the Sprint2D, it's preview will be black:

Also note that the tex_1.tres resource preview is black:

@akien-mga akien-mga merged commit 794b939 into godotengine:master Feb 13, 2025
20 checks passed
@akien-mga
Copy link
Member

Thanks!

@stuartcarnie stuartcarnie deleted the sgc/fix_previews branch February 14, 2025 00:56
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.

6 participants