From a72d8c086ff7c87bce04cbeaa637caf016699d89 Mon Sep 17 00:00:00 2001 From: Mike Krus Date: Wed, 29 Jan 2020 19:53:46 +0000 Subject: 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 --- .../sceneparsers/gltfexport/gltfexporter.cpp | 38 ++++++---------------- 1 file changed, 10 insertions(+), 28 deletions(-) (limited to 'src/plugins/sceneparsers/gltfexport/gltfexporter.cpp') 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"); -- cgit v1.2.3