-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Fix missing options in Project Import Defaults #94058
Fix missing options in Project Import Defaults #94058
Conversation
I found another problem that was probably always there with the default import settings of Scene. |
Looks reasonable at first glance. Seems better than the kludgy hack I was thinking of doing. I'll have to play with it a bit. The magic is the
Nice catch. I also believe this is correct. One thing I noticed is that there is something odd about the |
I tested in debug with the 4.2 branch code and the settings Maybe it was a mistake, I don't kwown why these 2 options could not have worked with fbx?!? |
e66d6f6
to
7ec80d8
Compare
I pushed a fix do exactly that. When default import settings exists, I update the dictionary instead for creating a new one. |
I tested with Blender and I think |
7ec80d8
to
169e732
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's the best change we can make for now. I'm most worried about the hardcoded file extension checks, but that was already an issue before.
We should merge this and then look into overhauling this option system some in 4.4
r_options->push_back(ResourceImporterScene::ImportOption(PropertyInfo(Variant::INT, "gltf/naming_version", PROPERTY_HINT_ENUM, "Godot 4.1 or 4.0,Godot 4.2 or later"), 1)); | ||
r_options->push_back(ResourceImporterScene::ImportOption(PropertyInfo(Variant::INT, "gltf/embedded_image_handling", PROPERTY_HINT_ENUM, "Discard All Textures,Extract Textures,Embed as Basis Universal,Embed as Uncompressed", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), GLTFState::HANDLE_BINARY_EXTRACT_TEXTURES)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still apprehensive about hiding these options because options like "naming version" are supposed to be used for .blend and .fbx via FBX2glTF, though if you're 100% sure they are currently being ignored in those cases, I guess it's okay.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I confirm that these options are used only in EditorSceneFormatImporterGLTF::import_scene
and this method is used only on gltf
and glb
files.
Thanks! |
Some modifications were made in 04d4394 that lead to remove some options in Project Settings. Also, some options like Blender specific parameters were never in the Project Import Defaults, which I guess was an error.
The premise I took was to put every options possible for all different file extension in the Project Import Defaults. This was the case in 4.2 except for .blend.
Modifications:
ResourceImporterScene::get_option_visibility
to check all plugins and importers. Previously, the method would return the result fromget_option_visibility
at the first importer, leading to only processing the first plugin or importer. Now, all are processed until a return value of false is encountered.EditorSceneFormatImporterFBX2GLTF::get_option_visibility
returned false for only one the ufbx options if FBX2GLTF is enabled.get_import_options
methods and always returns all the option when the path is empty (aka Project Import Defaults).Others found issues:
When importing from Blender, the optionsgltf/naming_version
andgltf/embedded_image_handling
are not used even if they were shown in 4.2. I could add these options for Blender, at leastembedded_image_handling
like it was done for ufbx??get_option_visibility
are not recalled so that means that to see the effects ofEditorSceneFormatImporterBlend::get_option_visibility
orEditorSceneFormatImporterFBX2GLTF::get_option_visibility
, the user needs to close the panel and reopen it. That could cause error if the user change the fbx/importer from FBX2GLTF to ufbx and tries to reimport. The 2 missing options will cause an error during importation.Project settings:
4.2
This PR:
FBX Import options
4.2
This PR
EDIT: stroked out the issue with Blender options.