Skip to content

Commit

Permalink
*Actually* fixed the smoothing group problem!
Browse files Browse the repository at this point in the history
  • Loading branch information
cmbasnett committed Apr 2, 2021
1 parent 7d723fe commit b0aa604
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def build(self, context, options: ASEBuilderOptions):

mesh_data.calc_loop_triangles()
mesh_data.calc_normals_split()
poly_groups, groups = mesh_data.calc_smooth_groups(use_bitflags=True)
poly_groups, groups = mesh_data.calc_smooth_groups(use_bitflags=False)

# Faces
for face_index, loop_triangle in enumerate(mesh_data.loop_triangles):
Expand All @@ -67,7 +67,9 @@ def build(self, context, options: ASEBuilderOptions):
face.c = geometry_object.vertex_offset + mesh_data.loops[loop_triangle.loops[2]].vertex_index
if not geometry_object.is_collision:
face.material_index = material_indices[loop_triangle.material_index]
face.smoothing = poly_groups[loop_triangle.polygon_index]
# The UT2K4 importer only accepts 32 smoothing groups. Anything past this completely mangles the
# smoothing groups and effectively makes the whole model use sharp-edge rendering.
face.smoothing = (poly_groups[loop_triangle.polygon_index] - 1) % 32
geometry_object.faces.append(face)

# Normals
Expand Down
Binary file added src/io_scene_ase-main-1.0.1.zip
Binary file not shown.

0 comments on commit b0aa604

Please sign in to comment.