summaryrefslogtreecommitdiff
path: root/modules/gltf/editor_scene_importer_gltf.cpp
diff options
context:
space:
mode:
authorK. S. Ernest (iFire) Lee <fire@users.noreply.github.com>2022-01-04 12:12:09 -0800
committerGitHub <noreply@github.com>2022-01-04 12:12:09 -0800
commit5ce54ce1424ac99e7346a37b4a99630e4b52b39a (patch)
treefe1b60a2e410800605f4cd94f7ccb0b07d125e65 /modules/gltf/editor_scene_importer_gltf.cpp
parentdeefce7bb53afcf77c79732af74f1856210a8cc6 (diff)
parentd8923d8c74d9219ee2a25573b688da102ae525be (diff)
Merge pull request #52541 from V-Sekai/gltf-load-scene-buffer
Add gltf import buffer.
Diffstat (limited to 'modules/gltf/editor_scene_importer_gltf.cpp')
-rw-r--r--modules/gltf/editor_scene_importer_gltf.cpp10
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 ef1ba14001..b4d39041da 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,