Skip to content

Commit

Permalink
fix meshfilecopy wrong slash
Browse files Browse the repository at this point in the history
  • Loading branch information
JMPZ11 committed Jun 23, 2024
1 parent 65b7723 commit ec7ab09
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/spells/meshfilecopy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,12 @@ void spResourceCopy::copyPaths(NifModel* nif, NifItem* item, const QString& auth
if (mesh) {
// The nif field doesn't include the .mesh extension, and always uses a forward slash
QString meshPath = nif->get<QString>(mesh, "Mesh Path");
// Not using QDir because file as stored uses forward slashes and no extension
QString newMeshPath = author + "/" + project + "/" + sanitizeFileName(objectName) + "_lod" + QString::number(i + 1);
// Not using QDir because file as stored uses back slashes and no extension
QString newMeshPath = (author + "\\" + project + "\\" + sanitizeFileName(objectName) + "_lod" + QString::number(i + 1)).toLower();

// Convert paths to absolute using nifFolder as root
QString oldPath = QDir(nifFolder).filePath("geometries/" + meshPath + ".mesh");
QString newPath = QDir(nifFolder).filePath("geometries/" + newMeshPath + ".mesh");
QString oldPath = QDir(nifFolder).filePath("geometries\\" + meshPath + ".mesh");
QString newPath = QDir(nifFolder).filePath("geometries\\" + newMeshPath + ".mesh");

// Create the directory for the new path if it doesn't exist
QDir newDir = QFileInfo(newPath).absoluteDir();
Expand Down Expand Up @@ -169,7 +169,7 @@ QModelIndex spResourceCopy::cast(NifModel* nif, const QModelIndex& index)
QDialog dlg;
QLabel* lb = new QLabel(&dlg);
lb->setAlignment(Qt::AlignCenter);
lb->setText(tr("Copy and rename meshes to this format:\ngeometries/author/project/objectname_lod#"));
lb->setText(tr("Copy and rename meshes to this format:\ngeometries\\author\\project\\objectname_lod#"));

QLabel* lb1 = new QLabel(&dlg);
lb1->setText(tr("Author Prefix:"));
Expand Down

0 comments on commit ec7ab09

Please sign in to comment.