summaryrefslogtreecommitdiff
path: root/modules/gltf
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-10-05 08:29:35 +0200
committerRémi Verschelde <rverschelde@gmail.com>2022-10-05 08:29:35 +0200
commit75616d60e46d8478cb6c90fe1bc2ac3121de013a (patch)
tree0b17229e8287a7df4b9e36b4110ab7ea9e24e7ba /modules/gltf
parent52c2a6b564fe6fac26cf2427dc50a4566ac62f9c (diff)
parent2830e276b87dc73210207f77fdadfc54ab02f5d9 (diff)
Merge pull request #66841 from jtnicholl/blend_enum_checks
Clean up .blend importer to fix unreachable code paths
Diffstat (limited to 'modules/gltf')
-rw-r--r--modules/gltf/editor/editor_scene_importer_blend.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/modules/gltf/editor/editor_scene_importer_blend.cpp b/modules/gltf/editor/editor_scene_importer_blend.cpp
index f79731dd22..dcf59bce24 100644
--- a/modules/gltf/editor/editor_scene_importer_blend.cpp
+++ b/modules/gltf/editor/editor_scene_importer_blend.cpp
@@ -77,20 +77,19 @@ Node *EditorSceneFormatImporterBlend::import_scene(const String &p_path, uint32_
} else {
parameters_arg += "export_extras=False,";
}
- if (p_options.has(SNAME("blender/meshes/skins")) && p_options[SNAME("blender/meshes/skins")]) {
+ if (p_options.has(SNAME("blender/meshes/skins"))) {
int32_t skins = p_options["blender/meshes/skins"];
if (skins == BLEND_BONE_INFLUENCES_NONE) {
- parameters_arg += "export_all_influences=False,";
+ parameters_arg += "export_skins=False,";
} else if (skins == BLEND_BONE_INFLUENCES_COMPATIBLE) {
- parameters_arg += "export_all_influences=False,";
+ parameters_arg += "export_all_influences=False,export_skins=True,";
} else if (skins == BLEND_BONE_INFLUENCES_ALL) {
- parameters_arg += "export_all_influences=True,";
+ parameters_arg += "export_all_influences=True,export_skins=True,";
}
- parameters_arg += "export_skins=True,";
} else {
parameters_arg += "export_skins=False,";
}
- if (p_options.has(SNAME("blender/materials/export_materials")) && p_options[SNAME("blender/materials/export_materials")]) {
+ if (p_options.has(SNAME("blender/materials/export_materials"))) {
int32_t exports = p_options["blender/materials/export_materials"];
if (exports == BLEND_MATERIAL_EXPORT_PLACEHOLDER) {
parameters_arg += "export_materials='PLACEHOLDER',";
@@ -115,7 +114,7 @@ Node *EditorSceneFormatImporterBlend::import_scene(const String &p_path, uint32_
} else {
parameters_arg += "export_colors=False,";
}
- if (p_options.has(SNAME("blender/nodes/visible")) && p_options[SNAME("blender/nodes/visible")]) {
+ if (p_options.has(SNAME("blender/nodes/visible"))) {
int32_t visible = p_options["blender/nodes/visible"];
if (visible == BLEND_VISIBLE_VISIBLE_ONLY) {
parameters_arg += "use_visible=True,";