From dabfec94367c41b183fb7a5914ea4d0d18fe2c60 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Mon, 9 Oct 2017 10:58:58 -0700 Subject: [PATCH] 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()) {