From a2eb9587c151852d9b0a08040e00b34d754e6e8c Mon Sep 17 00:00:00 2001 From: Jason Shuler Date: Tue, 18 Jun 2024 13:26:59 -0400 Subject: [PATCH] fixed so files are actually copied --- src/spells/meshfilecopy.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/spells/meshfilecopy.cpp b/src/spells/meshfilecopy.cpp index bbe08a5e..9bdf22b7 100644 --- a/src/spells/meshfilecopy.cpp +++ b/src/spells/meshfilecopy.cpp @@ -130,13 +130,15 @@ void spResourceCopy::copyPaths(NifModel* nif, NifItem* item, const QString& auth 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(); + newDir.mkpath(newDir.absolutePath()); + // Copy the file (platform-independent with the slashes) QFile::copy(QDir::fromNativeSeparators(oldPath), QDir::fromNativeSeparators(newPath)); // Update the value in the nif findChildByName(mesh,"Mesh Path")->setValueFromString(newMeshPath); - //nif->set(mesh,"Mesh Path",newMeshPath); - //mesh->setValueFromString(newMeshPath); } } }