blender-to-gmstudio / blender-to-smf

Import-Export of Blender model from/to SMF model format
MIT License
11 stars 2 forks source link

Exporting a model with multiple materials doesn't seem to maintain correct normals #13

Closed bartteunis closed 2 years ago

bartteunis commented 3 years ago

This is when splitting by material first. The resulting meshes seem to loose normal info

bartteunis commented 2 years ago

Normal info can't be lost when there is no need to split by material to begin with. Change the vertex buffer export code to loop through a Blender 'MESH' object's materials first, then through the mesh's polygons that use that material (use MeshPolygon.material_index). Doing it this way should preserve the normal data.