Baking - if mesh extraction or compression fails don't change node

Needed to prevent a null (would-be Draco mesh) node being added.
This commit is contained in:
Simon Walton 2018-05-08 13:59:38 -07:00
parent 37ead11cf9
commit 82e43aea11
2 changed files with 31 additions and 31 deletions

View file

@ -257,8 +257,7 @@ void FBXBaker::rewriteAndBakeSceneModels() {
} else if (hasWarnings()) {
continue;
}
}
} else {
objectChild.children.push_back(dracoMeshNode);
static const std::vector<QString> nodeNamesToDelete {
@ -289,7 +288,9 @@ void FBXBaker::rewriteAndBakeSceneModels() {
}
}
}
}
} // Geometry Object
} // foreach root child
}
}
}

View file

@ -62,8 +62,7 @@ QByteArray FBXWriter::encodeFBX(const FBXNode& root) {
out.setVersion(QDataStream::Qt_4_5);
out.writeRawData(FBX_BINARY_PROLOG, FBX_BINARY_PROLOG.size());
auto bytes = QByteArray(FBX_HEADER_BYTES_BEFORE_VERSION - FBX_BINARY_PROLOG.size(), '\0');
out.writeRawData(bytes, bytes.size());
out.writeRawData("\0\x1a", 3); // Blender needs this header component.
#ifdef USE_FBX_2016_FORMAT
out << FBX_VERSION_2016;