diff options
author | K. S. Ernest (iFire) Lee <ernest.lee@chibifire.com> | 2021-10-19 09:06:23 -0700 |
---|---|---|
committer | K. S. Ernest (iFire) Lee <ernest.lee@chibifire.com> | 2022-01-04 06:06:03 -0800 |
commit | d8923d8c74d9219ee2a25573b688da102ae525be (patch) | |
tree | 539331ce577f5635f9b6a960a4327378f2477786 /modules/gltf/editor_scene_importer_gltf.cpp | |
parent | 28174d531b7128f0281fc2b88da2f4962fd3513e (diff) |
Add import glb from buffer
Split functions from gltf document import and export into six functions.
Use base path to allow two code paths based on an empty base path or a full base path.
Add uri decode in _parse_buffers.
Diffstat (limited to 'modules/gltf/editor_scene_importer_gltf.cpp')
-rw-r--r-- | modules/gltf/editor_scene_importer_gltf.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/modules/gltf/editor_scene_importer_gltf.cpp b/modules/gltf/editor_scene_importer_gltf.cpp index 1a172877a0..83881bd351 100644 --- a/modules/gltf/editor_scene_importer_gltf.cpp +++ b/modules/gltf/editor_scene_importer_gltf.cpp @@ -53,7 +53,15 @@ Node *EditorSceneFormatImporterGLTF::import_scene(const String &p_path, Error *r_err) { Ref<GLTFDocument> doc; doc.instantiate(); - return doc->import_scene_gltf(p_path, p_flags, p_bake_fps, Ref<GLTFState>(), r_missing_deps, r_err); + Ref<GLTFState> state; + state.instantiate(); + Error err = doc->append_from_file(p_path, state, p_flags, p_bake_fps); + if (err != OK) { + *r_err = err; + return nullptr; + } + Node *root = doc->generate_scene(state, p_bake_fps); + return root; } Ref<Animation> EditorSceneFormatImporterGLTF::import_animation(const String &p_path, |