mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 13:49:46 +02:00
simplify fileOnUrl to always look right beside FBX
This commit is contained in:
parent
6006fa0fe1
commit
d2bea94768
1 changed files with 4 additions and 10 deletions
|
@ -460,17 +460,11 @@ FBXLight extractLight(const FBXNode& object) {
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray fileOnUrl(const QByteArray& filepath, const QString& url) {
|
QByteArray fileOnUrl(const QByteArray& filepath, const QString& url) {
|
||||||
QString path = QFileInfo(url).path();
|
// in order to match the behaviour when loading models from remote URLs
|
||||||
QByteArray filename = filepath;
|
// we assume that all external textures are right beside the loaded model
|
||||||
QFileInfo checkFile(path + "/" + filepath);
|
// ignoring any relative paths or absolute paths inside of models
|
||||||
|
|
||||||
// check if the file exists at the RelativeFilename
|
return filepath.mid(filepath.lastIndexOf('/') + 1);
|
||||||
if (!(checkFile.exists() && checkFile.isFile())) {
|
|
||||||
// if not, assume it is in the fbx directory
|
|
||||||
filename = filename.mid(filename.lastIndexOf('/') + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
return filename;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FBXGeometry* FBXReader::extractFBXGeometry(const QVariantHash& mapping, const QString& url) {
|
FBXGeometry* FBXReader::extractFBXGeometry(const QVariantHash& mapping, const QString& url) {
|
||||||
|
|
Loading…
Reference in a new issue