From 98ec4641068e7433acffe2abcac75ad911777e14 Mon Sep 17 00:00:00 2001 From: utkarshgautamnyu Date: Tue, 24 Oct 2017 16:05:00 -0700 Subject: [PATCH] Indentation Fixes --- libraries/baking/src/FBXBaker.cpp | 20 ++++++++++++-------- libraries/baking/src/FBXBaker.h | 4 ++-- tools/oven/src/ui/ModelBakeWidget.cpp | 2 +- tools/oven/src/ui/ModelBakeWidget.h | 2 +- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/libraries/baking/src/FBXBaker.cpp b/libraries/baking/src/FBXBaker.cpp index f91e829c65..ac7211f77d 100644 --- a/libraries/baking/src/FBXBaker.cpp +++ b/libraries/baking/src/FBXBaker.cpp @@ -148,7 +148,7 @@ void FBXBaker::loadSourceFBX() { // check if the FBX is local or first needs to be downloaded if (_fbxURL.isLocalFile()) { // load up the local file - QFile localFBX{ _fbxURL.toLocalFile() }; + QFile localFBX { _fbxURL.toLocalFile() }; qDebug() << "Local file url: " << _fbxURL << _fbxURL.toString() << _fbxURL.toLocalFile() << ", copying to: " << _originalFBXFilePath; @@ -243,7 +243,7 @@ void FBXBaker::importScene() { void FBXBaker::rewriteAndBakeSceneModels() { unsigned int meshIndex = 0; - bool hasDeformers{ false }; + bool hasDeformers { false }; for (FBXNode& rootChild : _rootNode.children) { if (rootChild.name == "Objects") { for (FBXNode& objectChild : rootChild.children) { @@ -283,7 +283,7 @@ void FBXBaker::rewriteAndBakeSceneModels() { objectChild.children.push_back(dracoMeshNode); - static const std::vector nodeNamesToDelete{ + static const std::vector nodeNamesToDelete { // Node data that is packed into the draco mesh "Vertices", "PolygonVertexIndex", @@ -357,17 +357,20 @@ void FBXBaker::rewriteAndBakeSceneTextures() { for (FBXNode& textureChild : object->children) { if (textureChild.name == "RelativeFilename") { - QString fbxTextureFileName{ textureChild.properties.at(0).toByteArray() }; + QString fbxTextureFileName { textureChild.properties.at(0).toByteArray() }; + QFileInfo fbxTextureFileInfo { fbxTextureFileName.replace("\\", "/") }; + QByteArray textureContent = ""; - QFileInfo fbxTextureFileInfo{ fbxTextureFileName.replace("\\", "/") }; - // Callback to get texture content and type from FBXBaker in ModelBaker if (!fbxTextureFileInfo.filePath().isEmpty()) { textureContent = _textureContent.value(fbxTextureFileName.toLocal8Bit()); } + // Callback to get texture content and type getTextureContentTypeCallback textureContentTypeCallback = [=]() { QPair result; - result.first = textureContent;// _textureContent.value(fbxTextureFileName.toLocal8Bit()); + result.first = textureContent; + // grab the ID for this texture so we can figure out the + // texture type from the loaded materials auto textureID{ object->properties[0].toByteArray() }; auto textureType = textureTypes[textureID]; result.second = textureType; @@ -375,7 +378,8 @@ void FBXBaker::rewriteAndBakeSceneTextures() { }; // Compress the texture information and return the new filename to be added into the FBX scene - QByteArray* bakedTextureFile = this->compressTexture(fbxTextureFileName, _fbxURL, _bakedOutputDir, _textureThreadGetter, textureContentTypeCallback, _originalOutputDir); + QByteArray* bakedTextureFile = this->compressTexture(fbxTextureFileName, _fbxURL, _bakedOutputDir, _textureThreadGetter, + textureContentTypeCallback, _originalOutputDir); // If no errors or warnings have occurred during texture compression add the filename to the FBX scene if (bakedTextureFile) { diff --git a/libraries/baking/src/FBXBaker.h b/libraries/baking/src/FBXBaker.h index b76d3699b5..d0f95beebf 100644 --- a/libraries/baking/src/FBXBaker.h +++ b/libraries/baking/src/FBXBaker.h @@ -47,7 +47,7 @@ public slots: signals: void sourceCopyReadyToLoad(); - private slots: +private slots: void bakeSourceCopy(); void handleFBXNetworkReply(); @@ -86,7 +86,7 @@ private: TextureBakerThreadGetter _textureThreadGetter; - bool _pendingErrorEmission{ false }; + bool _pendingErrorEmission { false }; }; #endif // hifi_FBXBaker_h diff --git a/tools/oven/src/ui/ModelBakeWidget.cpp b/tools/oven/src/ui/ModelBakeWidget.cpp index 99727b0df6..0bef9f9414 100644 --- a/tools/oven/src/ui/ModelBakeWidget.cpp +++ b/tools/oven/src/ui/ModelBakeWidget.cpp @@ -164,7 +164,7 @@ void ModelBakeWidget::bakeButtonClicked() { // split the list from the model line edit to see how many models we need to bake auto fileURLStrings = _modelLineEdit->text().split(','); - foreach(QString fileURLString, fileURLStrings) { + foreach (QString fileURLString, fileURLStrings) { // construct a URL from the path in the model file text box QUrl modelToBakeURL(fileURLString); diff --git a/tools/oven/src/ui/ModelBakeWidget.h b/tools/oven/src/ui/ModelBakeWidget.h index e91e5655c6..02e7dde660 100644 --- a/tools/oven/src/ui/ModelBakeWidget.h +++ b/tools/oven/src/ui/ModelBakeWidget.h @@ -54,4 +54,4 @@ private: bool _isFBX = false; }; -#endif // hifi_ModelBakeWidget_h \ No newline at end of file +#endif // hifi_ModelBakeWidget_h