Fix DomainBaker not finishing when Re-bake originals checked and

.baked.fbx present
This commit is contained in:
sabrina-shanman 2019-09-09 10:42:04 -07:00
parent 0a97f2535b
commit 01b29c3aac
3 changed files with 6 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

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