From d6366083a7ff1b00d3f531f1b4297beb4dd1f290 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Thu, 12 Oct 2017 18:29:11 -0700 Subject: [PATCH 1/3] Fix baking bug with single-part FBX + multiple materials In FBXBaker we were not packing in material IDs if there was only 1 part in the mesh. This was unintentionally making the assumption that there was only 1 material at index 0 - if there are more materials, the material index that the part references may not be 0. The change ensures that we pack material IDs if there are multiple parts or if the sole part uses a material ID other than 0 (0 is the default). --- libraries/baking/src/FBXBaker.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/baking/src/FBXBaker.cpp b/libraries/baking/src/FBXBaker.cpp index 017f11c680..140b7867dc 100644 --- a/libraries/baking/src/FBXBaker.cpp +++ b/libraries/baking/src/FBXBaker.cpp @@ -377,7 +377,8 @@ void FBXBaker::rewriteAndBakeSceneModels() { bool hasColors { mesh.colors.size() > 0 }; bool hasTexCoords { mesh.texCoords.size() > 0 }; bool hasTexCoords1 { mesh.texCoords1.size() > 0 }; - bool hasPerFaceMaterials { mesh.parts.size() > 1 }; + bool hasPerFaceMaterials { mesh.parts.size() > 1 + || extractedMesh.partMaterialTextures[0].first != 0 }; bool needsOriginalIndices { hasDeformers }; int normalsAttributeID { -1 }; From dabfec94367c41b183fb7a5914ea4d0d18fe2c60 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Mon, 9 Oct 2017 10:58:58 -0700 Subject: [PATCH 2/3] ignore unbakeable textures in FBX files --- libraries/baking/src/FBXBaker.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libraries/baking/src/FBXBaker.cpp b/libraries/baking/src/FBXBaker.cpp index 017f11c680..e4d7f6bbc9 100644 --- a/libraries/baking/src/FBXBaker.cpp +++ b/libraries/baking/src/FBXBaker.cpp @@ -594,6 +594,10 @@ void FBXBaker::rewriteAndBakeSceneTextures() { QString fbxTextureFileName { textureChild.properties.at(0).toByteArray() }; QFileInfo textureFileInfo { fbxTextureFileName.replace("\\", "/") }; + if (hasErrors()) { + return; + } + if (textureFileInfo.suffix() == BAKED_TEXTURE_EXT.mid(1)) { // re-baking an FBX that already references baked textures is a fail // so we add an error and return from here @@ -602,6 +606,11 @@ void FBXBaker::rewriteAndBakeSceneTextures() { return; } + if (!TextureBaker::getSupportedFormats().contains(textureFileInfo.suffix())) { + // this is a texture format we don't bake, skip it + handleWarning(fbxTextureFileName + " is not a bakeable texture format"); + continue; + } // make sure this texture points to something and isn't one we've already re-mapped if (!textureFileInfo.filePath().isEmpty()) { From f2ad61934b597064e5bfb3cd3007b3e566412998 Mon Sep 17 00:00:00 2001 From: druiz17 Date: Thu, 19 Oct 2017 14:02:21 -0700 Subject: [PATCH 3/3] fix toolbar from completely dispearing --- interface/resources/qml/hifi/toolbars/Toolbar.qml | 5 ++--- interface/resources/qml/windows/Fadable.qml | 7 +------ 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/interface/resources/qml/hifi/toolbars/Toolbar.qml b/interface/resources/qml/hifi/toolbars/Toolbar.qml index 4710fa3256..01aa29f665 100644 --- a/interface/resources/qml/hifi/toolbars/Toolbar.qml +++ b/interface/resources/qml/hifi/toolbars/Toolbar.qml @@ -19,7 +19,6 @@ Window { shown: true width: content.width height: content.height - disableFade: true // Disable this window from being able to call 'desktop.raise() and desktop.showDesktop' activator: Item {} property bool horizontal: true @@ -127,7 +126,7 @@ Window { sortButtons(); - shown = true; + fadeIn(null); return result; } @@ -143,7 +142,7 @@ Window { buttons.splice(index, 1); if (buttons.length === 0) { - shown = false; + fadeOut(null); } } } diff --git a/interface/resources/qml/windows/Fadable.qml b/interface/resources/qml/windows/Fadable.qml index 6bbd1edcac..4d506755f2 100644 --- a/interface/resources/qml/windows/Fadable.qml +++ b/interface/resources/qml/windows/Fadable.qml @@ -36,9 +36,6 @@ FocusScope { // Some dialogs should be destroyed when they become // invisible, so handle that onVisibleChanged: { - if (disableFade) { - return; - } // If someone directly set the visibility to false // toggle it back on and use the targetVisible flag to transition // via fading. @@ -66,9 +63,7 @@ FocusScope { } onFadeTargetPropertyChanged: { - if (!disableFade) { - visible = (fadeTargetProperty != 0.0); - } + visible = (fadeTargetProperty != 0.0); } function fadeIn(callback) {