godotengine / godot

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

glTF's Naming Version and Embedded Image Handling import options can't be overridden in Project Settings Import Defaults #89379

Closed lyuma closed 22 hours ago

lyuma commented 4 months ago

Tested versions

Should be an issue with all versions 4.3 and higher

On 4.2 and below, it worked because all Scene importers show the gltf/embedded_image_handling setting.

System information

Godot v4.3.dev (c5c6f8d43) - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3090 (NVIDIA; 31.0.15.3713) - Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz (16 Threads)

Issue description

There is a setting for glb embedded textures that projects may wish to change to basis universal (or uncompressed) for certain workflows. The default value extracts textures without asking, and there is no way to change this default in project settings: image

This is the setting in the import dock which I want changed. image

This means, the only way to include glb files in the project and use their textures embedded is to add them to the project, let it extract the textures, wait for godot to compress the extracted textures, then change the import setting to Embed as Basis Universal, then reimport, and finally delete the extracted textures. Due tot his issue, this process must be repeated for every single glb in the project, or avoid using glb files.

The one upside is the difficulty in changing this setting encourages users to avoids some workflow pitfalls: Basis Universal has had some issues; uncompressed textures are bad for many reasons; and embedded textures will cause memory duplication when extracting meshes and materials. So maybe it's a good thing that this setting is hard to change ;-)

I believe the same issue is likely to affect blend import settings as well as fbx-specific settings.

On Godot 4.2.x and earlier, it was possible to change gltf settings on all scenes, including ESCN, Blend, FBX and glTF: ESCN sample

The blend settings never showed up in import defaults. only the gltf option seems to be global.

Steps to reproduce

  1. Go to Project Settings -> Import Defaults.
  2. Choose "Scene"
  3. There is no way to change the default value of Extract Tex

Minimal reproduction project (MRP)

This is an issue with project settings, so it happens even in a blank project.

jamie-pate commented 2 months ago

I used this setting on the regular import panel (not the advanced import panel) and it stuck.. ("Set as default for scene") image

Afterward the option to set this default in the project settings Import Defaults was available! image

skyace65 commented 2 months ago

Jamie is correct and I've tested it in 4.2.2. You can change that in project settings under import defaults and the change stays.

caioraphael1 commented 1 week ago

I'm also having this issue. I'm using 4.3.beta2. Using Jamie's method didn't work for me, the option didn't appear afterward.

For me this seems like a bug, but it's only tagged as an enhancement. Also, for sure Embed should be the default option for .glb files.

Calinou commented 1 week ago

The issue isn't specific to glTF scenes. It seems import options that are only available under certain file extensions are not available to be overridden in the Project Settings' import defaults tab. SVG's svg/scale import option may have the same issue. However, it's also defined differently.

SVG defines the import options conditionally, but does not use subclassing:

https://github.com/godotengine/godot/blob/6fb3b727564a4afa42b03acc269bf6bb5ba1a139/editor/import/resource_importer_texture.cpp#L247-L254

glTF defines them as an override using subclassing:

https://github.com/godotengine/godot/blob/6fb3b727564a4afa42b03acc269bf6bb5ba1a139/modules/gltf/editor/editor_scene_importer_gltf.cpp#L85-L89

I don't see a good way to resolve this issue, other than adding glTF Scene as a separate import default type specifically for glTF scenes. This means all glTF scenes would start using their own defaults, independently from other 3D scene formats.

caioraphael1 commented 1 week ago

I don't see a good way to resolve this issue, other than adding glTF Scene as a separate import default type specifically for glTF scenes. This means all glTF scenes would start using their own defaults, independently from other 3D scene formats.

Would that be an issue? For me it makes more sense to separate 3D objects from normal objects, as it sounded weird to me that the .gltf options were inside the Scene options.

Calinou commented 1 week ago

For me it makes more sense to separate 3D objects from normal objects, as it sounded weird to me that the .gltf options were inside the Scene options.

"Scene" import is only used for 3D scenes. It's used for the following:

SCN/TSCN scenes do not use the import system, as they don't need to be imported to be used in the first place.

It is technically possible to write your own scene importer as an extension that could import 2D scenes, but it's not designed with this in mind.

My point is, if we start using a separate import type for glTF scenes in the Import Defaults, then the defaults would no longer be shared with FBX scenes (which you may be using in the same project, e.g. if using assets from an asset store). We don't do this for other file extensions such as images or audio, so it'd be inconsistent.

prominentdetail commented 1 week ago

I just tested, and I have the same issue. The "Embedded Image Handling" option that is available in 4.2.2 is not available in 4.3.beta2

This forces all the gltf files to have blurry/compressed textures: image

And this is how they should look when uncompressed: image

screenshot of missing option in Import Defaults > Scene: (4.3.beta2) image

and screenshot of how it should look: (4.2.2) image

As you can see the glTF section is missing in 4.3.beta2

Calinou commented 1 week ago

I can confirm what @prominentdetail reported – this is indeed a regression from 4.2 to 4.3, which I bisected to 04d43947bff4de9db8d7005862a1d895b6703fbc (cc @fire). OP's statement about this issue being reproducible since 4.0 is therefore incorrect.

It can be reproduced in a blank project by going to the Project Settings.

PS: This issue can be also noticed in the Animation Library import type.