mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 14:59:14 +02:00
Fix DomainBaker not outputting URLs relative to the Destination URL Path
This commit is contained in:
parent
f9f55f08db
commit
06d38bf8e7
1 changed files with 20 additions and 4 deletions
|
@ -425,10 +425,11 @@ void DomainBaker::handleFinishedModelBaker() {
|
||||||
qDebug() << "Re-writing entity references to" << baker->getModelURL();
|
qDebug() << "Re-writing entity references to" << baker->getModelURL();
|
||||||
|
|
||||||
// setup a new URL using the prefix we were passed
|
// setup a new URL using the prefix we were passed
|
||||||
auto relativeMappingFilePath = baker->getFullOutputMappingURL().toString().remove(_contentOutputPath);
|
auto relativeMappingFilePath = QDir(_contentOutputPath).relativeFilePath(baker->getFullOutputMappingURL().toString());
|
||||||
if (relativeMappingFilePath.startsWith("/")) {
|
if (relativeMappingFilePath.startsWith("/")) {
|
||||||
relativeMappingFilePath = relativeMappingFilePath.right(relativeMappingFilePath.length() - 1);
|
relativeMappingFilePath = relativeMappingFilePath.right(relativeMappingFilePath.length() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
QUrl newURL = _destinationPath.resolved(relativeMappingFilePath);
|
QUrl newURL = _destinationPath.resolved(relativeMappingFilePath);
|
||||||
|
|
||||||
// enumerate the QJsonRef values for the URL of this model from our multi hash of
|
// enumerate the QJsonRef values for the URL of this model from our multi hash of
|
||||||
|
@ -494,7 +495,12 @@ void DomainBaker::handleFinishedTextureBaker() {
|
||||||
// this TextureBaker is done and everything went according to plan
|
// this TextureBaker is done and everything went according to plan
|
||||||
qDebug() << "Re-writing entity references to" << baker->getTextureURL();
|
qDebug() << "Re-writing entity references to" << baker->getTextureURL();
|
||||||
|
|
||||||
auto newURL = _destinationPath.resolved(baker->getMetaTextureFileName());
|
// setup a new URL using the prefix we were passed
|
||||||
|
auto relativeTextureFilePath = QDir(_contentOutputPath).relativeFilePath(baker->getMetaTextureFileName());
|
||||||
|
if (relativeTextureFilePath.startsWith("/")) {
|
||||||
|
relativeTextureFilePath = relativeTextureFilePath.right(relativeTextureFilePath.length() - 1);
|
||||||
|
}
|
||||||
|
auto newURL = _destinationPath.resolved(relativeTextureFilePath);
|
||||||
|
|
||||||
// enumerate the QJsonRef values for the URL of this texture from our multi hash of
|
// enumerate the QJsonRef values for the URL of this texture from our multi hash of
|
||||||
// entity objects needing a URL re-write
|
// entity objects needing a URL re-write
|
||||||
|
@ -563,7 +569,12 @@ void DomainBaker::handleFinishedScriptBaker() {
|
||||||
// this JSBaker is done and everything went according to plan
|
// this JSBaker is done and everything went according to plan
|
||||||
qDebug() << "Re-writing entity references to" << baker->getJSPath();
|
qDebug() << "Re-writing entity references to" << baker->getJSPath();
|
||||||
|
|
||||||
auto newURL = _destinationPath.resolved(baker->getBakedJSFilePath());
|
// setup a new URL using the prefix we were passed
|
||||||
|
auto relativeScriptFilePath = QDir(_contentOutputPath).relativeFilePath(baker->getBakedJSFilePath());
|
||||||
|
if (relativeScriptFilePath.startsWith("/")) {
|
||||||
|
relativeScriptFilePath = relativeScriptFilePath.right(relativeScriptFilePath.length() - 1);
|
||||||
|
}
|
||||||
|
auto newURL = _destinationPath.resolved(relativeScriptFilePath);
|
||||||
|
|
||||||
// enumerate the QJsonRef values for the URL of this script from our multi hash of
|
// enumerate the QJsonRef values for the URL of this script from our multi hash of
|
||||||
// entity objects needing a URL re-write
|
// entity objects needing a URL re-write
|
||||||
|
@ -634,7 +645,12 @@ void DomainBaker::handleFinishedMaterialBaker() {
|
||||||
|
|
||||||
QString newDataOrURL;
|
QString newDataOrURL;
|
||||||
if (baker->isURL()) {
|
if (baker->isURL()) {
|
||||||
newDataOrURL = _destinationPath.resolved(baker->getBakedMaterialData()).toDisplayString();
|
// setup a new URL using the prefix we were passed
|
||||||
|
auto relativeMaterialFilePath = QDir(_contentOutputPath).relativeFilePath(baker->getBakedMaterialData());
|
||||||
|
if (relativeMaterialFilePath.startsWith("/")) {
|
||||||
|
relativeMaterialFilePath = relativeMaterialFilePath.right(relativeMaterialFilePath.length() - 1);
|
||||||
|
}
|
||||||
|
newDataOrURL = _destinationPath.resolved(relativeMaterialFilePath).toDisplayString();
|
||||||
} else {
|
} else {
|
||||||
newDataOrURL = baker->getBakedMaterialData();
|
newDataOrURL = baker->getBakedMaterialData();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue