mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 16:41:02 +02:00
Read resources from other than the main directory
This commit is contained in:
parent
c8addd0581
commit
d9b136cf5d
1 changed files with 5 additions and 4 deletions
|
@ -935,7 +935,7 @@ FBXGeometry* GLTFReader::readGLTF(QByteArray& model, const QVariantHash& mapping
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GLTFReader::readBinary(const QString& url, QByteArray& outdata) {
|
bool GLTFReader::readBinary(const QString& url, QByteArray& outdata) {
|
||||||
QUrl binaryUrl = _url.resolved(QUrl(url).fileName());
|
QUrl binaryUrl = _url.resolved(url);
|
||||||
|
|
||||||
qCDebug(modelformat) << "binaryUrl: " << binaryUrl << " OriginalUrl: " << _url;
|
qCDebug(modelformat) << "binaryUrl: " << binaryUrl << " OriginalUrl: " << _url;
|
||||||
bool success;
|
bool success;
|
||||||
|
@ -948,7 +948,7 @@ bool GLTFReader::doesResourceExist(const QString& url) {
|
||||||
if (_url.isEmpty()) {
|
if (_url.isEmpty()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
QUrl candidateUrl = _url.resolved(QUrl(url).fileName());
|
QUrl candidateUrl = _url.resolved(url);
|
||||||
return DependencyManager::get<ResourceManager>()->resourceExists(candidateUrl);
|
return DependencyManager::get<ResourceManager>()->resourceExists(candidateUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1001,8 +1001,9 @@ FBXTexture GLTFReader::getFBXTexture(const GLTFTexture& texture) {
|
||||||
fbxtex.texcoordSet = 0;
|
fbxtex.texcoordSet = 0;
|
||||||
|
|
||||||
if (texture.defined["source"]) {
|
if (texture.defined["source"]) {
|
||||||
QString fname = QUrl(_file.images[texture.source].uri).fileName();
|
QString url = _file.images[texture.source].uri;
|
||||||
QUrl textureUrl = _url.resolved(fname);
|
QString fname = QUrl(url).fileName();
|
||||||
|
QUrl textureUrl = _url.resolved(url);
|
||||||
qCDebug(modelformat) << "fname: " << fname;
|
qCDebug(modelformat) << "fname: " << fname;
|
||||||
qCDebug(modelformat) << "textureUrl: " << textureUrl;
|
qCDebug(modelformat) << "textureUrl: " << textureUrl;
|
||||||
qCDebug(modelformat) << "Url: " << _url;
|
qCDebug(modelformat) << "Url: " << _url;
|
||||||
|
|
Loading…
Reference in a new issue