Skip to content

Commit

Permalink
fix(mesh): subset indexing
Browse files Browse the repository at this point in the history
First index and vertex was wrong calculated for 3 and more subsets, because function was returning number of vertices / indexes instead of sum of first + count
  • Loading branch information
LKAMinco authored Apr 14, 2024
1 parent 379a907 commit 566951f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addon/i3dio/node_classes/shape.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ def process_subset(self, mesh, subset: SubSet, triangle_offset: int = 0) -> tupl
self.triangles[-1].append(vertex_index)
subset.number_of_indices += 3
self.logger.debug(f"Subset {triangle.material_index} with '{len(subset.triangles)}' triangles and {subset}")
return (subset.number_of_vertices, subset.number_of_indices)
return subset.first_vertex + subset.number_of_vertices, subset.first_index + subset.number_of_indices

def populate_from_evaluated_mesh(self):
mesh = self.evaluated_mesh.mesh
Expand Down

0 comments on commit 566951f

Please sign in to comment.