From 379a907b97a982c98736f55be5cd174acb813467 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milan=20Hrabovsk=C3=BD?= <70859762+LKAMinco@users.noreply.github.com> Date: Fri, 5 Apr 2024 22:45:59 +0200 Subject: [PATCH] fix(mesh): fix normals calculation for Blender 4.1 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 --- addon/i3dio/node_classes/shape.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addon/i3dio/node_classes/shape.py b/addon/i3dio/node_classes/shape.py index b6d9bd2..ccf2c37 100644 --- a/addon/i3dio/node_classes/shape.py +++ b/addon/i3dio/node_classes/shape.py @@ -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.