summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2016-01-06 12:25:14 +0100
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2016-01-07 09:28:18 +0000
commit7840241b0aec3e40c1bad7ea9bddfebf699e976d (patch)
tree1c5ee286cc94a97c97b53ee328ca25b57b183639
parenta0d90233bd2520236b920483db253dafb1e14e8f (diff)
Use .qgltf extension for qgltf-generated glTF files
Let's avoid future confusion by using a custom extension for the main JSON document. In case assimp gets upgraded to a future version supporting glTF files for example, confusion can arise due to the conflicting file extensions in the scene parser plugins. Change-Id: I370cc45cc399cae4f425d86574ccea9cd6c59d4f Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
-rw-r--r--examples/qt3d/qgltf/Wine.qml2
-rw-r--r--src/plugins/sceneparsers/gltf/gltfparser.cpp2
-rw-r--r--tools/qgltf/qgltf.cpp6
3 files changed, 5 insertions, 5 deletions
diff --git a/examples/qt3d/qgltf/Wine.qml b/examples/qt3d/qgltf/Wine.qml
index 4fab28479..b24e9de3f 100644
--- a/examples/qt3d/qgltf/Wine.qml
+++ b/examples/qt3d/qgltf/Wine.qml
@@ -54,7 +54,7 @@ Entity {
},
SceneLoader
{
- source: "qrc:/models/wine.gltf"
+ source: "qrc:/models/wine.qgltf"
}
]
}
diff --git a/src/plugins/sceneparsers/gltf/gltfparser.cpp b/src/plugins/sceneparsers/gltf/gltfparser.cpp
index 0ede1ead2..ac942ef68 100644
--- a/src/plugins/sceneparsers/gltf/gltfparser.cpp
+++ b/src/plugins/sceneparsers/gltf/gltfparser.cpp
@@ -430,7 +430,7 @@ bool GLTFParser::isGLTFPath(const QString& path)
// might need to detect other things in the future, but would
// prefer to avoid doing a full parse.
QString suffix = finfo.suffix().toLower();
- return (suffix == QStringLiteral("json") || suffix == QStringLiteral("gltf"));
+ return (suffix == QStringLiteral("json") || suffix == QStringLiteral("gltf") || suffix == QStringLiteral("qgltf"));
}
void GLTFParser::renameFromJson(const QJsonObject &json, QObject * const object)
diff --git a/tools/qgltf/qgltf.cpp b/tools/qgltf/qgltf.cpp
index 7d40029d9..561e167b7 100644
--- a/tools/qgltf/qgltf.cpp
+++ b/tools/qgltf/qgltf.cpp
@@ -2400,7 +2400,7 @@ void GltfExporter::save(const QString &inputFilename)
m_doc.setObject(m_obj);
- QString gltfName = opts.outDir + basename + QStringLiteral(".gltf");
+ QString gltfName = opts.outDir + basename + QStringLiteral(".qgltf");
f.setFileName(gltfName);
if (opts.showLog)
qDebug().noquote() << (opts.genBin ? "Writing (binary JSON)" : "Writing") << gltfName;
@@ -2452,9 +2452,9 @@ int main(int argc, char **argv)
cmdLine.addVersionOption();
QCommandLineOption outDirOpt(QStringLiteral("d"), QStringLiteral("Place all output data into <dir>"), QStringLiteral("dir"));
cmdLine.addOption(outDirOpt);
- QCommandLineOption binOpt(QStringLiteral("b"), QStringLiteral("Store binary JSON data in the .gltf file"));
+ QCommandLineOption binOpt(QStringLiteral("b"), QStringLiteral("Store binary JSON data in the .qgltf file"));
cmdLine.addOption(binOpt);
- QCommandLineOption compactOpt(QStringLiteral("m"), QStringLiteral("Store compact JSON in the .gltf file"));
+ QCommandLineOption compactOpt(QStringLiteral("m"), QStringLiteral("Store compact JSON in the .qgltf file"));
cmdLine.addOption(compactOpt);
QCommandLineOption compOpt(QStringLiteral("c"), QStringLiteral("qCompress() vertex/index data in the .bin file"));
cmdLine.addOption(compOpt);