diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-05-23 08:59:13 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-05-23 08:59:13 +0200 |
commit | 782a0261cb06e632e30c0a4574a7e52cdd3ec580 (patch) | |
tree | 830e90000c41799598c25b2196fca219b3f16741 | |
parent | da979ecacac2ea437dd0e177a0d2cfd8c9c577ba (diff) | |
parent | ef486db569c7489d09d1da587a363cbcd5bbc482 (diff) | |
download | redot-engine-782a0261cb06e632e30c0a4574a7e52cdd3ec580.tar.gz |
Merge pull request #92196 from lyuma/gltf_anim_library_import_as_bones
Support Import As Skeleton Bones on glTF and AnimationLibrary import
-rw-r--r-- | editor/import/3d/resource_importer_scene.cpp | 2 | ||||
-rw-r--r-- | modules/gltf/editor/editor_scene_importer_gltf.cpp | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/editor/import/3d/resource_importer_scene.cpp b/editor/import/3d/resource_importer_scene.cpp index 23c22a8049..c0d38af26a 100644 --- a/editor/import/3d/resource_importer_scene.cpp +++ b/editor/import/3d/resource_importer_scene.cpp @@ -279,7 +279,7 @@ bool ResourceImporterScene::get_option_visibility(const String &p_path, const St } } - if (animation_importer && (p_option.begins_with("nodes/") || p_option.begins_with("meshes/") || p_option.begins_with("skins/"))) { + if (animation_importer && (p_option == "nodes/root_type" || p_option == "nodes/root_name" || p_option.begins_with("meshes/") || p_option.begins_with("skins/"))) { return false; // Nothing to do here for animations. } diff --git a/modules/gltf/editor/editor_scene_importer_gltf.cpp b/modules/gltf/editor/editor_scene_importer_gltf.cpp index e4ed79d15e..af9b2f2363 100644 --- a/modules/gltf/editor/editor_scene_importer_gltf.cpp +++ b/modules/gltf/editor/editor_scene_importer_gltf.cpp @@ -59,6 +59,9 @@ Node *EditorSceneFormatImporterGLTF::import_scene(const String &p_path, uint32_t int32_t enum_option = p_options["gltf/embedded_image_handling"]; state->set_handle_binary_image(enum_option); } + if (p_options.has(SNAME("nodes/import_as_skeleton_bones")) ? (bool)p_options[SNAME("nodes/import_as_skeleton_bones")] : false) { + state->set_import_as_skeleton_bones(true); + } Error err = gltf->append_from_file(p_path, state, p_flags); if (err != OK) { if (r_err) { |