From 2d82607db9e206617dc924bda62752cd2fb0b537 Mon Sep 17 00:00:00 2001 From: c0rp3n's Den Date: Mon, 29 Apr 2019 23:23:21 +0100 Subject: [PATCH] Add support for smoothing groups These are auto generated by blender. Control should be through sharp edges and edge splits. --- io_scene_blam/export_model.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/io_scene_blam/export_model.py b/io_scene_blam/export_model.py index 9b7d82c..2f89ab4 100644 --- a/io_scene_blam/export_model.py +++ b/io_scene_blam/export_model.py @@ -127,6 +127,8 @@ def write_jms_model(context, filepath, # _must_ do this first since it re-allocs arrays mesh_triangulate(mesh) + smoothing_groups, group_count = mesh.calc_smooth_groups() + # Loop triangles for poly in mesh.polygons: # Vertices @@ -144,7 +146,7 @@ def write_jms_model(context, filepath, '{0[0]:0.6f}\t{0[1]:0.6f}\n'.format( # uv coordinates mesh.uv_layers.active.data[i].uv ) + - '0\n' # smoothing group + str(smoothing_groups[poly.index]) + '\n' # smoothing group ) # Triangles