From 7f2a90cdb9395b399eb3c4409d5e067add1e5860 Mon Sep 17 00:00:00 2001 From: Simon Walton Date: Fri, 18 May 2018 11:20:45 -0700 Subject: [PATCH] Address couple of reviewer issues --- libraries/baking/src/FBXBaker.cpp | 40 ------------------------------- libraries/fbx/src/FBX.h | 3 ++- libraries/fbx/src/FBXWriter.cpp | 1 - 3 files changed, 2 insertions(+), 42 deletions(-) diff --git a/libraries/baking/src/FBXBaker.cpp b/libraries/baking/src/FBXBaker.cpp index c6bfa045b9..b90082d969 100644 --- a/libraries/baking/src/FBXBaker.cpp +++ b/libraries/baking/src/FBXBaker.cpp @@ -365,43 +365,3 @@ void FBXBaker::rewriteAndBakeSceneTextures() { } } } - -#if 0 -void FBXBaker::exportScene() { - // save the relative path to this FBX inside our passed output folder - auto fileName = _modelURL.fileName(); - auto baseName = fileName.left(fileName.lastIndexOf('.')); - auto bakedFilename = baseName + BAKED_FBX_EXTENSION; - - _bakedModelFilePath = _bakedOutputDir + "/" + bakedFilename; - - auto fbxData = FBXWriter::encodeFBX(_rootNode); - - QFile bakedFile(_bakedModelFilePath); - - if (!bakedFile.open(QIODevice::WriteOnly)) { - handleError("Error opening " + _bakedModelFilePath + " for writing"); - return; - } - - bakedFile.write(fbxData); - - _outputFiles.push_back(_bakedModelFilePath); - -#ifdef HIFI_DUMP_FBX - { - FBXToJSON fbxToJSON; - fbxToJSON << _rootNode; - QFileInfo modelFile(_bakedModelFilePath); - QString outFilename(modelFile.dir().absolutePath() + "/" + modelFile.completeBaseName() + "_FBX.json"); - QFile jsonFile(outFilename); - if (jsonFile.open(QIODevice::WriteOnly)) { - jsonFile.write(fbxToJSON.str().c_str(), fbxToJSON.str().length()); - jsonFile.close(); - } - } -#endif - - qCDebug(model_baking) << "Exported" << _modelURL << "with re-written paths to" << _bakedModelFilePath; -} -#endif diff --git a/libraries/fbx/src/FBX.h b/libraries/fbx/src/FBX.h index ce3fc52c3a..b3b2b29c74 100644 --- a/libraries/fbx/src/FBX.h +++ b/libraries/fbx/src/FBX.h @@ -28,8 +28,9 @@ #include #include -static const QByteArray FBX_BINARY_PROLOG = "Kaydara FBX Binary "; +// See comment in FBXReader::parseFBX(). static const int FBX_HEADER_BYTES_BEFORE_VERSION = 23; +static const QByteArray FBX_BINARY_PROLOG("Kaydara FBX Binary \0\x1a\0", FBX_HEADER_BYTES_BEFORE_VERSION); static const quint32 FBX_VERSION_2015 = 7400; static const quint32 FBX_VERSION_2016 = 7500; diff --git a/libraries/fbx/src/FBXWriter.cpp b/libraries/fbx/src/FBXWriter.cpp index 7b1a4a6642..8a668e7ce9 100644 --- a/libraries/fbx/src/FBXWriter.cpp +++ b/libraries/fbx/src/FBXWriter.cpp @@ -62,7 +62,6 @@ QByteArray FBXWriter::encodeFBX(const FBXNode& root) { out.setVersion(QDataStream::Qt_4_5); out.writeRawData(FBX_BINARY_PROLOG, FBX_BINARY_PROLOG.size()); - out.writeRawData("\0\x1a", 3); // Blender needs this header component. #ifdef USE_FBX_2016_FORMAT out << FBX_VERSION_2016;