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

EditorExportPlugin._export_file is not called for many file types #67844

Closed
tcoxon opened this issue Oct 24, 2022 · 4 comments · Fixed by #90365
Closed

EditorExportPlugin._export_file is not called for many file types #67844

tcoxon opened this issue Oct 24, 2022 · 4 comments · Fixed by #90365

Comments

@tcoxon
Copy link
Contributor

tcoxon commented Oct 24, 2022

Godot version

3.5.1.stable

System information

Arch Linux (rolling release). GLES3 backend

Issue description

What I wanted to do: use an EditorExportPlugin to filter files intended for inclusion in a separate pck. I wanted to see if I could use a 'dlc' feature tag to build DLC pcks, and exclude DLC content from the base game, because the built-in export filters are difficult to use correctly (I don't want to manually update a file list every time I add a file to a DLC package).

What I expected: EditorExportPlugin._export_file would be called for each file to being included in the pck (as in the documentation), and I could use skip to exclude it.

What actually happened: _export_file is not called for certain resource types, e.g. PNGs and OGGs. These resources are always silently included in every exported build.

Steps to reproduce

  1. Open the attached minimal reproduction project.
  2. Export a zip using either the linux or windows preset.
  3. Note the text logged to the output panel. This is generated by the addon/export_plugin/export_plugin.gd script:
Including res://Main.tscn
Including res://default_env.tres
Excluding res://dlc/Test.tscn
  1. Open the zip and note that the compiled script in res://dlc/ is included, and the OGG and PNG content are present in .import/.

Given that nothing was logged for the script, OGG, and PNG, it appears that _export_file was never called, and so these resources were included in the zip by default.

Minimal reproduction project

export_plugin_test.zip

@disco0
Copy link

disco0 commented Apr 9, 2023

Similar issue—I wrote an addon to exclude specific mod content directories when building a game, and noticed files created during gdscript compilation are not passed into _export_file.

Build is 3.5.1.stable.official.6fed1ffa3

Details

Given these files in the folder:

res://MOD_CONTENT/FakeCache/fake_cache.gd
res://MOD_CONTENT/FakeCache/fakecache.tscn
res://MOD_CONTENT/FakeCache/init.gd
res://MOD_CONTENT/FakeCache/mod.json

And this directory in the exclusion list:

res://MOD_CONTENT/FakeCache

The tscn and json files are detected and excluded, however compiled gdc files (as well as remaps) in the excluded dir appear in savepack steps in build log:

...

	savepack: step 27: Storing File: res://MOD_CONTENT/FakeCache/fake_cache.gdc

...

[plugin:_export_file] res://MOD_CONTENT/FakeCache/fakecache.tscn
[plugin:_export_file] Excluding res://MOD_CONTENT/FakeCache/fakecache.tscn

...

	savepack: step 27: Storing File: res://MOD_CONTENT/FakeCache/init.gdc

...

[plugin:_export_file] res://MOD_CONTENT/FakeCache/mod.json
[plugin:_export_file] Excluding res://MOD_CONTENT/FakeCache/mod.json

...

	savepack: step 102: Storing File: res://MOD_CONTENT/FakeCache/fake_cache.gd.remap

...

	savepack: step 102: Storing File: res://MOD_CONTENT/FakeCache/init.gd.remap

...

[plugin:_export_end] Directory exclusion list:
[plugin:_export_end]  - "res://MOD_CONTENT/FakeCache"
[plugin:_export_end] Excluded files:
[plugin:_export_end]  - "res://MOD_CONTENT/FakeCache/fakecache.tscn"
[plugin:_export_end]  - "res://MOD_CONTENT/FakeCache/mod.json"

As well as the output pck:

image

@rambda
Copy link

rambda commented Jul 8, 2023

Still reproducible in 3.6.beta2 and 4.1.beta2.

In 3.5.stable ~ 3.6.beta2,
_export_file is called for .tscn, .tres, .ogv, .otf, .ttf, .shader,
not called for .gd, .png, .ogg, .res.
mrp:
EditorExportPluginBug.zip

In 4.1.beta2,
mrp:
EditorExportPluginBugG4.zip
_export_file is called for .gd, .tscn, .tres, .res, .gdshader, .ogv,
not called for .otf, .ttf, .png, .ogg.

@KoBeWi
Copy link
Member

KoBeWi commented Feb 23, 2024

Still valid in 4.3 dev3.

@allenwp
Copy link
Contributor

allenwp commented Jul 3, 2024

To those subscribed to this issue who are interested in testing an alternate fix to the one that was merged one month ago, I’ve put together a PR that calls _export_file on all resource types: #93878

allenwp added a commit to allenwp/godot that referenced this issue Jul 5, 2024
- Alternate fix to godotengine#67844 that calls `_export_file` for all resource types instead of implementing `skip()` for customize functions.
- Fixes godotengine#93823.
- Moved logic surrounding "Skip" and "Keep" imported files to happen before resource customization. Fixes godotengine#93825.
- Also fixes an issue that I suspect might exist where progress bars during export were incorrect due to imported files in the project that are configured as "Keep" or "Skip".
sorascode pushed a commit to sorascode/godot-soras-version that referenced this issue Jul 22, 2024
- Alternate fix to godotengine#67844 that calls `_export_file` for all resource types instead of implementing `skip()` for customize functions.
- Fixes godotengine#93823.
- Moved logic surrounding "Skip" and "Keep" imported files to happen before resource customization. Fixes godotengine#93825.
- Also fixes an issue that I suspect might exist where progress bars during export were incorrect due to imported files in the project that are configured as "Keep" or "Skip".
Luis-Wong pushed a commit to Luis-Wong/godot that referenced this issue Jul 26, 2024
- Alternate fix to godotengine#67844 that calls `_export_file` for all resource types instead of implementing `skip()` for customize functions.
- Fixes godotengine#93823.
- Moved logic surrounding "Skip" and "Keep" imported files to happen before resource customization. Fixes godotengine#93825.
- Also fixes an issue that I suspect might exist where progress bars during export were incorrect due to imported files in the project that are configured as "Keep" or "Skip".
2nafish117 pushed a commit to 2nafish117/godot that referenced this issue Aug 5, 2024
- Alternate fix to godotengine#67844 that calls `_export_file` for all resource types instead of implementing `skip()` for customize functions.
- Fixes godotengine#93823.
- Moved logic surrounding "Skip" and "Keep" imported files to happen before resource customization. Fixes godotengine#93825.
- Also fixes an issue that I suspect might exist where progress bars during export were incorrect due to imported files in the project that are configured as "Keep" or "Skip".
chryan pushed a commit to chryan/godot that referenced this issue Aug 6, 2024
- Alternate fix to godotengine#67844 that calls `_export_file` for all resource types instead of implementing `skip()` for customize functions.
- Fixes godotengine#93823.
- Moved logic surrounding "Skip" and "Keep" imported files to happen before resource customization. Fixes godotengine#93825.
- Also fixes an issue that I suspect might exist where progress bars during export were incorrect due to imported files in the project that are configured as "Keep" or "Skip".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants