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

GLTF files can prevent PNG/SVG files from being imported on Arm systems #76691

Open
aaronfranke opened this issue May 3, 2023 · 4 comments
Open

Comments

@aaronfranke
Copy link
Member

aaronfranke commented May 3, 2023

Godot version

Latest master 2a0aef5 but different behavior on master

System information

macOS 13.3 arm64 (also happens on Ubuntu Linux arm64)

We have narrowed down the bug in the comments, it seems to only happen on ARM, not x86.

Issue description

Some hard-to-isolate situations can cause other files like PNG files to be permanently unimported. In some cases this can be fixed by deleting the .import files, but in some cases Godot gets stuck and it refuses to even regenerate the .import files let alone perform the import.

One of these situations can be triggered by the GLTF files in the attached minimal reproduction project. Part of this issue is a regression since 4.0-stable, part of it also exists in 4.0-stable.

Steps to reproduce

  • Open the minimal reproduction project with the latest master.
  • Double-clicking on any of the PNG files gives an error that the resource can't be opened.
  Failed loading resource: res://torch/text/baseColor_1.png. Make sure resources have been imported by opening the project in the editor at least once.
  editor/editor_node.cpp:1263 - Condition "!res.is_valid()" is true. Returning: ERR_CANT_OPEN
  Failed loading resource: res://torch/text/emissive_1.png. Make sure resources have been imported by opening the project in the editor at least once.
  editor/editor_node.cpp:1263 - Condition "!res.is_valid()" is true. Returning: ERR_CANT_OPEN
  Failed loading resource: res://torch/minecraft_torch_minecraft_torch.png. Make sure resources have been imported by opening the project in the editor at least once.
  editor/editor_node.cpp:1263 - Condition "!res.is_valid()" is true. Returning: ERR_CANT_OPEN
  Failed loading resource: res://torch/minecraft_torch_minecraft_torch_emissive.png. Make sure resources have been imported by opening the project in the editor at least once.
  editor/editor_node.cpp:1263 - Condition "!res.is_valid()" is true. Returning: ERR_CANT_OPEN
  • Try deleting the .glb and .gltf files. Double-click on a PNG file. Same errors.
  • Try restarting Godot after deleting the .glb and .gltf files. Double-click on a PNG file. Same errors.
  • Try deleting the .png.import files. The PNG files will now import and load fine.
  • Note: If the .glb and .gltf files are deleted before you start Godot for the first time, the PNG files load fine.
  • It seems like a very serious bug in the import pipeline if something can cause a PNG file to never import.

Another problem that you can test in the same minimal reproduction project, this has regressions since 4.0-stable:

  • Open the minimal reproduction project with the latest master.
  • Double-click on the .glb file. The torch will be white. This is a regression, in Godot 4.0-stable the torch has the proper textures. In the console it prints these errors:
  Failed loading resource: res://torch/minecraft_torch_minecraft_torch_emissive.png. Make sure resources have been imported by opening the project in the editor at least once.
  modules/gltf/gltf_document.cpp:3282 - glTF: Image index '0' couldn't be loaded with the name: minecraft_torch_emissive. Skipping it.
  Failed loading resource: res://torch/minecraft_torch_minecraft_torch.png. Make sure resources have been imported by opening the project in the editor at least once.
  modules/gltf/gltf_document.cpp:3282 - glTF: Image index '1' couldn't be loaded with the name: minecraft_torch. Skipping it.
  • Double-click on the .gltf file. Similarly, the torch will be white, a regression, and errors in the console. But also note how Godot creates 2 new PNG files when double-clicking on the .gltf.
    • First of all it's a bug that Godot tries to extract textures that are already separate files.
    • Second of all these are valid files, you can open them with GIMP, Firefox, etc, but Godot refuses to import them.
  • Delete icon.svg.import in the root of the project. Now Godot will refuse to import icon.svg, and it does not generate the icon.svg.import file.
  • Delete all .png.import files. Now Godot will import those, and it will also import icon.svg, and double-clicking on the .glb or .gltf files will result in the models having textures.
  • Delete the .glb.import file. Try double-clicking it again and the texture will be white again.
  • Delete icon.svg.import in the root of the project. Now Godot will refuse to import icon.svg (again), and it does not generate the icon.svg.import file (again).
  • It seems like a very serious bug in the import pipeline if something can cause the .import files to not generate.

The first issue is also present in 4.0-stable, I have written some text about that collapsed:

  • Open the minimal reproduction project with Godot 4.0-stable.
  • Double-clicking on any of the PNG files gives an error that the resource can't be opened.
  Failed loading resource: res://torch/text/baseColor_1.png. Make sure resources have been imported by opening the project in the editor at least once.
  editor/editor_node.cpp:1209 - Condition "!res.is_valid()" is true. Returning: ERR_CANT_OPEN
  Failed loading resource: res://torch/text/emissive_1.png. Make sure resources have been imported by opening the project in the editor at least once.
  editor/editor_node.cpp:1209 - Condition "!res.is_valid()" is true. Returning: ERR_CANT_OPEN
  Failed loading resource: res://torch/minecraft_torch_minecraft_torch.png. Make sure resources have been imported by opening the project in the editor at least once.
  editor/editor_node.cpp:1209 - Condition "!res.is_valid()" is true. Returning: ERR_CANT_OPEN
  Failed loading resource: res://torch/minecraft_torch_minecraft_torch_emissive.png. Make sure resources have been imported by opening the project in the editor at least once.
  editor/editor_node.cpp:1209 - Condition "!res.is_valid()" is true. Returning: ERR_CANT_OPEN
  • Try deleting the .glb and .gltf files. Double-click on a PNG file. Same errors.
  • Try restarting Godot after deleting the .glb and .gltf files. Double-click on a PNG file. Same errors.
  • Try deleting the .png.import files. The PNG files will now import and load fine.

Minimal reproduction project

wherearemyimports.zip

@lyuma
Copy link
Contributor

lyuma commented May 8, 2023

Unable to reproduce on 4.0.2 stable on windows. Is this possible macOS specific?

@aaronfranke
Copy link
Member Author

aaronfranke commented May 9, 2023

@lyuma Thanks for testing. I re-tested with 6980b2b on several different platforms that I have access to. I can still reproduce the issue on macOS arm64 and I can also reproduce the issue on my Linux arm64 VM on my Mac but it works fine on Windows x86_64 and Linux x86_64. EDIT: My brother tested on his x86_64 Mac mini and he doesn't experience it. So this seems like it might be an ARM-specific issue, or possibly an issue specific to the Mac hardware (I have an M1 Pro). Either way this is strange, and it would be helpful to get more testing.

@nathanfranke
Copy link
Contributor

nathanfranke commented May 9, 2023

^ can load the pngs on macOS Monterey 12.6.1 (x86_64 Mac mini late 2014)

Godot Engine v4.0.2.stable.official.7a0977ce2 - https://godotengine.org
OpenGL API 4.1 INTEL-18.8.5 - Compatibility - Using Device: Intel Inc. - Intel HD Graphics 5000 OpenGL Engine
 
WARNING: Blend file import is enabled in the project settings, but no Blender path is configured in the editor settings. Blend files will not be imported.
     at: _editor_init (modules/gltf/register_types.cpp:70)
res://torch/text/baseColor_1.png: Texture detected as used in 3D. Enabling mipmap generation and setting the texture compression mode to VRAM Compressed (S3TC/ETC/BPTC).
res://torch/text/emissive_1.png: Texture detected as used in 3D. Enabling mipmap generation and setting the texture compression mode to VRAM Compressed (S3TC/ETC/BPTC).
res://torch/minecraft_torch_minecraft_torch.png: Texture detected as used in 3D. Enabling mipmap generation and setting the texture compression mode to VRAM Compressed (S3TC/ETC/BPTC).
res://torch/minecraft_torch_minecraft_torch_emissive.png: Texture detected as used in 3D. Enabling mipmap generation and setting the texture compression mode to VRAM Compressed (S3TC/ETC/BPTC).

@aaronfranke aaronfranke changed the title GLTF files can prevent PNG/SVG files from being imported GLTF files can prevent PNG/SVG files from being imported on Arm systems May 13, 2023
@fire
Copy link
Member

fire commented Nov 4, 2024

@aaronfranke, since there's been some operating system updates to macos, can you do a check again?

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

No branches or pull requests

5 participants