From d8923d8c74d9219ee2a25573b688da102ae525be Mon Sep 17 00:00:00 2001 From: "K. S. Ernest (iFire) Lee" Date: Tue, 19 Oct 2021 09:06:23 -0700 Subject: 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. --- modules/gltf/editor_scene_importer_gltf.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'modules/gltf/editor_scene_importer_gltf.cpp') 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 doc; doc.instantiate(); - return doc->import_scene_gltf(p_path, p_flags, p_bake_fps, Ref(), r_missing_deps, r_err); + Ref 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 EditorSceneFormatImporterGLTF::import_animation(const String &p_path, -- cgit v1.2.3