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

Enabling ETC2/ASTC does not import textures in new format #94882

Closed
Malcolmnixon opened this issue Jul 28, 2024 · 2 comments · Fixed by #94975
Closed

Enabling ETC2/ASTC does not import textures in new format #94882

Malcolmnixon opened this issue Jul 28, 2024 · 2 comments · Fixed by #94975

Comments

@Malcolmnixon
Copy link
Contributor

Tested versions

4.3-rc1 is broken, but 4.3-beta3 works

System information

Windows 11, gl_compatibility, NVidia RTX 3070 TI

Issue description

If a new project is created and an Android export is constructed; the Android Export will pop up a warning:

image

On 4.3-beta3 clicking on the "Fix Imports" button pops up a small progress bar and the *.etc2.ctex files are greated in the .godot/imported folder.

On 4.3-rc1 clicking on the "Fix Imports" button does not trigger a reimport of the assets. Even quitting and reloading the projects doesn't reimport the assets in the new format. The only fix seems to be to delete the .godot folder and let everything be reimported.

An identical problem happens when enabling the ETC2/ASTC compression in the project menu. On both 4.3-beta3 and 4.3-rc1 it requests a Save-and-Restart; but only 4.3-beta3 actually imports the new formats on restart. 4.3-rc1 does no new imports and the .etc2.ctex textures do not exist.

Steps to reproduce

  1. Create new project - this will have only the S3TC/BPTC textures enabled.
  2. Add some textures.
  3. Observe *.s3tc.ctex textures in the .godot/imports folder
  4. Enable ETC2/ASTC texture format
  5. Allow the Save-and-Restart to occur
  6. Observe only *.s3tc.ctex files
  7. Quit to project list
  8. Delete .godot folder
  9. Reload project
  10. Observe the full reconstruction of the imports creates both the *.s3tc.ctex and *.etc2.ctex textures

Minimal reproduction project (MRP)

N/A

@Malcolmnixon Malcolmnixon changed the title Adding ETC2/ASTC does not import textures in new format Enabling ETC2/ASTC does not import textures in new format Jul 28, 2024
@akien-mga akien-mga added this to the 4.3 milestone Jul 28, 2024
@akien-mga akien-mga moved this from Unassessed to Release Blocker in 4.x Release Blockers Jul 28, 2024
@Malcolmnixon
Copy link
Contributor Author

This looks to have been caused by #94357 - specifically the old code contained:

	if (!ResourceFormatImporter::get_singleton()->are_import_settings_valid(p_path)) {
		//reimport settings are not valid, reimport
		return true;
	}

This called the ResourceImporterTexture::are_import_settings_valid which makes sure all compression formats enabled by the project have been imported.

@KoBeWi
Copy link
Member

KoBeWi commented Jul 29, 2024

When a file is invalid/corrupted, the .import file also becomes "invalid". It gets valid=false assigned and some fields are missing. Thus there is no way to fix #62271 without ignoring the state of the import file.

This regression was caused because changing target import formats makes all .import files "invalid" and the editor relied on this to make them reimported. The only way I can think of to fix both issues is to separate the format reimports from import validity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Release Blocker
Development

Successfully merging a pull request may close this issue.

3 participants