Skip to content

Commit

Permalink
fix(mesh): fix normals calculation for Blender 4.1
Browse files Browse the repository at this point in the history
Add fix for the API changes in [Blender 4.1](https://projects.blender.org/blender/blender/commit/89e3ba4e25c9ff921b2584c294cbc38c3d344c34) regarding mesh normals calculations. It is backwards compatible with previous Blender versions.

Fix #208
  • Loading branch information
LKAMinco committed Apr 5, 2024
1 parent 79095ba commit 379a907
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion addon/i3dio/node_classes/shape.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ def generate_evaluated_mesh(self, mesh_object: bpy.types.Object, reference_frame
# Calculates triangles from mesh polygons
self.mesh.calc_loop_triangles()
# Recalculates normals after the scaling has messed with them
self.mesh.calc_normals_split()
if bpy.app.version < (4, 1, 0):
self.mesh.calc_normals_split()

# On hold for the moment, it seems to be triggered at random times in the middle of an export which messes with
# everything. Further investigation is needed.
Expand Down

0 comments on commit 379a907

Please sign in to comment.