godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
88.95k stars 20.17k forks source link

File import bug - tiny files cause problems #58131

Open ryanscottcausecast opened 2 years ago

ryanscottcausecast commented 2 years ago

Godot version

4.0.2/1 dev

System information

mac book pro 2017

Issue description

When duplicating or creating new files on my system, godot always shows them with an X next to them and I cannot use them.

Even just duplicating a file that already exists and godot likes, does not work.

Duplicating it within godot, it does work.

Second, deleting a file using the selector freezes godot.

Steps to reproduce

Please see recording. https://youtu.be/RiwGOjuYgz4

Minimal reproduction project

included below

ryanscottcausecast commented 2 years ago

the files in question work fine from godot 3.x

ryanscottcausecast commented 2 years ago

The files worked fine added to a new project. There's something wrong with the project. Here it is included.

my project cannot be included its 52 mb.

you can get it here: https://drive.google.com/file/d/1_dHHE0pNn1Eobxqc8ILeNER-QIfH5J6z/view?usp=sharing

ryanscottcausecast commented 2 years ago

Here's another project and video. I was able to isolate it to some old bmp files that were converted to png. The bmp had an X, so did the png. once godot sees those files, it starts being unable to load any new files.

https://youtu.be/fHjzdeSuEz8

new project to test with: https://drive.google.com/file/d/1tLpW8EjPWoQJak68OMZzhFvNNdf1FKfs/view?usp=sharing

remove that one file and it magically fixes the problem

no idea why the file is a problem

ryanscottcausecast commented 2 years ago

littleflames.bmp is another one of those files that causes this problem. Like chain.bmp, its a very tiny file. its included in the zip above

KoBeWi commented 2 years ago

I can reproduce the issue in the attached project, but I have no idea what is happening. Godot won't load any of the images. It will even spit errors when I add some new image to the project; it just won't import it. Some files will open when reimported manually, some will not even appear importable. Getting lots of this error:

editor/editor_file_system.cpp:2132 - Condition "!importer.is_valid()" is true. Continuing.

It helped when I deleted .godot directory and all .import files, but when I copy any image, it will have the same problems as described above.

Can't reproduce in a different project. It's like some files are corrupting the importer.

I'd suggest to just remove the problematic file and recreate it.

slasktotten commented 2 years ago

We just ran into something similiar. This is a fresh project with a empty .csv file at the root. find_file_bug.zip

Version - Godot 4 alpha 14. Os - MacOs 12.1

Importing any .png into this project causes the red cross thing.

jrockett6 commented 1 year ago

I also ran into this issue. In my case had a couple of .exr files failing to import, which caused all subsequent .jpg/.png imports to fail, without the option to reimport. Got the same error message as above -

editor/editor_file_system.cpp:2132 - Condition "!importer.is_valid()" is true. Continuing.

Removing the failed imports and restarting the editor solved the issue - .png and .jpgs now are imported fine.

Version: Godot4 beta2/beta3 OS: MacOS Monterey 12.5, M1 2020

MarcusRiemer commented 1 year ago

find_file_bug.zip

I can reproduce this with Godot 4.0 Beta 14 on an Intel MacPro from 2018 running Ventura 13.1. I used the Board Game Pack from Kenney and can't load a single one of the PNG files. The builtin Godot Icon works fine though.

@jrockett6 Where did you get that error from? I don't get a message box or similar.

MarcusRiemer commented 1 year ago

Just gave it a quick try on Arch Linux with Godot 4.0 Beta 14 and it just works there. So this is probably a MacOS related problem?

jrockett6 commented 1 year ago

@jrockett6 Where did you get that error from? I don't get a message box or similar.

@MarcusRiemer I'm fairly certain it was just in the Output console.

CedricFJacob commented 1 year ago

I figured it out for me from one of these comments. When I have a CSV file in my folder, it messes up all the imports.

plexsoup commented 1 year ago

Not sure if it's helpful to pile on, but I can confirm that I get these same kind of errors with importing image files on Mac. Condition "!res.is_valid()" is true. Returning: ERR_CANT_OPEN. I've tried changing permissions on the files and removing xattrs, but haven't had success so far. Seems like I can work around the problem by reimporting the textures as an Image, then again as a Texture2d.

The same project with the same files appears to work on Windows with no problems.

saletrak commented 1 year ago

I found a workaround. 1) Duplicate any resource and set a new name for new resource. 2) Optionally move somewhere 3) Use any program to overwrite the file with new asset 4) Select the file in FileSystem tab, open Import tab, click Reimport.

However, a quick fix of this issue would be appreciated

rabienrose commented 1 year ago

Just turn off option: Use multiple threads in Editor/Import. By investigating the code, i found this problem is caused by threading of importing.

Zireael07 commented 1 year ago

@rabienrose that's a pretty important clue, thanks <3

vPumpking commented 7 months ago

Is there any pull request related to this?