mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-26 21:38:47 +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);
|
FbxFileTexture* fileTexture = property.GetSrcObject<FbxFileTexture>(j);
|
||||||
|
|
||||||
// use QFileInfo to easily split up the existing texture filename into its components
|
// use QFileInfo to easily split up the existing texture filename into its components
|
||||||
QString fbxFileName { fileTexture->GetFileName() };
|
QString fbxTextureFileName { fileTexture->GetFileName() };
|
||||||
QFileInfo textureFileInfo { fbxFileName.replace("\\", "/") };
|
QFileInfo textureFileInfo { fbxTextureFileName.replace("\\", "/") };
|
||||||
|
|
||||||
// make sure this texture points to something and isn't one we've already re-mapped
|
// make sure this texture points to something and isn't one we've already re-mapped
|
||||||
if (!textureFileInfo.filePath().isEmpty()
|
if (!textureFileInfo.filePath().isEmpty()
|
||||||
|
@ -372,6 +372,9 @@ void FBXBaker::rewriteAndBakeSceneTextures() {
|
||||||
qCDebug(model_baking).noquote() << "Re-mapping" << fileTexture->GetFileName()
|
qCDebug(model_baking).noquote() << "Re-mapping" << fileTexture->GetFileName()
|
||||||
<< "to" << bakedTextureFilePath;
|
<< "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
|
// write the new filename into the FBX scene
|
||||||
fileTexture->SetFileName(bakedTextureFilePath.toLocal8Bit());
|
fileTexture->SetFileName(bakedTextureFilePath.toLocal8Bit());
|
||||||
|
|
||||||
|
@ -379,9 +382,6 @@ void FBXBaker::rewriteAndBakeSceneTextures() {
|
||||||
// be right beside the FBX
|
// be right beside the FBX
|
||||||
fileTexture->SetRelativeFileName(bakedTextureFileName.toLocal8Bit().constData());
|
fileTexture->SetRelativeFileName(bakedTextureFileName.toLocal8Bit().constData());
|
||||||
|
|
||||||
// figure out the URL to this texture, embedded or external
|
|
||||||
auto urlToTexture = getTextureURL(textureFileInfo, fileTexture);
|
|
||||||
|
|
||||||
if (!_bakingTextures.contains(urlToTexture)) {
|
if (!_bakingTextures.contains(urlToTexture)) {
|
||||||
// bake this texture asynchronously
|
// bake this texture asynchronously
|
||||||
bakeTexture(urlToTexture, textureType, _uniqueOutputPath + BAKED_OUTPUT_SUBFOLDER);
|
bakeTexture(urlToTexture, textureType, _uniqueOutputPath + BAKED_OUTPUT_SUBFOLDER);
|
||||||
|
|
Loading…
Reference in a new issue