diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2019-10-28 12:59:31 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2019-10-29 16:04:39 +0100 |
commit | 6e84e993f42be3530bff2550b89e5066c4d9cea6 (patch) | |
tree | 5834181018af5f6897d088e8bd909ef9e529c688 /src/animation | |
parent | f54cf0762e4a3e8742e15dd7ec970fcb7285cbc1 (diff) |
Accept CBOR as optional format in gltf data
Change-Id: I8e64f061147af10a0d017238664c483724047059
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/animation')
-rw-r--r-- | src/animation/backend/gltfimporter.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/animation/backend/gltfimporter.cpp b/src/animation/backend/gltfimporter.cpp index 718acbb79..01ccf159d 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; } |