Import normal vertex buffers to correct inaccurate lighting in blender due to bad geometry

This commit is contained in:
Pyogenics
2025-04-06 19:47:12 +01:00
parent 79a6d9d786
commit 8a41d7a47a

View File

@@ -157,8 +157,16 @@ class A3DBlenderImporter:
me.polygons[faceI+faceIndexBase].material_index = submeshI
faceIndexBase += submesh.indexCount//3
# Finalise
#XXX: call this before we assign split normals, if you do not it causes a segmentation fault
me.validate()
# Split normals
if len(normal1) != 0:
me.normals_split_custom_set_from_vertices(normal1)
elif len(normal2) != 0:
me.normals_split_custom_set_from_vertices(normal2)
# Finalise
me.update()
return me