summaryrefslogtreecommitdiffstats
path: root/src/plugins/sceneparsers/gltfexport/gltfexporter.cpp
diff options
context:
space:
mode:
authorMike Krus <mike.krus@kdab.com>2020-01-29 19:53:46 +0000
committerMike Krus <mike.krus@kdab.com>2020-01-30 07:02:28 +0000
commita72d8c086ff7c87bce04cbeaa637caf016699d89 (patch)
tree86efe2ee035485929a0b40643e814cd473e19214 /src/plugins/sceneparsers/gltfexport/gltfexporter.cpp
parentef7f6e5cc41c1a2bf99fb3ab898e52d9e5262878 (diff)
Remove support for binary json gltf
Binary JSON was deprecated in 5.15. It was never an official gltf format anyway. Could be replaced by CBOR but API is different. Change-Id: If4ac6301addde8aa875fde246055dc8f1c6bcf9d Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/plugins/sceneparsers/gltfexport/gltfexporter.cpp')
-rw-r--r--src/plugins/sceneparsers/gltfexport/gltfexporter.cpp38
1 files changed, 10 insertions, 28 deletions
diff --git a/src/plugins/sceneparsers/gltfexport/gltfexporter.cpp b/src/plugins/sceneparsers/gltfexport/gltfexporter.cpp
index b4b87ef76..0f9a3bef9 100644
--- a/src/plugins/sceneparsers/gltfexport/gltfexporter.cpp
+++ b/src/plugins/sceneparsers/gltfexport/gltfexporter.cpp
@@ -284,9 +284,7 @@ GLTFExporter::~GLTFExporter()
// options : Export options.
//
// Supported options are:
-// "binaryJson" (bool): Generates a binary JSON file, which is more efficient to parse.
// "compactJson" (bool): Removes unnecessary whitespace from the generated JSON file.
-// Ignored if "binaryJson" option is true.
/*!
Exports the scene to the GLTF format
@@ -322,8 +320,6 @@ bool GLTFExporter::exportScene(QEntity *sceneRoot, const QString &outDir,
m_renderPassCount = 0;
m_effectCount = 0;
- m_gltfOpts.binaryJson = options.value(QStringLiteral("binaryJson"),
- QVariant(false)).toBool();
m_gltfOpts.compactJson = options.value(QStringLiteral("compactJson"),
QVariant(false)).toBool();
@@ -1582,32 +1578,18 @@ bool GLTFExporter::saveScene()
QString gltfName = m_exportDir + m_exportName + QStringLiteral(".qgltf");
f.setFileName(gltfName);
- qCDebug(GLTFExporterLog, " Writing %sJSON file: '%ls'",
- m_gltfOpts.binaryJson ? "binary " : "", qUtf16PrintableImpl(gltfName));
+ qCDebug(GLTFExporterLog, " Writing JSON file: '%ls'", qUtf16PrintableImpl(gltfName));
- if (m_gltfOpts.binaryJson) {
- if (f.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
- m_exportedFiles.insert(QFileInfo(f.fileName()).fileName());
- QByteArray json = m_doc.toBinaryData();
- f.write(json);
- f.close();
- } else {
- qCWarning(GLTFExporterLog, " Writing binary JSON file '%ls' failed!",
- qUtf16PrintableImpl(gltfName));
- return false;
- }
+ if (f.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate)) {
+ m_exportedFiles.insert(QFileInfo(f.fileName()).fileName());
+ QByteArray json = m_doc.toJson(m_gltfOpts.compactJson ? QJsonDocument::Compact
+ : QJsonDocument::Indented);
+ f.write(json);
+ f.close();
} else {
- if (f.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate)) {
- m_exportedFiles.insert(QFileInfo(f.fileName()).fileName());
- QByteArray json = m_doc.toJson(m_gltfOpts.compactJson ? QJsonDocument::Compact
- : QJsonDocument::Indented);
- f.write(json);
- f.close();
- } else {
- qCWarning(GLTFExporterLog, " Writing JSON file '%ls' failed!",
- qUtf16PrintableImpl(gltfName));
- return false;
- }
+ qCWarning(GLTFExporterLog, " Writing JSON file '%ls' failed!",
+ qUtf16PrintableImpl(gltfName));
+ return false;
}
QString qrcName = m_exportDir + m_exportName + QStringLiteral(".qrc");