Merge pull request #16159 from sabrina-shanman/oven_stall

(BUGZ-143) Fix Oven not finishing when Re-bake originals checked
This commit is contained in:
Sabrina Shanman 2019-09-09 13:12:49 -07:00 committed by GitHub
commit 3c35433f86
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 3 deletions

View file

@ -45,6 +45,7 @@
#include <QJsonArray>
ModelBaker::ModelBaker(const QUrl& inputModelURL, const QString& bakedOutputDirectory, const QString& originalOutputDirectory, bool hasBeenBaked) :
_originalInputModelURL(inputModelURL),
_modelURL(inputModelURL),
_bakedOutputDir(bakedOutputDirectory),
_originalOutputDir(originalOutputDirectory),

View file

@ -51,6 +51,7 @@ public:
virtual void setWasAborted(bool wasAborted) override;
QUrl getModelURL() const { return _modelURL; }
QUrl getOriginalInputModelURL() const { return _originalInputModelURL; }
virtual QUrl getFullOutputMappingURL() const;
QUrl getBakedModelURL() const { return _bakedModelURL; }
@ -67,6 +68,7 @@ protected:
void exportScene();
FBXNode _rootNode;
QUrl _originalInputModelURL;
QUrl _modelURL;
QUrl _outputURLSuffix;
QUrl _mappingURL;

View file

@ -250,6 +250,7 @@ void TextureBaker::processTexture() {
QFile file { _metaTextureFileName };
if (!file.open(QIODevice::WriteOnly) || file.write(data) == -1) {
handleError("Could not write meta texture for " + _textureURL.toString());
return;
} else {
_outputFiles.push_back(_metaTextureFileName);
}

View file

@ -445,7 +445,7 @@ void DomainBaker::handleFinishedModelBaker() {
// enumerate the QJsonRef values for the URL of this model from our multi hash of
// entity objects needing a URL re-write
for (auto propertyEntityPair : _entitiesNeedingRewrite.values(baker->getModelURL())) {
for (auto propertyEntityPair : _entitiesNeedingRewrite.values(baker->getOriginalInputModelURL())) {
QString property = propertyEntityPair.first;
// convert the entity QJsonValueRef to a QJsonObject so we can modify its URL
auto entity = propertyEntityPair.second.toObject();
@ -485,10 +485,10 @@ void DomainBaker::handleFinishedModelBaker() {
}
// remove the baked URL from the multi hash of entities needing a re-write
_entitiesNeedingRewrite.remove(baker->getModelURL());
_entitiesNeedingRewrite.remove(baker->getOriginalInputModelURL());
// drop our shared pointer to this baker so that it gets cleaned up
_modelBakers.remove(baker->getModelURL());
_modelBakers.remove(baker->getOriginalInputModelURL());
// emit progress to tell listeners how many models we have baked
emit bakeProgress(++_completedSubBakes, _totalNumberOfSubBakes);