When a user assigns the same material to multiple material slots, the previous logic would use the same name for all of them, and therefore overwrite the exported mesh file repeatedly. Only the mesh part that appeared last in the materials slot list would remain.
This PR ensures that unique names are used for the output meshes.
When a user assigns the same material to multiple material slots, the previous logic would use the same name for all of them, and therefore overwrite the exported mesh file repeatedly. Only the mesh part that appeared last in the materials slot list would remain. This PR ensures that unique names are used for the output meshes.