mirror of
https://github.com/MapMakersAndProgrammers/io_scene_a3d.git
synced 2025-10-26 01:49:13 -07:00
Import normal vertex buffers to correct inaccurate lighting in blender due to bad geometry
This commit is contained in:
@@ -157,8 +157,16 @@ class A3DBlenderImporter:
|
|||||||
me.polygons[faceI+faceIndexBase].material_index = submeshI
|
me.polygons[faceI+faceIndexBase].material_index = submeshI
|
||||||
faceIndexBase += submesh.indexCount//3
|
faceIndexBase += submesh.indexCount//3
|
||||||
|
|
||||||
# Finalise
|
#XXX: call this before we assign split normals, if you do not it causes a segmentation fault
|
||||||
me.validate()
|
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()
|
me.update()
|
||||||
return me
|
return me
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user