From bff54d260e4db966d34bfe32ed517c33bd7ffc2e Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Fri, 7 Jul 2017 10:11:13 -0700 Subject: [PATCH] fix for baking FBX with external textures --- tools/oven/src/FBXBaker.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/oven/src/FBXBaker.cpp b/tools/oven/src/FBXBaker.cpp index 8a72784d7c..0259a6baf8 100644 --- a/tools/oven/src/FBXBaker.cpp +++ b/tools/oven/src/FBXBaker.cpp @@ -354,8 +354,8 @@ void FBXBaker::rewriteAndBakeSceneTextures() { FbxFileTexture* fileTexture = property.GetSrcObject(j); // use QFileInfo to easily split up the existing texture filename into its components - QString fbxFileName { fileTexture->GetFileName() }; - QFileInfo textureFileInfo { fbxFileName.replace("\\", "/") }; + QString fbxTextureFileName { fileTexture->GetFileName() }; + QFileInfo textureFileInfo { fbxTextureFileName.replace("\\", "/") }; // make sure this texture points to something and isn't one we've already re-mapped if (!textureFileInfo.filePath().isEmpty() @@ -372,6 +372,9 @@ void FBXBaker::rewriteAndBakeSceneTextures() { qCDebug(model_baking).noquote() << "Re-mapping" << fileTexture->GetFileName() << "to" << bakedTextureFilePath; + // figure out the URL to this texture, embedded or external + auto urlToTexture = getTextureURL(textureFileInfo, fileTexture); + // write the new filename into the FBX scene fileTexture->SetFileName(bakedTextureFilePath.toLocal8Bit()); @@ -379,9 +382,6 @@ void FBXBaker::rewriteAndBakeSceneTextures() { // be right beside the FBX fileTexture->SetRelativeFileName(bakedTextureFileName.toLocal8Bit().constData()); - // figure out the URL to this texture, embedded or external - auto urlToTexture = getTextureURL(textureFileInfo, fileTexture); - if (!_bakingTextures.contains(urlToTexture)) { // bake this texture asynchronously bakeTexture(urlToTexture, textureType, _uniqueOutputPath + BAKED_OUTPUT_SUBFOLDER);