Limit convex and primitive methods of export physx asset to one material
This commit is contained in:
@@ -794,6 +794,9 @@ namespace PhysX
|
||||
);
|
||||
}
|
||||
|
||||
// Convex and primitive methods can only have 1 material
|
||||
const bool limitToOneMaterial = pxMeshGroup.GetExportAsConvex() || pxMeshGroup.GetExportAsPrimitive();
|
||||
|
||||
for (AZ::u32 faceIndex = 0; faceIndex < faceCount; ++faceIndex)
|
||||
{
|
||||
AZStd::string materialName = DefaultMaterialName;
|
||||
@@ -810,6 +813,14 @@ namespace PhysX
|
||||
}
|
||||
|
||||
materialName = localFbxMaterialsList[materialId];
|
||||
|
||||
// Keep using the first material when it has to be limited to one.
|
||||
if (limitToOneMaterial &&
|
||||
assetMaterialData.m_fbxMaterialNames.size() == 1 &&
|
||||
assetMaterialData.m_fbxMaterialNames[0] != materialName)
|
||||
{
|
||||
materialName = assetMaterialData.m_fbxMaterialNames[0];
|
||||
}
|
||||
}
|
||||
|
||||
const AZ::SceneAPI::DataTypes::IMeshData::Face& face = nodeMesh->GetFaceInfo(faceIndex);
|
||||
|
||||
Reference in New Issue
Block a user