1
0
mirror of https://github.com/DarklightGames/io_scene_psk_psa.git synced 2024-12-18 01:05:57 +01:00

Now using shade_smooth to smoothshade imported meshes (same as it did in the pre 4.0 versions)

This commit is contained in:
Colin Basnett 2023-11-14 00:50:20 -08:00
parent c8e5b8eb47
commit 9fe5aa0388

View File

@ -222,11 +222,13 @@ def import_psk(psk: Psk, context, options: PskImportOptions) -> PskImportResult:
# VERTEX NORMALS # VERTEX NORMALS
if psk.has_vertex_normals and options.should_import_vertex_normals: if psk.has_vertex_normals and options.should_import_vertex_normals:
mesh_data.polygons.foreach_set("use_smooth", [True] * len(mesh_data.polygons)) mesh_data.polygons.foreach_set('use_smooth', [True] * len(mesh_data.polygons))
normals = [] normals = []
for vertex_normal in psk.vertex_normals: for vertex_normal in psk.vertex_normals:
normals.append(tuple(vertex_normal)) normals.append(tuple(vertex_normal))
mesh_data.normals_split_custom_set_from_vertices(normals) mesh_data.normals_split_custom_set_from_vertices(normals)
else:
mesh_data.shade_smooth()
bm.normal_update() bm.normal_update()
bm.free() bm.free()