mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-15 10:17:40 +02:00
add special handling for abs drive letter paths from windows
This commit is contained in:
parent
70eada0f76
commit
e4021c168e
1 changed files with 9 additions and 1 deletions
|
@ -447,7 +447,15 @@ QByteArray fixedTextureFilepath(QByteArray fbxRelativeFilepath, QUrl url) {
|
|||
// first setup a QFileInfo for the passed relative filepath, with backslashes replaced by forward slashes
|
||||
auto fileInfo = QFileInfo { fbxRelativeFilepath.replace("\\", "/") };
|
||||
|
||||
if (fileInfo.isRelative()) {
|
||||
#ifndef Q_OS_WIN
|
||||
// it turns out that absolute windows paths starting with drive letters look like relative paths to QFileInfo on UNIX
|
||||
// so we add a check for that here to work around it
|
||||
bool isRelative = fbxRelativeFilepath[1] != ':' && fileInfo.isRelative();
|
||||
#else
|
||||
bool isRelative = fileInfo.isRelative();
|
||||
#endif
|
||||
|
||||
if (isRelative) {
|
||||
// the RelativeFilename pulled from the FBX is already correctly relative
|
||||
// so simply return this as the filepath to use
|
||||
return fbxRelativeFilepath;
|
||||
|
|
Loading…
Reference in a new issue