Skip to content

Commit

Permalink
Work-around for MakeUniqueFilenames failing (needs hash function)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbui78 committed Oct 21, 2023
1 parent fc2e32a commit c9a1eb6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/DzBridgeAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2375,6 +2375,17 @@ QString DzBridgeAction::exportAssetWithDtu(QString sFilename, QString sAssetMate

QString exportPath = this->m_sRootFolder.replace("\\","/") + "/" + this->m_sExportSubfolder.replace("\\", "/");
QString fileStem = QFileInfo(sFilename).fileName();
// DB 2023-Oct-20: FIX for non-unique filenames
if (isTemporaryFile(sFilename) == false)
{
QStringList filePathArray = cleanedFilename.replace(" ", "").split("/");
int len = filePathArray.count();
for (int i = 2; i < 5; i++)
{
if (i > len) break;
fileStem = filePathArray[len - i] + "_" + fileStem;
}
}

exportPath += "/ExportTextures/";
QDir().mkpath(exportPath);
Expand Down

0 comments on commit c9a1eb6

Please sign in to comment.