From 12d56a9e62b629624ab907063769c7ccf6e139f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20L=C3=B6schner?= Date: Wed, 15 Jan 2025 09:56:00 +0100 Subject: [PATCH] Add missing version check for use_auto_smooth --- bseq/importer.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bseq/importer.py b/bseq/importer.py index 73b1d01..87d377a 100644 --- a/bseq/importer.py +++ b/bseq/importer.py @@ -204,7 +204,7 @@ def update_mesh(meshio_mesh, mesh): # set as split normal per vertex if mesh.BSEQ.split_norm_att_name and mesh.BSEQ.split_norm_att_name == k: - # If blender version is less than 4.1.0, then dont set auto smooth. + # If blender version is greater than 4.1.0, then don't set auto smooth. # It has been removed and normals will be used automatically if they are set. # https://developer.blender.org/docs/release_notes/4.1/python_api/#mesh if bpy.app.version < (4, 1, 0): @@ -217,8 +217,9 @@ def update_mesh(meshio_mesh, mesh): # set split normal per loop per vertex if mesh.BSEQ.split_norm_att_name and mesh.BSEQ.split_norm_att_name == k: - # Currently hard-coded for .obj files - mesh.use_auto_smooth = True + if bpy.app.version < (4, 1, 0): + mesh.use_auto_smooth = True + # currently hard-coded for .obj files indices = [item for sublist in meshio_mesh.cell_data["obj:vn_face_idx"][0] for item in sublist] mesh.normals_split_custom_set([meshio_mesh.field_data["obj:vn"][i - 1] for i in indices])