Merge branch 'master' into 21369

This commit is contained in:
NeetBhagat 2017-06-13 11:01:22 +05:30
commit 5df3b88c85

View file

@ -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) {