Skip to content

Commit

Permalink
Rewrite to chenage loop into an enumerate
Browse files Browse the repository at this point in the history
  • Loading branch information
davekeeshan committed Mar 14, 2023
1 parent 54af5a6 commit 3707e2a
Showing 1 changed file with 2 additions and 27 deletions.
29 changes: 2 additions & 27 deletions io_scene_lwo/construct_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,34 +246,9 @@ def build_objects(lwo, ch):
for poly in me.polygons:
if poly.index in map_pack:
colors = map_pack[poly.index]
i=0
for loop_index in poly.loop_indices:
for i, loop_index in enumerate(poly.loop_indices):
vertexColorMap.data[loop_index].color = colors[i] + (1.0,)
i+=1
# All code below here is redundant

# if (2, 80, 0) < bpy.app.version:
# break
# vcol = me.vertex_colors[-1] # Not right
# else: # else bpy.app.version
# vcol = me.tessface_vertex_colors[-1]

#
# if not vcol or not vcol.data:
# break
# for fi in map_pack:
# if fi > len(vcol.data):
# continue
# # face = map_pack[fi]
# # colf = vcol.data[fi]
# #
# # if len(face) > 2:
# # colf.color1 = face[0]
# # colf.color2 = face[1]
# # colf.color3 = face[2]
# # if len(face) == 4:
# # colf.color4 = face[3]


# Create the UV Maps.
if len(layer_data.uvmaps_vmad) > 0 or len(layer_data.uvmaps_vmap) > 0:
allmaps = set(list(layer_data.uvmaps_vmad.keys()))
Expand Down

0 comments on commit 3707e2a

Please sign in to comment.