diff options
author | Lyuma <xn.lyuma@gmail.com> | 2024-02-25 00:36:39 -0800 |
---|---|---|
committer | Lyuma <xn.lyuma@gmail.com> | 2024-02-26 03:06:07 -0800 |
commit | 652ef966f99de0a915a601b686378f98c1a49b08 (patch) | |
tree | 9c71c9f70b14e674315763dd8dcf6653544ee818 /modules/gltf/editor | |
parent | 2e7fc81315bfa8d0a15f60adff2a12b6f3104236 (diff) | |
download | redot-engine-652ef966f99de0a915a601b686378f98c1a49b08.tar.gz |
Add new scene import option to import as Skeleton
Adds a bool import option `nodes/import_as_skeleton_bones`.
This is supported in all FBX or GLTF document based formats.
It is especially useful for retargeting and importing animations.
Diffstat (limited to 'modules/gltf/editor')
-rw-r--r-- | modules/gltf/editor/editor_scene_importer_blend.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/gltf/editor/editor_scene_importer_blend.cpp b/modules/gltf/editor/editor_scene_importer_blend.cpp index a91856c4a1..c6e92de762 100644 --- a/modules/gltf/editor/editor_scene_importer_blend.cpp +++ b/modules/gltf/editor/editor_scene_importer_blend.cpp @@ -287,6 +287,9 @@ Node *EditorSceneFormatImporterBlend::import_scene(const String &p_path, uint32_ if (p_options.has(SNAME("blender/materials/unpack_enabled")) && p_options[SNAME("blender/materials/unpack_enabled")]) { base_dir = sink.get_base_dir(); } + 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); + } state->set_scene_name(blend_basename); err = gltf->append_from_file(sink.get_basename() + ".gltf", state, p_flags, base_dir); if (err != OK) { |