add embedded media folder removal to FBXBaker

This commit is contained in:
Stephen Birarda 2017-04-05 17:12:29 -07:00
parent 6af7ecf47b
commit c9bc22334f
2 changed files with 11 additions and 1 deletions

View file

@ -148,7 +148,7 @@ void FBXBaker::bake() {
// (4) enumerate the collected texture paths and bake the textures
// a failure at any step along the way stops the chain
importScene() && rewriteAndCollectSceneTextures() && exportScene() && bakeTextures();
importScene() && rewriteAndCollectSceneTextures() && exportScene() && bakeTextures() && removeEmbeddedMediaFolder();
// emit a signal saying that we are done, with whatever errors were produced
emit finished();
@ -316,3 +316,12 @@ bool FBXBaker::bakeTextures() {
return true;
}
bool FBXBaker::removeEmbeddedMediaFolder() {
// now that the bake is complete, remove the embedded media folder produced by the FBX SDK when it imports an FBX
auto embeddedMediaFolderName = _fbxURL.fileName().replace(".fbx", ".fbm");
QDir(_uniqueOutputPath + ORIGINAL_OUTPUT_SUBFOLDER + embeddedMediaFolderName).removeRecursively();
// we always return true because a failure to delete the embedded media folder is not a failure of the bake
return true;
}

View file

@ -49,6 +49,7 @@ private:
bool exportScene();
bool bakeTextures();
bool bakeTexture();
bool removeEmbeddedMediaFolder();
QString pathToCopyOfOriginal() const;