Skip to content

Commit

Permalink
Fix lightmap UVs
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Garcia committed Dec 11, 2023
1 parent 7ae3666 commit 6b1a453
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions io_scene_halo/file_tag/build_scene/build_lightmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ def process_mesh(SBSP_ASSET, random_color_gen, tag_block, poop_name, material_co
for poly in mesh.polygons:
poly.use_smooth = True

mesh.normals_split_custom_set_from_vertices([vertex.normal for vertex in vertices])
mesh.use_auto_smooth = True
#mesh.normals_split_custom_set_from_vertices([vertex.normal for vertex in vertices])
#mesh.use_auto_smooth = True

uv_name = 'UVMap_%s' % 0
layer_uv = mesh.uv_layers.get(uv_name)
Expand All @@ -99,7 +99,7 @@ def process_mesh(SBSP_ASSET, random_color_gen, tag_block, poop_name, material_co

vertex_list = [vertices[vertex_map[v0]], vertices[vertex_map[v1]], vertices[vertex_map[v2]]]
for vertex_idx, vertex in enumerate(vertex_list):
loop_index = triangle_index + vertex_idx
loop_index = (triangle_start * 3) + triangle_index + vertex_idx

U = vertex.primary_lightmap_texcoord[0]
V = vertex.primary_lightmap_texcoord[1]
Expand Down

0 comments on commit 6b1a453

Please sign in to comment.