Skip to content
This repository has been archived by the owner on Jan 3, 2022. It is now read-only.

Commit

Permalink
Add support for smoothing groups
Browse files Browse the repository at this point in the history
These are auto generated by blender.
Control should be through sharp edges and edge splits.
  • Loading branch information
c0rp3n committed Apr 29, 2019
1 parent dd78c19 commit 2d82607
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion io_scene_blam/export_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 2d82607

Please sign in to comment.