Skip to content

Commit

Permalink
Merge pull request #2419 from merwaaan/fix-fbx-face-material
Browse files Browse the repository at this point in the history
Fix FBX face materials not being properly loaded if the face count mi…
  • Loading branch information
kimkulling committed Apr 16, 2019
2 parents 5bf096a + 685a562 commit 36bce5f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions code/FBXMeshGeometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -630,10 +630,11 @@ void MeshGeometry::ReadVertexDataMaterials(std::vector<int>& materials_out, cons
materials_out.clear();
}

m_materials.assign(m_vertices.size(),materials_out[0]);
materials_out.resize(m_vertices.size());
std::fill(materials_out.begin(), materials_out.end(), materials_out.at(0));
}
else if (MappingInformationType == "ByPolygon" && ReferenceInformationType == "IndexToDirect") {
m_materials.resize(face_count);
materials_out.resize(face_count);

if(materials_out.size() != face_count) {
FBXImporter::LogError(Formatter::format("length of input data unexpected for ByPolygon mapping: ")
Expand Down

0 comments on commit 36bce5f

Please sign in to comment.