-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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 file import creates files that are too large #71538
Comments
Is this still an issue in 4.0 rc2? We now extract textures by default in glb files. |
I would assume so, but I will check right now (EDIT: Yes, it is still the case.) In the steps that I outlined in my issue, there were no textures to extract. The difference likely comes down to the file format used. The automatically imported scenes start with a "RSRC" header, and have the ascii string "PackedScene" near the top of the file, while the manually saved scenes start with a "RSCC" header (compressed?), and have no apparent ascii strings. |
(Ignore the closed issue, clicked the wrong button) |
I can confirm this on 4.1.dev 33957ae (Linux). |
Godot version
4.0 noticed since beta 4
System information
Windows 10 and Arch Linux
Issue description
When importing a glb or gltf file, the
.scn
file created in.godot/imported
is much much larger than creating a new inherited scene, clearing inheritance (so the scene contains all the mesh information), and saving that as a.scn
manually.I've noticed this in my own projects, where manually creating a
.scn
file by clearing inheritance results in a file that is 60 KB, whereas the.scn
file created by godot in the.godot/imported
folder is 3.1 MB, 50 times larger. In this same project, adding together the file sizes of all the.scn
files created by importing either a.glb
or.gltf
file shows that there are 700 MB of.scn
files. The entire size of my assets folder including textures and audio is only 192 MB. By manually turning every glb or gltf file into a.scn
by clearing inheritance, and then excluding*.glb
and*.gltf
resources in my export profile, I can bring my pck down from 767 MB to 73 MB, a 10 times reduction in size.Steps to reproduce
Open blender, and export a default cube as a gltf or glb into a Godot project.
Open Godot, importing the model. Navigate to
.godot/imported
and notice the size of the created.scn
file.Right click on the gltf file in Godot, choose "New inherited scene". Save this scene as a
.scn
file. Then, right click on the root node and select "Clear inheritance", and save again. Notice the size of this.scn
file.In this example, the file I created is 2.6 times smaller.
Go to the scene menu, and choose "Save Scene As", saving it as a
.tscn
file. Notice the size of the file.The
.tscn
file is smaller than the.scn
file created by Godot, even though it is text based and not binary and thus should be larger.Navigate to the
.godot/imported
directory and copy the created.scn
file into your Godot project. Open the.scn
file in the editor, and as in step 4, save it as a.tscn
file as well. Note the file size.Notice that now, it is the same size as the
.tscn
file I created in step 4.Diff these two
.tscn
files together.Notice that the only difference between the file created manually by making a new scene and clearing inheritance, and the file created automatically by Godot on import, is the uid assigned to the scene. Therefore, there has been zero loss of content or functionality to explain why the
.scn
created manually is 2.6 times smaller.Reopen the
.scn
file created automatically by Godot during import, and "Save Scene As" again, but this time, continue to save it as a.scn
file, just with a new name. Note the file size.Even though no modifications were made to the file, and it was simply resaved into the same file format, it is still 2.6 times smaller than the file created automatically by Godot.
Minimal reproduction project
gltf.zip
The text was updated successfully, but these errors were encountered: