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

Renaming imported .csv file to .txt leading to not packing the file in the export package #38733

Closed
YLL opened this issue May 14, 2020 · 3 comments

Comments

@YLL
Copy link

YLL commented May 14, 2020

Godot version: Godot_v3.2.1-stable_win64

OS/device including version: Windows 10 Pro 18363.778

Issue description:
As I mentioned in the comments of #38245
Trying to rename an imported .cvs file to something like .txt dose not treat the corresponding .import file and it's content properly, which leads to somehow missing the renamed file in the export process.

Steps to reproduce:

  1. Put an empty file named "xxx.csv" into the project root dir.
  2. Select the very file in the FileSystem panel and change the "Import As:" option to "CSV" in the Import panel, then click "Reimport".
  3. After the reimport process, select the very file in the FileSystem panel, right click on it and choose "Rename" to rename the file name to "xxx.txt".
  4. The file disappers in the FileSystem panel, but the "xxx.txt.import" file lives in the project, with something like:

[dep]
source_file="res://xxx.csv"

  1. In any scripts try to run the following code.

print(var2str(File.new().file_exists("res://xxx.txt")))

  1. In Editor mode, you will see "true" in the Output panel. In any exported game, you will see "false" in the console even if the "include_filter" is set to "*.txt" and "export_filter" is "all_resources" in the export_preset.cfg.
  2. Try to delete the "xxx.txt.import" file in the project dir, and export again. you will see "true" in the console in the exported game.

Minimal reproduction project: could reproduce in an empty project

@TheDuriel
Copy link
Contributor

verify that your filter is *.txt not .txt

@YLL
Copy link
Author

YLL commented May 15, 2020

verify that your filter is *.txt not .txt

@TheDuriel
I'm pretty sure it's *.txt like I mentioned in step 6 of the issue reproduce instructions.
Cause in step 7, the .txt file will be accessable ONLY by deleting the corresponding .import file.
You can try to just do the export with Export PCK/ZIP and you'll find that neither the .csv or the renamed .txt file will be in the exported zip file.
Neither in the root dir of the zip file nor in the ".import" dir. But you'll find the .import file of the .csv or the renamed .txt file in the zip.
Only by deleting the .import file, then the txt file will be collected and packed into the pck/zip normally.
It's simple, just try with an empty project and export some zip packs and you'll see. It happens because of the .import file is not properly updated, or maybe it just needs to be gone after renaming an asset's extension to a type that doesn't need any import operation.

@akien-mga
Copy link
Member

Fixed by #47268.

@akien-mga akien-mga added this to the 4.0 milestone Mar 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants