summaryrefslogtreecommitdiffstats
path: root/src/animation/backend/gltfimporter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/animation/backend/gltfimporter.cpp')
-rw-r--r--src/animation/backend/gltfimporter.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/animation/backend/gltfimporter.cpp b/src/animation/backend/gltfimporter.cpp
index a2630fc5e..a5127efd0 100644
--- a/src/animation/backend/gltfimporter.cpp
+++ b/src/animation/backend/gltfimporter.cpp
@@ -35,6 +35,9 @@
****************************************************************************/
#include "gltfimporter_p.h"
+
+#include <Qt3DCore/private/qloadgltf_p.h>
+
#include <Qt3DAnimation/private/animationlogging_p.h>
#include <Qt3DAnimation/private/fcurve_p.h>
#include <Qt3DAnimation/private/keyframe_p.h>
@@ -434,12 +437,7 @@ GLTFImporter::GLTFImporter()
bool GLTFImporter::load(QIODevice *ioDev)
{
- QByteArray jsonData = ioDev->readAll();
- QJsonDocument sceneDocument = QJsonDocument::fromBinaryData(jsonData);
- if (sceneDocument.isNull())
- sceneDocument = QJsonDocument::fromJson(jsonData);
-
- if (Q_UNLIKELY(!setJSON(sceneDocument))) {
+ if (Q_UNLIKELY(!setJSON(qLoadGLTF(ioDev->readAll())))) {
qWarning("not a JSON document");
return false;
}