From f0eb1341c0e54ff2dd4dc6b335fd9dcab8035a57 Mon Sep 17 00:00:00 2001 From: ousnius Date: Sun, 16 Aug 2015 23:37:02 +0200 Subject: [PATCH] Fix for texture paths with backslash at front --- NifFile.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/NifFile.cpp b/NifFile.cpp index de89e7cf..cbf2b7ff 100644 --- a/NifFile.cpp +++ b/NifFile.cpp @@ -537,6 +537,7 @@ void NifFile::TrimTexturePaths() { for (int i = 0; i < 9; i++) { if (GetTextureForShape(s, tFile, i) && !tFile.empty()) { tFile = regex_replace(tFile, regex("/+|\\\\+"), "\\"); // Replace multiple slashes or forward slashes with one backslash + tFile = regex_replace(tFile, regex("^\\\\+", regex_constants::icase), ""); // Remove all backslashes from the front tFile = regex_replace(tFile, regex(".*?Data\\\\", regex_constants::icase), ""); // Remove everything before and including the data path root tFile = regex_replace(tFile, regex("^(?!^textures\\\\)", regex_constants::icase), "textures\\"); // Add textures root path if not existing SetTextureForShape(s, tFile, i);