mirror of
https://github.com/lubosz/overte.git
synced 2025-04-19 17:03:43 +02:00
Fix baking bug with single-part FBX + multiple materials
In FBXBaker we were not packing in material IDs if there was only 1 part in the mesh. This was unintentionally making the assumption that there was only 1 material at index 0 - if there are more materials, the material index that the part references may not be 0. The change ensures that we pack material IDs if there are multiple parts or if the sole part uses a material ID other than 0 (0 is the default).
This commit is contained in:
parent
8a331e29a2
commit
d6366083a7
1 changed files with 2 additions and 1 deletions
|
@ -377,7 +377,8 @@ void FBXBaker::rewriteAndBakeSceneModels() {
|
|||
bool hasColors { mesh.colors.size() > 0 };
|
||||
bool hasTexCoords { mesh.texCoords.size() > 0 };
|
||||
bool hasTexCoords1 { mesh.texCoords1.size() > 0 };
|
||||
bool hasPerFaceMaterials { mesh.parts.size() > 1 };
|
||||
bool hasPerFaceMaterials { mesh.parts.size() > 1
|
||||
|| extractedMesh.partMaterialTextures[0].first != 0 };
|
||||
bool needsOriginalIndices { hasDeformers };
|
||||
|
||||
int normalsAttributeID { -1 };
|
||||
|
|
Loading…
Reference in a new issue