mirror of
https://github.com/lubosz/overte.git
synced 2025-04-09 01:22:36 +02:00
Merge pull request #15396 from SamGondelman/oven2
Case 22244: Fix oven crash (RC83)
This commit is contained in:
commit
2604afa454
2 changed files with 12 additions and 3 deletions
|
@ -104,13 +104,15 @@ void FBXBaker::rewriteAndBakeSceneModels(const QVector<hfm::Mesh>& meshes, const
|
|||
int meshIndex = 0;
|
||||
for (FBXNode& rootChild : _rootNode.children) {
|
||||
if (rootChild.name == "Objects") {
|
||||
for (auto object = rootChild.children.begin(); object != rootChild.children.end(); object++) {
|
||||
auto object = rootChild.children.begin();
|
||||
while (object != rootChild.children.end()) {
|
||||
if (object->name == "Geometry") {
|
||||
if (object->properties.at(2) == "Mesh") {
|
||||
int meshNum = meshIndexToRuntimeOrder[meshIndex];
|
||||
replaceMeshNodeWithDraco(*object, dracoMeshes[meshNum], dracoMaterialLists[meshNum]);
|
||||
meshIndex++;
|
||||
}
|
||||
object++;
|
||||
} else if (object->name == "Model") {
|
||||
for (FBXNode& modelChild : object->children) {
|
||||
if (modelChild.name == "Properties60" || modelChild.name == "Properties70") {
|
||||
|
@ -136,9 +138,12 @@ void FBXBaker::rewriteAndBakeSceneModels(const QVector<hfm::Mesh>& meshes, const
|
|||
meshIndex++;
|
||||
}
|
||||
}
|
||||
object++;
|
||||
} else if (object->name == "Texture" || object->name == "Video") {
|
||||
// this is an embedded texture, we need to remove it from the FBX
|
||||
object = rootChild.children.erase(object);
|
||||
} else {
|
||||
object++;
|
||||
}
|
||||
|
||||
if (hasErrors()) {
|
||||
|
|
|
@ -1572,9 +1572,13 @@ void Model::applyMaterialMapping() {
|
|||
|
||||
auto& materialMapping = getMaterialMapping();
|
||||
for (auto& mapping : materialMapping) {
|
||||
std::set<unsigned int> shapeIDs = getMeshIDsFromMaterialID(QString(mapping.first.c_str()));
|
||||
auto networkMaterialResource = mapping.second;
|
||||
if (!networkMaterialResource || shapeIDs.size() == 0) {
|
||||
if (!networkMaterialResource) {
|
||||
continue;
|
||||
}
|
||||
|
||||
std::set<unsigned int> shapeIDs = getMeshIDsFromMaterialID(QString(mapping.first.c_str()));
|
||||
if (shapeIDs.size() == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue