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

Use extracted texture files when saving a mesh's material to a file in Advanced Import Settings #75637

Closed
marcinn opened this issue Feb 17, 2023 · 1 comment · Fixed by #75636

Comments

@marcinn
Copy link
Contributor

marcinn commented Feb 17, 2023

Describe the project you are working on

Trying to make 3D demo scene with multiple assets

Godot 4 rc2

Describe the problem or limitation you are having in your project

The current import workflow consumes too much time and storage.

For GLB/GTLF w/textures the Godot Editor is extracting textures to separate files by default. This is pretty fine - the loading time is fast, reusing textures is available OOTB. But extracting materials creates *.tres files with copies of these textures inside, but saved in text file in super inefficient serialization format - comma separated decimals in ascii for each byte. This slows down the editor, slows down loading and saving times, and makes editor crashing more often.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

  1. Reuse already extracted textures. That would solve described issue.
  2. Avoid implicit saving binary files into tres files for any extracted/imported resource.
  3. Show a warning message for big files (using a threshold configured in the editor settings, default set to 10kb).

Just let's assume that storing binary data in text files is wrong by design, and allow doing that only for special cases like storing PackedArrays of hand crafted meshes in the editor.

The above suggestions will solve other similar issues, like storing complex meshes in text files.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

  1. Already exported resources are well known for the editor. It should just reference them if they exist instead of serializing same assets into tres file.
  2. If binary resources do not exist as a separate files, extract them first.
  3. Warn user if the editor is going to store "big" binary data into text file.

If this enhancement will not be used often, can it be worked around with a few lines of script?

No. This is core of the editor and is always used.

Note: the godotengine/godot-proposals#3443 proposal is handy but will not solve this one, because I'm talking here about default behavior.

Is there a reason why this should be core and not an add-on in the asset library?

As above.

@Calinou Calinou changed the title Saving materials from advanced import results in unexpected redundant storage of textures in tres files Use extracted texture files when saving a mesh's material to a file in Advanced Import Settings Feb 17, 2023
@lyuma lyuma transferred this issue from godotengine/godot-proposals Apr 4, 2023
@lyuma
Copy link
Contributor

lyuma commented Apr 4, 2023

Hi, I transferred this issue to an issue on godotengine/godot, because it is a bug and not intended behavior.

I have a proposed fix at #75636: I expect it should be possible to address in 4.0.x for all newly extracted materials without breaking compatibility, so there's no need for a feature proposal.

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.

4 participants