mirror of
https://github.com/lubosz/overte.git
synced 2025-04-08 14:22:38 +02:00
fix for baking FBX with external textures
This commit is contained in:
parent
fc8b7c7cc5
commit
bff54d260e
1 changed files with 5 additions and 5 deletions
|
@ -354,8 +354,8 @@ void FBXBaker::rewriteAndBakeSceneTextures() {
|
|||
FbxFileTexture* fileTexture = property.GetSrcObject<FbxFileTexture>(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);
|
||||
|
|
Loading…
Reference in a new issue