Update FBXMeshGeometry.cpp (#5624)
Some FBXs do not have "Materials" information, which can cause parsing errors Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>pull/5630/head^2
parent
77f7706a97
commit
0afd366dcb
|
@ -644,10 +644,12 @@ void MeshGeometry::ReadVertexDataMaterials(std::vector<int>& materials_out, cons
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// materials are handled separately. First of all, they are assigned per-face
|
if (source["Materials"]) {
|
||||||
// and not per polyvert. Secondly, ReferenceInformationType=IndexToDirect
|
// materials are handled separately. First of all, they are assigned per-face
|
||||||
// has a slightly different meaning for materials.
|
// and not per polyvert. Secondly, ReferenceInformationType=IndexToDirect
|
||||||
ParseVectorDataArray(materials_out,GetRequiredElement(source,"Materials"));
|
// has a slightly different meaning for materials.
|
||||||
|
ParseVectorDataArray(materials_out, GetRequiredElement(source, "Materials"));
|
||||||
|
}
|
||||||
|
|
||||||
if (MappingInformationType == "AllSame") {
|
if (MappingInformationType == "AllSame") {
|
||||||
// easy - same material for all faces
|
// easy - same material for all faces
|
||||||
|
|
Loading…
Reference in New Issue